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

Error, Loading:9: attempt to call nil

Started by nhg123, 18 November 2012 - 01:22 PM
nhg123 #1
Posted 18 November 2012 - 02:22 PM
I'm attempting to add a computer to a TNT cannon with deployers to refill the cannon but for some reason i keep getting the error message: "Loading :9: attempt to call nil" the code reads this:


os.pullEvent = os.pullEventRaw
print ("Ready to load")

write("")
x = io.read()

if x == "load" then

redstone.setOutput ("right", true )

print ("Loading")

sleep(2)

redstone.setOutput ("right", false )

sleep(1)

shell.run "Fire"
end


Its been so long since i've done this i hardly remember how to fix this stuff.

Thx
Edited by
remiX #2
Posted 18 November 2012 - 02:40 PM
Wow spam :/

Try make shell.run "Fire" into shell.run("Fire")
Kingdaro #3
Posted 18 November 2012 - 02:42 PM
I can't seem to find any errors in this. Post the code of your "fire" program - maybe it's in there.

Wow spam :/

Try make shell.run "Fire" into shell.run("Fire")
For some reason I knew someone would say this, even though it's perfectly valid.
remiX #4
Posted 18 November 2012 - 02:49 PM
I can't seem to find any errors in this. Post the code of your "fire" program - maybe it's in there.

Wow spam :/

Try make shell.run "Fire" into shell.run("Fire")
For some reason I knew someone would say this, even though it's perfectly valid.

Yeah I also thought it was valid, but I couldn't see anything else wrong with the code…

Edit: It does work, just tested. OP, you must have bugged CC somehow by editing main files?
Orwell #5
Posted 18 November 2012 - 03:18 PM
The program seems to be called 'Loading', not 'Fire', so it could be in the code for fire?
Kingdaro #6
Posted 18 November 2012 - 03:20 PM
As far as I know, using shell.run returns the error for the program that used shell.run, and not the run program itself. I might be wrong though.

Even then, line 9 is the first "redstone.setOutput" line, and I don't see anything wrong with that. :/
remiX #7
Posted 18 November 2012 - 05:09 PM
Even then, line 9 is the first "redstone.setOutput" line, and I don't see anything wrong with that. :/

Yeah, there's nothing wrong with his code.

To OP: Try reinstalling the whole of CC Mod.
Lyqyd #8
Posted 18 November 2012 - 06:33 PM
Please make sure that this code is exactly the code you're using and that you didn't automatically correct a typo when you retyped it on the forums (if that's what you did).