Advertisement
thatparadox

NIR T1

Apr 13th, 2013
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.01 KB | None | 0 0
  1. rednet.open("back") --Set Position of the modem on the computer
  2. nir = peripheral.wrap("bottom") --Set position of the NIR on the computer
  3.  
  4. temp = "Querying"
  5. reactor = "querying"
  6. reactorCom = 148 -- enter ID of Computer attached to the Reactor
  7. console = 146 -- Enter ID of the Computer attached to the Touch Screen
  8.  
  9.  
  10. while true do
  11.   dud1, dud2, card, info = nir.get(1)
  12.   for system, status in pairs(info) do
  13.     rednet.send(console, system)
  14.     ping = rednet.receive()
  15.       if ping == console then
  16.         status = tostring(status)
  17.         term.clear()
  18.         term.setCursorPos(1,1)
  19.         rednet.send(console, status)
  20.       end
  21.     if system == "heat" then
  22.       rednet.send(reactorCom, status)
  23.     end
  24.   end
  25.  -- dud1, dud2, card, info = nir.get(2)
  26.  -- for system, status in pairs(info) do
  27.  --   rednet.send(console, system)
  28.  --   ping = rednet.receive()
  29.  --   if ping == console then
  30.  --       status = tostring(status)
  31.  --       rednet.send(console, status)
  32.  --   end
  33.  -- end
  34.   os.sleep(2)
  35. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement