This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
mastrkillerr's profile picture

Lua Error Debugging Needed

Started by mastrkillerr, 18 February 2013 - 07:03 PM
mastrkillerr #1
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)
Lyqyd #2
Posted 19 February 2013 - 07:09 AM
Interesting. Let's see the program you took the code from as well.
Engineer #3
Posted 19 February 2013 - 07:14 AM
Look for some help over on the forums in programs and then DelOS..?
mastrkillerr #4
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…
mastrkillerr #5
Posted 19 February 2013 - 07:20 AM
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.
Lyqyd #6
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?
mastrkillerr #7
Posted 19 February 2013 - 07:24 AM
Just command line. Eventually going to put it as the startup program
Lyqyd #8
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.
mastrkillerr #9
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.