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

what means "attempt call nil

Started by hopeless, 11 May 2012 - 12:06 PM
hopeless #1
Posted 11 May 2012 - 02:06 PM
i made program and it worked then i changed the code. it didn't work so i changed it back and now it says: Attempt call nil
please help.
hopeless #2
Posted 11 May 2012 - 02:28 PM
pass"password"

print("Reactor Control Console")
write"Password:"
input=read("*")
if pass==input then
print("Password Correct!")
sleep(2)
term.clear()
term.setCursorPos(1,1)
print("Reactor Control Console")
sleep(10)
x=5
while x>0 do
rs.setOutput("back",true)
print("Reactor is Active!")
sleep(30)
rs.setOutput("back",false)
print("Reactor is in Cooldown mode!")
sleep(30)
print("180seconds cooldown left.")
sleep(30)
print("150seconds cooldown left.")
sleep(30)
print("120seconds cooldown left.")
sleep(30)
print("90seconds cooldown left.")
sleep(30)
print("60seconds cooldown left.")
sleep(30)
print("30seconds cooldown left.")
sleep(30)
print("Cooldown is Complete!")
sleep(2)
term.clear()
term.setCursorPos(1,1)
print("Reactor Control Console")
x=x-1
end
print("Program is finished, rebooting")
sleep(2)
os.reboot()
else
print("Password Incorrect!")
sleep(2)
os.reboot()
end


program is saved to startup file. and previously it worked but not anymore… now it says:"Attempt to call nil"
Xtansia #3
Posted 11 May 2012 - 03:29 PM
pass"password" 
print("Reactor Control Console") 
write"Password:"
Should be:
pass = "password" 
print("Reactor Control Console") 
write("Password:")

Attempt to call nil means you are trying to use/call something that is not defined yet/no value set
hopeless #4
Posted 11 May 2012 - 03:46 PM
thanks. it's working again