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

[SOLVED]Code problem? (attempt to call Nil)

Started by XtremeKinKee, 02 November 2012 - 02:15 PM
XtremeKinKee #1
Posted 02 November 2012 - 03:15 PM
Hey, I recently wrote up this program in the computer and attempted to execute it but after executing it gave me an error of:

REPLENISH:21: attempt to call nil

there's something wrong with Line 21, but i'm not sure why it gives me that error,
line 21 checks that the input (the switch) whether it's turned off or not, if it's turned off then it will execute that bunch of code else it will execute the sleep function.

Any help will be appreciated,

If you require any more information about the code then don't hesitate to ask! :D/>/>

Thanks.


function pulseIceLoader()
loop = 0
repeat
rs.setBundledOutput("back", 8209)
sleep(0.5)
rs.setBundledOutput("back", 8208)
loop = loop +1
until  loop == 7
end


function UranLoader()
loop = 0
repeat
rs.setBundledOutput("back", 10256)
sleep(0.5)
rs.setBundledOutput("back", 8208)
loop = loop +1
until loop == 47
end

if rs.TestBundledInput("back", 4096) == false then
rs.setBundledOutput("back", 16 )
sleep(1)
rs.setBundledOutput("back", 8208)
sleep(1)
rs.setBundledOutput("back", 4976)
sleep(1)
rs.setBundledOutput("back", 8208)
sleep(1)
pulseIceLoader()
sleep(1)
UranLoader()
sleep(1)
rs.setBundledOutput("back", 16)
sleep(1)
rs.setBundledOutput("back", 0)
sleep(19)
	  else
		  sleep(1)
end
Luanub #2
Posted 02 November 2012 - 03:20 PM
You have rs.TestBundledInput() it should be rs.testBundledInput()
XtremeKinKee #3
Posted 02 November 2012 - 03:36 PM
Oh no, I May have fixed it.
the
rs.TestBundledInput("back", 4096) == false
was put into a variable and it worked.

it wasn't to do with case-sensitiveness :D/>/>

but thanks anyway :)/>/>