Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("Loading Tree Feller by: KiLLerBoy_001")
- sleep(0.1)
- print("..")
- sleep(0.1)
- print("..")
- sleep(0.1)
- print("..")
- sleep(0.1)
- print("..")
- sleep(0.5)
- print("Tree Feller loaded..")
- cnt = 0
- function RefuelCheck()
- fuel = turtle.getFuelLevel()
- if fuel < 1000 then
- turtle.refuel()
- else
- print("No need to refuel")
- print("Fuel Level="..fuel)
- end
- end
- function ChopDetect()
- if turtle.detect() then
- turtle.dig()
- print("Felling Tree")
- cnt = cnt+1
- print("Turtle has felled "..cnt.." tree(s)")
- else
- sleep(0.5)
- end
- turtle.turnLeft()
- turtle.turnLeft()
- if turtle.detect() then
- turtle.dig()
- print("Felling Tree")
- cnt = cnt+1
- print("Turtle has felled "..cnt.." tree(s)")
- else
- sleep(0.5)
- end
- turtle.turnRight()
- sleep(1)
- end
- function ClearPath()
- if turtle.detect() then
- turtle.dig()
- sleep(0.3)
- end
- end
- function WalkForward(endturn)
- ClearPath()
- turtle.forward()
- repeat
- ClearPath()
- turtle.forward()
- until turtle.detectDown()
- if endturn then
- turtle.turnRight()
- end
- end
- function StepLeft(x,y)
- turtle.turnLeft()
- sleep(0.2)
- for i = 1,x,1
- do
- ClearPath()
- sleep(0.2)
- turtle.forward()
- end
- for i = 1,y,1
- do
- turtle.forward()
- sleep(0.2)
- end
- turtle.turnRight()
- end
- function StepRight(x,y)
- turtle.turnRight()
- sleep(0.2)
- for i = 1,x,1
- do
- ClearPath()
- sleep(0.2)
- turtle.forward()
- end
- for i = 1,y,1
- do
- turtle.forward()
- sleep(0.2)
- end
- turtle.turnLeft()
- end
- MainThread = true
- while MainThread do
- turtle.turnLeft()
- WalkForward(true)
- ChopDetect()
- WalkForward(true)
- ChopDetect()
- WalkForward(true)
- ChopDetect()
- RefuelCheck()
- turtle.turnRight()
- turtle.turnRight()
- WalkForward(false)
- WalkForward(false)
- WalkForward(false)
- turtle.turnLeft()
- sleep(10)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement