Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("Dieser Computer startet mit 30 Sekunden Verzoegerung")
- sleep(30)
- os.loadAPI("ocs/apis/sensor")
- sen = sensor.wrap("right")
- mon = peripheral.wrap("back")
- mon.setTextScale(1)
- i = 0
- energy = 0
- euquer = 0
- euquercounter = 1
- euquermittel = 0
- function displayCopyright()
- x,y = mon.getSize()
- string = "JoJa Productions"
- mon.setCursorPos((x-#string)/2,y)
- mon.setTextColor(colors.cyan)
- mon.write("Jo")
- mon.setTextColor(colors.orange)
- mon.write("Ja ")
- mon.setTextColor(colors.gray)
- mon.write("Productions")
- end
- while true do
- --term.clear()
- --term.setCursorPos(1,1)
- --term.setTextColor(colors.white)
- --term.write("Energy: ")
- --term.setTextColor(colors.red)
- ziele = sen.getTargets()
- for k,v in pairs(ziele) do
- if v.Position.X==2
- and v.Position.Y==-5
- and v.Position.Z==0
- then
- for a,b in pairs(sen.getTargetDetails(k)) do
- if type(b)=="table" then
- else
- if a == "EnergySunken" then
- energynew = b
- ----print(b)
- if i == 1 then
- energy = energynew-energyold
- end
- energyold = energynew
- i = 1
- end
- end
- end
- euquer = euquer + math.floor(energy/22)
- euquermittel = math.floor(euquer/euquercounter)
- euquercounter = euquercounter+1
- mon.clear()
- mon.setCursorPos(1,1)
- mon.setTextColor(colors.white)
- mon.write("Stromuebersicht")
- mon.setCursorPos(1,2)
- mon.setTextColor(colors.red)
- mon.write("Energy: ")
- mon.setTextColor(colors.white)
- mon.write(tostring(math.floor(energy/22)))
- mon.write(" EU/t")
- mon.setCursorPos(1,3)
- mon.setTextColor(colors.cyan)
- mon.write("Gesamt: ")
- mon.setTextColor(colors.white)
- mon.write(energynew)
- mon.write(" EU")
- mon.setTextColor(colors.orange)
- mon.setCursorPos(1,4)
- mon.write("EU/t Mittelwert: ")
- mon.setTextColor(colors.white)
- mon.write(math.floor(euquermittel))
- mon.write(" EU/t quer")
- displayCopyright()
- sleep(1)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement