Jump to content




[lua] [error] attempt to compare nil (trying to use variables in an API?)


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

#1 Sivuden

  • New Members
  • 2 posts

Posted 14 October 2012 - 11:04 AM

problem solved!

Without further ado, here's the error.. (I'm fairly new to the Lua language, as well)

Spoiler


addendum to prior note: whenever I have some other error in the code itself (say, lacking the second = for my comparisons) that error popped up instead. However, this error always comes back.

I'm quite sure it's related to my not being able to load the variables I set in the program itself to be used in the API functions, which is something I would very much like to know how to do. Unfortunately, I can't seem to find it- meaning it's probably so basic everyone knows... or simply can't be done.

I apologize in advance if my stupidity is offensive. :)/>

~Sivuden

#2 Mads

  • Members
  • 604 posts
  • LocationCopenhagen, Denmark

Posted 14 October 2012 - 12:25 PM

Just make a function called minerapi.init(), and pass in the variables. Then you set local variables in the API equal to these arguments.

#3 Sivuden

  • New Members
  • 2 posts

Posted 14 October 2012 - 08:04 PM

Problem solved, thank you!





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users