Advertisement
Guest User

tp

a guest
Oct 12th, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.50 KB | None | 0 0
  1. L = peripheral.wrap("left")
  2. R = peripheral.wrap("right")
  3.  
  4. L.setChannel(1)
  5. R.setChannel(2)
  6.  
  7. while true do
  8.   term.setCursorPos(1,1)
  9.   term.clear()
  10.   print("TP "..string.char(27).." "..string.char(26))
  11.   local e,k = os.pullEvent("key")
  12.   if e=="key" and k==keys.left then
  13.     print(string.char(27))
  14.     R.send(1)
  15.   elseif e=="key" and k==keys.right then
  16.     print(string.char(26))
  17.     L.send(2)
  18.   elseif e=="key" and k==keys.t then
  19.     printError("Terminated")
  20.     break
  21.   end
  22.   sleep(.5)
  23. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement