Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- f,u,d=false,false,false
- function look()
- print("look")
- local test,data = turtle.inspect()
- f = test and data or false
- test,data = turtle.inspectUp()
- u = test and data or false
- test,data = turtle.inspectDown()
- d = test and data or false
- end
- function step()
- print("step")
- look()
- if d and (
- d.name=="minecraft:stone"
- or d.name=="minecraft:dirt"
- or d.name=="minecraft:grass"
- )
- and not f then
- print("plant sapling")
- turtle.select(1)
- turtle.place()
- elseif f and f.name=="minecraft:sapling" then
- print("drop bonemill")
- turtle.select(2)
- turtle.place()
- elseif f and f.name=="minecraft:log" then
- print("Cutting")
- turtle.select(5)
- turtle.dig()
- turtle.digUp()
- turtle.up()
- elseif not f or f.name~="minecraft:log"
- and not d then
- print("landing")
- turtle.down()
- end
- end
- function main()
- local timer = os.startTimer(.5)
- while true do
- local e,k = os.pullEvent()
- if e=="key" and k==keys.t then
- break
- elseif e=="timer" then
- step()
- timer = os.startTimer(.5)
- end
- end
- end
- main()
Advertisement
Add Comment
Please, Sign In to add comment