Posted 11 December 2012 - 05:56 AM
Hey guys. I am pretty much new to lua and the ComputerCraft mod. I'm trying to write a program that displays text on the screen saying "Press button for coffee.". Then the user presses the button and the code moves on. However, the code does not stop at the button part and just carries on anyway.
Also I want it so that it will wait forever for the user to press the button and not just time out. Here is my code.
Also I want it so that it will wait forever for the user to press the button and not just time out. Here is my code.
do
print("Press button for coffee.")
if redstone.getBundledInput("right") then ~ I'm using RedPower as well as ComputerCraft
print("Thank you! Please wait.")
textutils.slowPrint("---------")
print("Here you go!")
end
end
Help would be much appreciated (as would anything to make my code shorter!). If you can help, please do.