Added a sleep function

This commit is contained in:
Sascha Martens 2020-11-06 22:53:01 +01:00
parent ef84490431
commit fdcc4f3eba

View File

@ -12,7 +12,9 @@ if not fs.exists('choptree.lua') then
end end
while true do while true do
-- Check if turtle has enough fuel -- First of all, wait a few minutes
os.sleep(300)
-- Check if turtle has enough fuel
if turtle.getFuelLevel() < (2 * (3 * NUM_OF_TREES)) then if turtle.getFuelLevel() < (2 * (3 * NUM_OF_TREES)) then
hare.selectItem('minecraft:' .. TREE_SAPLING .. 'log') hare.selectItem('minecraft:' .. TREE_SAPLING .. 'log')
turtle.refuel(2) turtle.refuel(2)