Advertisement
Guest User

Activate

a guest
Apr 23rd, 2019
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.72 KB | None | 0 0
  1. local function dig()
  2.   turtle.dig()
  3.   turtle.up()
  4.   turtle.dig()
  5.   turtle.down()
  6. end
  7.  
  8. rednet.open("right")
  9. while true do
  10.   id,message = rednet.receive()
  11.   print("ID:"..id.."Message: "..message)
  12.   if id==10 then
  13.     if message == "forward" then
  14.       turtle.forward()
  15.     elseif message == "left" then
  16.       turtle.turnLeft()
  17.     elseif message == "right" then
  18.       turtle.turnRight()
  19.     elseif message == "back" then
  20.       turtle.back()
  21.     elseif message == "attack" then
  22.       turtle.attack()
  23.     elseif message == "dig" then
  24.       dig()
  25.     elseif message == "switch" then
  26.       succes = turtle.equipLeft()
  27.       if not succes then
  28.         rednet.send(10,"failed to equip")
  29.       end
  30.     end
  31.   end
  32. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement