6 posts
Posted 20 August 2012 - 04:58 PM
Im trying to make a code for my reactor but i dosent seem to work i can figure out why so i ask for some help.
every thing above the if works
nuke = "1712"
print ("Nuke Reactor Enter Code to Launch")
write "Launch Code: "
input = read()
print ("Reactor Running")
redstone.setOutput ("left", true)
sleep(5)
if
input == off then
print ("shutdown")
sleep(2)
os.shutdown()
else
print ("Not valid Code/Command")
sleep(2)
end
end
please help
318 posts
Location
Somewhere on the planet called earth
Posted 20 August 2012 - 05:03 PM
nuke = "1712"
print ("Nuke Reactor Enter Code to Launch")
write("Launch Code: ") --You need ( and ) here.
input = read()
if input == nuke --Added this so it will work
print ("Reactor Running")
redstone.setOutput ("left", true)
sleep(5)
elseif input == "off" then
print ("shutdown")
sleep(2)
os.shutdown()
else
print ("Not valid Code/Command")
sleep(2)
end
This should work
3790 posts
Location
Lincoln, Nebraska
Posted 20 August 2012 - 05:07 PM
nuke = "1712"
print ("Nuke Reactor Enter Code to Launch")
write("Launch Code: ") --You need ( and ) here.
input = read()
if input == nuke --Added this so it will work
print ("Reactor Running")
redstone.setOutput ("left", true)
sleep(5)
elseif input == "off" then
print ("shutdown")
sleep(2)
os.shutdown()
else
print ("Not valid Code/Command")
sleep(2)
end
This should work
Actually, for commands that only accept strings, the "()" is not necessary.
print("Correct")
and
print "correct"
Should do the same thing.
318 posts
Location
Somewhere on the planet called earth
Posted 20 August 2012 - 05:08 PM
nuke = "1712"
print ("Nuke Reactor Enter Code to Launch")
write("Launch Code: ") --You need ( and ) here.
input = read()
if input == nuke --Added this so it will work
print ("Reactor Running")
redstone.setOutput ("left", true)
sleep(5)
elseif input == "off" then
print ("shutdown")
sleep(2)
os.shutdown()
else
print ("Not valid Code/Command")
sleep(2)
end
This should work
Actually, for commands that only accept strings, the "()" is not necessary.
print("Correct")
and
print "correct"
Should do the same thing.
Hmm. i did not know that. Thank you :D/>/>
I guess i "corrected", a working line then :P/>/>
6 posts
Posted 20 August 2012 - 06:05 PM
nuke = "1712"
print ("Nuke Reactor Enter Code to Launch")
write("Launch Code: ") --You need ( and ) here.
input = read()
if input == nuke --Added this so it will work
print ("Reactor Running")
redstone.setOutput ("left", true)
sleep(5)
elseif input == "off" then
print ("shutdown")
sleep(2)
os.shutdown()
else
print ("Not valid Code/Command")
sleep(2)
end
This should work
Actually, for commands that only accept strings, the "()" is not necessary.
print("Correct")
and
print "correct"
Should do the same thing.
wow that's gonna help me a lot
and thank you for your help