Advertisement
Guest User

RC Turtle Client

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