Advertisement
Doob

rtrader tablet

Feb 17th, 2017
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.46 KB | None | 0 0
  1. local component = require("component")
  2. local modem = component.modem
  3. local cls = require("term").clear
  4. local E = require("event")
  5. modem.open(port)
  6. local port, e = 789
  7.  
  8. while true do
  9.   e = {E.pull()}
  10.   if e[1] == "modem_message" and e[5] < 20 then
  11.     if e[6]:sub(1, 1) == "#" then
  12.       cls()
  13.     end
  14.     print(e[6])
  15.   elseif e[1] == "key_down" then
  16.     if e[4] == 200 or e[4] == 208 or e[4] == 28 then
  17.       modem.broadcast(port, e[4])
  18.     end
  19.   end
  20. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement