Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rednet.open("right")
- function LookLeft(distance)
- for i = 1,distance do
- turtle.turnLeft()
- end
- end
- function LookRight(distance)
- for i = 1,distance do
- turtle.turnRight()
- end
- end
- function forward(distance)
- for i = 1,distance do
- turtle.forward()
- end
- end
- function back(distance)
- for i = 1,distance do
- turtle.back()
- end
- end
- function mine(distance)
- for i = 1,distance do
- turtle.dig()
- sleep(1.5)
- turtle.digUp()
- sleep(1.5)
- turtle.digDown()
- end
- end
- function up(distance)
- for i = 1,distance do
- turtle.up()
- end
- end
- function left(distance)
- turtle.turnLeft()
- for i = 1,distance do
- turtle.forward()
- end
- turtle.turnRight()
- end
- function down(distance)
- for i = 1,distance do
- turtle.down()
- end
- end
- function right(distance)
- turtle.turnRight()
- for i = 1,distance do
- turtle.forward()
- end
- turtle.turnLeft()
- end
- function payload(distance)
- redstone.setOutput("bottom", true)
- turtle.select(9)
- for i = 1,distance do
- turtle.placeDown()
- sleep(1)
- end
- redstone.setOutput("bottom", false)
- turtle.select(1)
- end
- while true do
- local id,msg,dist = rednet.receive()
- local command,dist = string.match(msg, "(%w+),(%w+)")
- if command == "forward" then
- forward(tonumber(dist))
- elseif command == "back" then
- back(tonumber(dist))
- elseif command == "dig" then
- mine(tonumber(dist))
- elseif command == "up" then
- up(tonumber(dist))
- elseif command == "down" then
- down(tonumber(dist))
- elseif command == "left" then
- left(tonumber(dist))
- elseif command == "right" then
- right(tonumber(dist))
- elseif command == "payload" then
- payload(tonumber(dist))
- elseif command == "lRight" then
- LookRight(tonumber(dist))
- elseif command == "lLeft" then
- LookLeft(tonumber(dist))
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement