mcfeuersturm

Untitled

May 26th, 2021 (edited)
647
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.83 KB | None | 0 0
  1. rednet.open("back")
  2. count = 0
  3. repeat
  4.     print(" ")
  5.     count = count+1
  6. until count == 19
  7. while true do
  8.  --term.clear()
  9.     local id, message, protocol = rednet.receive()
  10.     if protocol == "fussion_reactor_stats" then
  11.         local tab = textutils.unserialize(message)
  12.         if tab[0] == "ignited" then
  13.             term.setTextColor(colors.white)
  14.             write("Status: ")
  15.             if tab[1] then
  16.                 term.setTextColor(colors.green)
  17.                 print("An")
  18.             else
  19.                 term.setTextColor(colors.red)
  20.                 print("Aus")
  21.             end
  22.         end
  23.         if tab[0] == "producing" then
  24.             term.setTextColor(colors.white)
  25.             write("Produziert: ")
  26.             print(math.ceil(tonumber(tab[1])/1000) .. "kRF/t")
  27.         end
  28.         if tab[0] == "injection_rate" then
  29.             term.setTextColor(colors.white)
  30.             print("Injektionsrate: " .. tab[1])
  31.         end
  32.         if tab[0] == "percentage_full" then
  33.             term.setTextColor(colors.white)
  34.             write("Interner Speicher: ")
  35.             print(math.ceil(tonumber(tab[1])*100) .. "%")
  36.         end
  37.         if tab[0] == "clear" then
  38.             term.clear()
  39.         end
  40.     end
  41.     if protocol == "induction_matrix_stats" then
  42.         local tab = textutils.unserialize(message)
  43.         if tab[0] == "max" then
  44.             term.setTextColor(colors.white)
  45.             print("Maximale Kapazität: " .. tab[1])
  46.         end
  47.         if tab[0] == "transfer_max" then
  48.             term.setTextColor(colors.white)
  49.             print("Maximaler In/Output: " .. math.ceil(tonumber(tab[1])/1000/1000) .. "MRF/t")
  50.         end
  51.         if tab[0] == "balance" then
  52.             term.setTextColor(colors.white)
  53.             print("In/Out Balance: " .. tab[1])
  54.         end
  55.         if tab[0] == "charge" then
  56.             term.setTextColor(colors.white)
  57.             print("Speicher: " .. math.ceil(tonumber(tab[1])/1000/1000/1000) .. "GRF")
  58.         end
  59.         if tab[0] == "charge_percent" then
  60.             term.setTextColor(colors.white)
  61.             print("Speicher: " .. math.ceil(tonumber(tab[1])) .. "%")
  62.         end
  63.         if tab[0] == "clear" then
  64.             term.clear()
  65.         end
  66.     end
  67. end
Add Comment
Please, Sign In to add comment