Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local treecut = 0
- local sapplingplaced = 0
- local i = 0
- local sleeping = 0
- local x = 0
- print("*** Tree Bot By Fish ***")
- print("Put Coal in slot 1")
- print("Put Samples in slot 2")
- print("************************")
- print(" ")
- print("Trees broken: " .. treecut)
- print("Fuel level: " .. turtle.getFuelLevel())
- print("Sapplings placed:" .. sapplingplaced)
- print("")
- print("************************")
- function refuel()
- if turtle.getFuelLevel() < 800 then
- turtle.select(1)
- repeat
- turtle.refuel(1)
- sleep(0.5)
- until turtle.getFuelLevel() > 1600
- turtle.select(2)
- end
- end
- if turtle.getItemCount(1) > 2 and turtle.getItemCount(2) > 2 then
- repeat
- refuel()
- if turtle.detect() then
- print("turtle.detect = true - First if")
- sleep(0.5)
- turtle.up()
- turtle.turnLeft()
- turtle.turnLeft()
- turtle.turnLeft()
- turtle.turnLeft()
- if turtle.detect() then
- print("turtle.detect = true - Second if")
- sleep(0.5)
- turtle.down()
- turtle.dig()
- turtle.forward()
- repeat
- turtle.digUp()
- turtle.up()
- turtle.detectUp()
- i = i + 1
- until turtle.detectUp() == false
- repeat
- turtle.down()
- i = i - 1
- until i == 0
- treecut = treecut + 1
- turtle.back()
- turtle.select(2)
- turtle.place()
- sapplingplaced = sapplingplaced + 1
- sleeping = 120
- repeat
- sleep(0.5)
- print("")
- print("")
- print("*** Tree Bot By Fish ***")
- print(" ")
- print("************************")
- print(" ")
- print("Trees broken:" .. treecut)
- print("Fuel level: " .. turtle.getFuelLevel())
- print("Sapplings placed:" .. sapplingplaced)
- print("")
- print("Sleeping mode:" .. sleeping)
- print("1*******************" .. x)
- sleeping = sleeping - 1
- until sleeping == 0
- else
- refuel()
- print("turtle.else = true - First else")
- sleep(0.5)
- turtle.down()
- sleeping = 60
- repeat
- sleep(0.5)
- print("")
- print("")
- print("*** Tree Bot By Fish ***")
- print(" ")
- print("************************")
- print(" ")
- print("Trees broken:" .. treecut)
- print("Fuel level: " .. turtle.getFuelLevel())
- print("Sapplings placed:" .. sapplingplaced)
- print("")
- print("Sleeping mode:" .. sleeping)
- print("2*******************" .. x)
- sleeping = sleeping - 1
- until sleeping == 0
- end
- else
- refuel()
- print("turtle.Else = true - Second Else")
- sleep(0.5)
- turtle.select(2)
- turtle.place()
- sapplingplaced = sapplingplaced + 1
- sleeping = 120
- repeat
- sleep(0.5)
- print("")
- print("")
- print("*** Tree Bot By Fish ***")
- print(" ")
- print("************************")
- print(" ")
- print("Trees broken:" .. treecut )
- print("Fuel level: " .. turtle.getFuelLevel())
- print("Sapplings placed:" .. sapplingplaced)
- print(" ")
- print("Sleeping mode:" .. sleeping)
- print("3*******************" .. x)
- sleeping = sleeping - 1
- until sleeping == 0
- end
- x = x + 1
- until turtle.getItemCount(2) == 0
- print("Need more sapplings! Place in slot 2")
- else
- print("Need more Fual! Place in slot 1")
- print("Need more sapplings! Place in slot 2")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement