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

{attempt to call nil}

Started by Tiberium_117, 22 May 2016 - 07:10 AM
Tiberium_117 #1
Posted 22 May 2016 - 09:10 AM
Hello Experts of computercraft,

I am in fallout style, building a airlock that has a Decontamination period between the Reactor room of my base and the outside world… {to get rid of the pesky radiation / outside germs}

I finally sat down and did some coding myself to try and and learn computercraft's Lua code better… I am almost there… when hit the button on my wall, it opens the correct Airlock door, but when it tries to display the decontamination screen it crashes with error:

airLock:35: attempt to call nil

please help, I must of tried to debug it myself for an hour… I decided to try the expert before I pull the rest of my hair out :P/>…

thanks for any help you can offer…

oh, and before i forget, here is my code: http://pastebin.com/kUhZ2X5M
Bomb Bloke #2
Posted 22 May 2016 - 09:18 AM
The error points to line 35, where we have:

monitor.setBackroundColor( colors.red )

And indeed, there's no "setBackroundColor" function in your "monitor" table. You're missing a "g".
Tiberium_117 #3
Posted 22 May 2016 - 09:36 AM
Thank you so much for the Fix, this goes to prove if you code an airlock at 3:30 in the morning, and your really tired, simple things can really screw you up… lolz… thanks again! :D/>
Tiberium_117 #4
Posted 23 May 2016 - 09:23 PM
Hello there me again with the same code only updated,

what the code is made to do is to manage an airlock for the reactor room of my base, you hit a button it opens the door, closes the door waits some time with sprinklers in the room to give you a "decon" shower the n open the other doo to let you out of the room… and the other way, you hit the other button and it does the same thing in reverse, it opens the outside door, makes you wait some seconds then open the reactor room door to let your enter…

the code will start on the computer and run with no error, but it is either not reading the input, or not executing the output, but the doors will not open… please help…

here is the original code "not using bundled cables": http://pastebin.com/34zRPCZn

and now the new code that runs, but doesn't work: http://pastebin.com/QbxJ7EHd


Note: the original code works, but with the new code, I was trying to add an air lock override lever so I don't have to keep waiting in the middle when trying to build my reactor…
Lyqyd #5
Posted 23 May 2016 - 10:43 PM
Threads merged. Please stick to one topic for all questions about a given program or piece of code.
Tiberium_117 #6
Posted 23 May 2016 - 11:36 PM
ok, sorry won't happen again
Bomb Bloke #7
Posted 24 May 2016 - 02:14 AM
Lines 50 - 52:

input1 = rs.getBundledInput( "top", colors.white )
input2 = rs.getBundledInput( "top", colors.orange )
input3 = rs.getBundledInput( "top", colors.magenta )

rs.getBundledInput() doesn't work like that. You're thinking of rs.testBundledInput().
Edited on 24 May 2016 - 12:14 AM
Tiberium_117 #8
Posted 24 May 2016 - 04:39 AM
so, how would i change the code for it to work with 3 inputs like that? just use the rs.testBendledInput() and it should work?
Tiberium_117 #9
Posted 24 May 2016 - 07:07 AM
thank you for the help, I changed it and it is now functional