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

:37: attempt to call nil

Started by darkroom, 12 December 2012 - 09:56 AM
darkroom #1
Posted 12 December 2012 - 10:56 AM
This problem has been vexing me for three days now this is my first post because i have tried almost everything i can think of to make this work. This program is a simple menu program and everything about it works BESIDES a this function local event , key = os.pullEvent(key). I checked the wiki and all the syntax is right. I rewrote the program 3 times to try to get it to work….. no luck when i try just the command without the program it works…. anyway thanks for your time here is the code for you to see.

http://pastebin.com/7aZgr8RR
OmegaVest #2
Posted 12 December 2012 - 10:57 AM
os.pullEvent("key")

Needs quotes. Otherwise it thinks you are trying to call the empty variable you just instantiated.
darkroom #3
Posted 12 December 2012 - 10:58 AM
tried that doesn't work and wow that was fast
OmegaVest #4
Posted 12 December 2012 - 11:02 AM
Oh, I see.


You wrote over an API with a table. Don't label things os. Use os1. That's why it doesn't know about pullEvent().
darkroom #5
Posted 12 December 2012 - 11:03 AM
oh… my… god…. i thought i was a better coder than that :P/> thanks a bunch
OmegaVest #6
Posted 12 December 2012 - 11:09 AM
We all have our days. I spent a good few hours looking for a lost if-end. Turns out I had left off an equals somewhere.