SHARE
TWEET

reactor

a guest May 22nd, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. rednet.open("back")
  2. term.setTextColor(colors.gray)
  3. term.write("Looking for reactor...")
  4. while true do
  5.  
  6.   -- PULL DATA
  7.   event, msg = rednet.receive("reactor_server")
  8.   energy = msg.energy
  9.   control = msg.control
  10.   active = msg.active
  11.  
  12.   -- GUI
  13.   term.clear()
  14.  
  15.   term.setTextColor(colors.yellow)
  16.   term.setCursorPos(1,1)
  17.   term.write("Reactor Client")
  18.   term.setCursorPos(1,2)
  19.  
  20.   if active then
  21.     term.setTextColor(colors.green)
  22.     term.write("Active")
  23.   else
  24.     term.setTextColor(colors.red)
  25.     term.write("Inactive")
  26.   end
  27.  
  28.   term.setCursorPos(1,3)
  29.   term.setTextColor(colors.orange)
  30.   term.write(tostring(energy) .. " RF")
  31.  
  32.   term.setCursorPos(1,4)
  33.   term.setTextColor(colors.lightBlue)
  34.   term.write("Control Rods @ " .. control .. "%")
  35.  
  36.   term.setCursorPos(1,5)
  37.   term.setTextColor(colors.pink)
  38.   term.write("Set ")
  39.   term.setTextColor(colors.white)
  40.   control = read()
  41.   if #control > 0 then
  42.     term.setTextColor(colors.gray)
  43.     term.write("...")  
  44.     rednet.broadcast(control, "reactor_client")
  45.     os.sleep(1)
  46.   end
  47. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top