Advertisement
ns09005264

remote-slave.lua

Nov 19th, 2020 (edited)
451
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.63 KB | None | 0 0
  1. rednet.open("right");
  2.  
  3. function move(key)
  4.     if key == "w" then
  5.         turtle.forward();
  6.     end
  7.     if key == "a" then
  8.         turtle.turnLeft();
  9.     end
  10.     if key == "s" then
  11.         turtle.back();
  12.     end
  13.  
  14.     if key == "d" then
  15.         turtle.turnRight();
  16.     end
  17.  
  18.     if key == "z" then
  19.         turtle.down();
  20.     end
  21.  
  22.     if key == "x" then
  23.         turtle.up();
  24.     end
  25.  
  26.     if key == "c" then
  27.         turtle.dig();
  28.     end
  29.  
  30.     if key == "v" then
  31.         turtle.place();
  32.     end
  33. end
  34.  
  35. while true do
  36.     local sender, msg, protocol = rednet.receive("theft");
  37.     print(msg);
  38.     move(msg);
  39. end
  40.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement