Advertisement
maxtorcd55

uraniumcontrol

Apr 1st, 2014
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.90 KB | None | 0 0
  1. local hvState
  2. local hvCount
  3. local data
  4. moni = peripheral.wrap("top")
  5. while (true) do
  6.     dataStack = peripheral.call("back","getAllStacks")
  7.     dataHeat = peripheral.call("back","getHeat")/100
  8.     dataEU = peripheral.call("back","getEUOutput")*5
  9.     hvState = 0
  10.     hvCount = 0
  11.     for i=1, 42 do
  12.         if dataStack[i] ~= nil then
  13.             if dataStack[i]["rawName"] == "ic2.reactorventgold" then
  14.                 hvCount = hvCount + 1
  15.                 if dataStack[i]["dmg"] <= 0 then
  16.                     hvState = hvState + 1
  17.                 elseif dataStack[i]["dmg"] > 8000 then
  18.                     rs.setOutput("right",false)
  19.                 end
  20.             end
  21.         end
  22.     end
  23.     if (hvCount == hvState) and (hvCount > 0) and (dataHeat < 10) then
  24.         rs.setOutput("right", true)
  25.     end
  26.  
  27.     moni.clear()
  28.     moni.setCursorPos(1,1)
  29.     moni.write("Cooled HV: " ..hvState .."/" ..hvCount)
  30.     moni.setCursorPos(1,2)
  31.     moni.write("Heat: " ..dataHeat .."%")
  32.     moni.setCursorPos(1,3)
  33.     moni.write("EU/t: " ..dataEU)
  34.     sleep(1)
  35. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement