Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mineshaftLength = 12
- cellLength = 1
- print("This turtle is under my control!")
- rednet.open("left")
- while true do
- id, msg = rednet.receive()
- --Movement commands
- if msg == "left" then
- turtle.turnLeft()
- end
- if msg == "right" then
- turtle.turnRight()
- end
- if msg == "forward" then
- turtle.forward()
- end
- if msg == "backward" then
- turtle.back()
- end
- if msg == "up" then
- turtle.up()
- end
- if msg == "down" then
- turtle.down()
- end
- --Mining commands
- if msg == "digForward" then
- turtle.dig()
- end
- if msg == "digUp" then
- turtle.digUp()
- end
- if msg == "digDown" then
- turtle.digDown()
- end
- --Placing commands
- if msg == "placeForward" then
- turtle.place()
- end
- if msg == "placeUp" then
- turtle.placeUp()
- end
- if msg == "placeDown" then
- turtle.placeDown()
- end
- --Attacking commands
- if msg == "attackForward" then
- turtle.attack()
- end
- if msg == "attackUp" then
- turtle.attackUp()
- end
- if msg == "attackDown" then
- turtle.attackDown()
- end
- --Sucking commands
- if msg == "suckForward" then
- turtle.suck()
- end
- if msg == "suckUp" then
- turtle.suckUp()
- end
- if msg == "suckDown" then
- turtle.suckDown()
- end
- end
- --Special Actions
- for a = 1, 9, 1 do
- if tonumber(msg) == a then
- cellLength = a
- write(cellLength)
- end
- end
- if msg == "tunnelDown" then
- for a = 1, mineshaftLength, 1 do
- for b = 1, cellLength, 1 do
- turtle.dig()
- turtle.forward()
- turtle.digUp()
- turtle.digDown()
- turtle.turnLeft()
- turtle.dig()
- turtle.forward()
- turtle.digUp()
- turtle.digDown()
- turtle.turnLeft()
- turtle.turnLeft()
- turtle.forward()
- turtle.dig()
- turtle.forward()
- turtle.digUp()
- turtle.digDown()
- turtle.turnLeft()
- turtle.turnLeft()
- turtle.forward()
- turtle.turnRight()
- end
- turtle.digDown()
- turtle.down()
- end
- end
- if msg == "tunnelForward" then
- for a = 1, mineshaftLength, 1 do
- for b = 1, cellLength, 1 do
- turtle.dig()
- turtle.forward()
- turtle.digUp()
- turtle.digDown()
- turtle.turnLeft()
- turtle.dig()
- turtle.forward()
- turtle.digUp()
- turtle.digDown()
- turtle.turnLeft()
- turtle.turnLeft()
- turtle.forward()
- turtle.dig()
- turtle.forward()
- turtle.digUp()
- turtle.digDown()
- turtle.turnLeft()
- turtle.turnLeft()
- turtle.forward()
- turtle.turnRight()
- end
- end
- end
- if msg == "tunnelUp" then
- for a = 1, mineshaftLength, 1 do
- for b = 1, cellLength, 1 do
- turtle.dig()
- turtle.forward()
- turtle.digUp()
- turtle.digDown()
- turtle.turnLeft()
- turtle.dig()
- turtle.forward()
- turtle.digUp()
- turtle.digDown()
- turtle.turnLeft()
- turtle.turnLeft()
- turtle.forward()
- turtle.dig()
- turtle.forward()
- turtle.digUp()
- turtle.digDown()
- turtle.turnLeft()
- turtle.turnLeft()
- turtle.forward()
- turtle.turnRight()
- end
- turtle.digUp()
- turtle.up()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement