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

[solved]issues creating a menu

Started by limebriggs, 13 April 2013 - 10:00 AM
limebriggs #1
Posted 13 April 2013 - 12:00 PM
so im trying to create a menu for use with my minecart bank and if i try and move the cursor i get a error on line 111 attempt to get nil , if i try to select the first option i get and error on 118 attempt to index ? (a nil value) i can't seem to find where ive messed up and any help would be greatly appreciated, side note i believe the issue may be lay somewhere in my choice one function

i posted the code on pastebin to preserve the formatting and to make it easier to look at

http://pastebin.com/Kn39Rp2U
Bubba #2
Posted 13 April 2013 - 12:08 PM
The issue is on line 132, when you call the onKeyPressed function.

onKeyPressed(key, MainMenu)

It should be mainMenu without the capital letter.
limebriggs #3
Posted 13 April 2013 - 12:16 PM
that has fixed my original issue now i come up with 92: attempt to get nill any ideas?
Bubba #4
Posted 13 April 2013 - 12:18 PM
that has fixed my original issue now i come up with 92: attempt to get nill any ideas?
Capitalization error again. This time on line 16. You put:

printMenu(CartMenu)

CartMenu does not exist, but cartMenu does.

Whenever you get errors that have anything to do with nil values, go back and check spelling, capitalization, etc. I know that I often misspell things and checking anything that could reference that variable generally fixes the problem.
limebriggs #5
Posted 13 April 2013 - 12:23 PM
ok now i feel dumb lol thank you for the help :)/>