Posted 07 January 2013 - 05:13 AM
Hi i've never coded before in my long life, but im reading up on it :D/> and im starting to understand a few things (your gonna laugh when you see the code, and how simple it is, and yet not working)
i wanted to make a small little food machine as a test, using 3 dispensers (i know you could probably use a turtle as a food dispensing robot, but i also know im quite limited ,P)
can someone explain in simple mans terms why this is not working?
It starts up right and prints the menu.. but then it's like it thinks it's done and terminates the script..
I've looked at the code for quite some time and tried a few things, none of wich worked
See i just knew you would laugh :(/>
i wanted to make a small little food machine as a test, using 3 dispensers (i know you could probably use a turtle as a food dispensing robot, but i also know im quite limited ,P)
can someone explain in simple mans terms why this is not working?
It starts up right and prints the menu.. but then it's like it thinks it's done and terminates the script..
I've looked at the code for quite some time and tried a few things, none of wich worked
print("Welcome to the Food master1000")
name = io.read
sleep(2)
print(" |-=menu=-|")
print(" |1: Steak|")
print(" |2: Pork |")
print(" |3: Soup |")
if name == "1" then
redstone.setOutput("left",true)
print("Steak it is!")
sleep(1)
term.clear()
redstone.setOutput("left",false)
os.reboot()
end
if name == "2" then
redstone.setOutput("back",true)
print("Pork it is!")
sleep(1)
term.clear()
redstone.setOutput("back",false)
os.reboot()
end
if name == "3" then
redstone.setOutput("right",true)
print("Soup it is!")
sleep(1)
term.clear()
redstone.setOutput("right",false)
os.reboot()
end
See i just knew you would laugh :(/>