Posted 11 January 2013 - 12:47 PM
Hello there,
I want to improve my Fir Wood Chopper Program i made by some freatures.
At first i have functions like this one:
It takes saplings out of a chest. This chest should refill itself (pipe) automatically. The turtle waits until it has enough saplings.
If the user use STRG+T now to terminate the program, because he cant fill up the chest at the moment and want to leave, the Turtle would stay where it is and the user has manually pick the Turtle up and replace it. This is a bit complicated because it has to be played above a furnace and it cant be placed on it while pressing Shift. :/
Instead of letting this happen i want to check if the user pressed Enter (28). Then the Turtle goes back to the start (accually just one block it has to travel) and exit the program and waiting in the main menu for input.
The problem i have, and i saw some other too is, that os.pullEvent() "stops" the program and waiting for an action happen.
Is there a way to solve this program easy? However it would be nice if someone can show me how to :P/>
Thank you
UNOBTANIUM
I want to improve my Fir Wood Chopper Program i made by some freatures.
At first i have functions like this one:
local function getSaplings()
turtle.select(2)
print("Taking saplings out of the chest!")
print("If nothing happens the chest might be empty!")
while turtle.getItemCount(2) < 16 do
turtle.drop()
os.sleep(3)
turtle.suck()
end
print("Succesful!")
end
It takes saplings out of a chest. This chest should refill itself (pipe) automatically. The turtle waits until it has enough saplings.
If the user use STRG+T now to terminate the program, because he cant fill up the chest at the moment and want to leave, the Turtle would stay where it is and the user has manually pick the Turtle up and replace it. This is a bit complicated because it has to be played above a furnace and it cant be placed on it while pressing Shift. :/
Instead of letting this happen i want to check if the user pressed Enter (28). Then the Turtle goes back to the start (accually just one block it has to travel) and exit the program and waiting in the main menu for input.
The problem i have, and i saw some other too is, that os.pullEvent() "stops" the program and waiting for an action happen.
Is there a way to solve this program easy? However it would be nice if someone can show me how to :P/>
Thank you
UNOBTANIUM