Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function clear()
- term.clear()
- term.setCursorPos(1,1)
- end
- function loop(func, am)
- if am == nil then
- am = 1
- end
- for i = 1, am do
- s = false
- while s == false do
- s = func()
- sleep(0.1)
- end
- end
- end
- function tillF(am)
- if turtle.detectDown() == true then
- loop(turtle.up)
- end
- for i = 1, am do
- loop(turtle.digDown)
- loop(turtle.forward)
- end
- end
- function main()
- while true do
- clear()
- write("Turtle Command> ")
- inp = read()
- if inp == "till" then
- clear()
- write("Amount> ")
- inp = read()
- tillF(tonumber(inp))
- end
- if inp == "tun" then
- while true do
- shell.run("tunnel","10")
- turtle.turnLeft()
- turtle.turnLeft()
- turtle.digDown()
- turtle.down()
- turtle.digDown()
- turtle.down()
- end
- end
- if inp == "help" then
- clear()
- print("Help:")
- print("Type till to till some ground, thats all I have right now.")
- print("Press any key to exit.")
- i = os.pullEvent()
- main()
- end
- end
- end
- shell.run("farm")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement