Jump to content




Lua Error Debugging Needed


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

#1 mastrkillerr

  • Members
  • 5 posts

Posted 18 February 2013 - 08:03 PM

Title: Lua Error Debugging Needed

I am trying to create a new OS from different code ive written and or found online, and what I have so far has all been taken from different coded programs and pasted together. So without modification I get an error about line 137 saying "MOPT IS NIL"
I understand that nil means not possible, not a function, blah blah blah. My confusion is that mopt is used in a program ive used before perfectly fine, also in the program i took the code from it works perfectly fine. Plz help me find a solution!!! D:

A pastebin of the code is http://pastebin.com/upTVAHWU

EDIT: the full error is:


error: attempt to index global `mopt' (a nil value)

#2 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 19 February 2013 - 07:09 AM

Interesting. Let's see the program you took the code from as well.

#3 Engineer

  • Members
  • 1,378 posts
  • LocationThe Netherlands

Posted 19 February 2013 - 07:14 AM

Look for some help over on the forums in programs and then DelOS..?

#4 mastrkillerr

  • Members
  • 5 posts

Posted 19 February 2013 - 07:16 AM

The menu system I got the most code from is at http://pastebin.com/nSmWUV6m
The OS I got the Download page code for is at http://pastebin.com/4EG3tBQz

I dont understand how It changed.... I never even messed with this line of code...

#5 mastrkillerr

  • Members
  • 5 posts

Posted 19 February 2013 - 07:20 AM

View PostEngineer, on 19 February 2013 - 07:14 AM, said:

Look for some help over on the forums in programs and then DelOS..?

Yes I used some DelOS code. And Ive looked on the forums, theres nothing about perfectly good code going all wonky.

#6 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 19 February 2013 - 07:21 AM

How are you running this? Just straight from the command-line? You're not doing anything crazy like trying to load it as an API, right?

#7 mastrkillerr

  • Members
  • 5 posts

Posted 19 February 2013 - 07:24 AM

Just command line. Eventually going to put it as the startup program

#8 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 19 February 2013 - 07:32 AM

Okay. If nobody else sees anything vastly wrong with this in the meantime, I'll try to remember to poke at it a little bit in ComputerCraft this evening.

#9 mastrkillerr

  • Members
  • 5 posts

Posted 19 February 2013 - 07:36 AM

Ok. I should probably mention that I changed that line to just say
drawMain() 
and it worked at getting the error out, but then you couldnt enter any of the pages for the menu. I figured Id rather solve an error then be frozen at the main menu.





2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users