Posted 14 April 2014 - 12:01 AM
yo, so i have this code, and i want the turtle to check if it can pull from a inventory in front of it, if it can, then sleep 2 seconds, check again, then if it can then take from the inventory and put it in the chest above it.
this is supposed to be a de-clogger for the router from FTB.
heres the code:
the problem is that its pulling from it. and not checking if it can. if there are problems beyond that i do not know. as i havent got that far yet.
TL;DR
how do i make a turtle return true if it can do something. and not just do it, then return true.
this is supposed to be a de-clogger for the router from FTB.
heres the code:
if turtle.suck() == true then
print ("can pull, waiting")
sleep (2)
if turtle.suck() == true then
turtle.pull()
os.reboot()
end
end
if turtle.suck() == false then
print ("why do you want me here?")
os.reboot()
end
the problem is that its pulling from it. and not checking if it can. if there are problems beyond that i do not know. as i havent got that far yet.
TL;DR
how do i make a turtle return true if it can do something. and not just do it, then return true.