Jump to content




Cant Use Pastebin In An API?

api

  • You cannot reply to this topic
3 replies to this topic

#1 Zenon

  • Members
  • 50 posts

Posted 21 July 2015 - 02:59 AM

Hi all! I decided to make an autoupdater, and figured it best to only make it one program. I also figured that I may aswell make it in my api so I dont have to have an entirely seperate program. The problem comes in when I do this:
Spoiler
Now, running this normally will work . . . Just not when I load it as an api. Anyone know how I would get that to work?

Note: It returns the error
attempt to index nil ? (a nil value)
And I can use other functions in my api, so it isnt that.
--Wont be on again until tomorrow so dont think Im ignoring you if you reply. Thanks in advance!

Edited by theMCcm, 21 July 2015 - 04:48 PM.


#2 H4X0RZ

  • Members
  • 1,315 posts
  • LocationGermany

Posted 21 July 2015 - 03:06 AM

Are you calling the function just as checkUpdate() outside the API or as APINAME.checkUpdate()?

--Derp. You said you can access other API functions...--

I think the shell API is not "exposed" to other APIs. Try using os.run maybe.

Edited by H4X0RZ, 21 July 2015 - 03:08 AM.


#3 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 21 July 2015 - 04:01 AM

The shell "API" is an interface exposed to programs running under a shell instance, not an actual API that's available globally. For such a simple task, use http.get instead of os.run.

#4 Zenon

  • Members
  • 50 posts

Posted 21 July 2015 - 04:50 PM

View PostH4X0RZ, on 21 July 2015 - 03:06 AM, said:

Are you calling the function just as checkUpdate() outside the API or as APINAME.checkUpdate()?

--Derp. You said you can access other API functions...--

I think the shell API is not "exposed" to other APIs. Try using os.run maybe.

View PostLyqyd, on 21 July 2015 - 04:01 AM, said:

The shell "API" is an interface exposed to programs running under a shell instance, not an actual API that's available globally. For such a simple task, use http.get instead of os.run.

Thanks guys!

Edit: Heh. Thats way above my paygrade, Ill just use a seperate program until Im a little more into lua lol

Edited by theMCcm, 21 July 2015 - 05:15 PM.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users