Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --##################--
- -- Programm by endminecraffter
- -- https://pastebin.com/u/endminecraffter
- -- Server: MyFTB.de Deutsches Minecraft modded Netzwerk
- -- Benoetigte Mods/Apis: Mod BigReactors
- --##################--
- function wrapPs(peripheralName)
- periTab={}
- sideTab={}
- if peripheralName==nil then
- print("Fehler")
- end
- local peripherals = peripheral.getNames()
- local i2 = 1
- for i =1, #peripherals do
- if peripheral.getType(peripherals[i])==peripheralName then
- periTab[i2]=peripheral.wrap(peripherals[i])
- sideTab[i2]=peripherals[i]
- i2=i2+1
- end
- end
- if periTab~={} then
- return periTab,sideTab
- else
- return nil
- end
- end
- mon = peripheral.wrap("back")
- monX,monY = mon.getSize()
- r = wrapPs("BigReactors-Reactor")[1]
- function loadmon()
- mon.setBackgroundColor(colors.black)
- mon.clear()
- mon.setCursorPos(17,1)
- mon.setTextScale(1)
- mon.write("endReactorControll")
- mon.setCursorPos(2,4)
- mon.setTextScale(1)
- mon.write("Energy: ".. getEnergy() .."%")
- mon.setCursorPos(2,5)
- mon.write("Aktiviert: ".. getRActive())
- mon.setCursorPos(2,6)
- mon.write("CoreTemp: ".. getTemper())
- mon.setCursorPos(2,7)
- mon.write("CasingTemp: ".. getCTemper())
- mon.setCursorPos(2,8)
- mon.write("Produc: ".. getProduc().." RF")
- mon.setCursorPos(2,9)
- mon.write("RodLevel: ".. getRodLevel().."%")
- mon.setCursorPos(2,10)
- mon.write("Fuel: ".. getFuel().."%")
- end
- function getFuel()
- local fuel = r.getFuelAmount()
- local maxfuel = r.getFuelAmountMax()
- return math.floor((fuel/maxfuel)*100)
- end
- function getEnergy()
- local amount = r.getEnergyStored()
- return math.floor((amount/10000000)*100)
- end
- function getRodLevel()
- local rod = r.getControlRodLevel(1)
- return rod
- end
- function getRActive()
- local active = r.getActive()
- if active == false then
- return "Nein"
- else
- return "ja"
- end
- end
- function ActiveR()
- end
- function DActiveR()
- end
- function getProduc()
- local produc = r.getEnergyProducedLastTick()
- local prod = math.floor(math.abs(produc))
- return prod
- end
- function getTemper()
- local temp = r.getFuelTemperature()
- return math.floor(math.abs(temp))
- end
- function getCTemper()
- local CTemp = r.getCasingTemperature()
- return math.floor(math.abs(CTemp))
- end
- function drawBar()
- local energy = r.getEnergyStored()
- local maxenergy = 10000000
- bar = math.floor(((energy/maxenergy)*(monX-14))+0.5)
- --Draw Background Bar
- mon.setCursorPos(13,monY-16)
- mon.setBackgroundColor(colors.red)
- mon.write(string.rep(" ", monX-14))
- --Draw Perc Bar
- mon.setCursorPos(13,monY-16)
- mon.setBackgroundColor(colors.green)
- mon.write(string.rep(" ", bar))
- end
- while true do
- loadmon()
- drawBar()
- sleep(2)
- end
- drawBar()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement