Posted 03 March 2015 - 11:21 AM
Hi Community
As you may or may not know I am currently making a farming turtle to plant seeds, and when they are ready to then go out and harvest them, and repeat the cycle if I so wish. one of the problems I have whilst coding is loops, what I am trying to achieve is if the turtle is low on fuel for the in-putted length and width I want the turtle to wait for fuel like so
As you may or may not know I am currently making a farming turtle to plant seeds, and when they are ready to then go out and harvest them, and repeat the cycle if I so wish. one of the problems I have whilst coding is loops, what I am trying to achieve is if the turtle is low on fuel for the in-putted length and width I want the turtle to wait for fuel like so
local fuel = turtle.getFuelLevel()
local tFuel = 16
write("Farm Length: ")
local length = io.read()
write("Farm Width: ")
local width = io.read()
totalBlocks = length * width --Depending if they are numbers WHICH THEY SHOULD BE!
--Then if the total blocks is less than the fuel level it will sit and wait for fuel
if fuel >= totalBlocks then
--Code which will carry out if the turtle has greater than or Equal to the fuel amount
else
--this is where i want the turtle to sit and wait for fuel but I dont know how
print("Please Input Fuel into Slot "..tFuel)
--then it will sit and wait until it gets fuel
end
Edited on 03 March 2015 - 10:24 AM