Advertisement
Guest User

RC Turtle Client

a guest
Aug 1st, 2014
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. rednet.open("top")
  2. print("Computercraft Turtle Control Client")
  3. print("-----------------------------------")
  4. print("   W     E")
  5. print(" A S D   Q")
  6. while true do
  7.   local event, key = os.pullEvent("char")
  8.   if key == "w" then
  9.     rednet.broadcast("forward")
  10.   end
  11.   if key == "a" then
  12.     rednet.broadcast("left")
  13.   end
  14.   if key == "s" then
  15.     rednet.broadcast("down")
  16.   end
  17.   if key == "d" then
  18.     rednet.broadcast("right")
  19.   end
  20.   if key == "q" then
  21.     rednet.broadcast("down")
  22.   end
  23.   if key == "e" then
  24.     rednet.broadcast("up")
  25.   end
  26.   if key == "x" then
  27.     break
  28.   end
  29. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement