Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Komponenten --
- event.ignoreAll()
- gpu1 = computer.getGPUs(1)[1]
- Screen = component.proxy("FEC3E5EA47C6B134A9613FB0CC51CCD3")
- Tank1 = component.proxy("E19432AE46CCC08F1A5D09969E33CF85")
- Tank2 = component.proxy("98A62C4B4C2233627321D1B30816F8E5")
- gpu1:bindScreen(Screen)
- gpu1:setsize(100,20)
- gpu1:setForeground(1,1,1,1)
- gpu1:setBackground(0,0,0,0)
- -- event.listen(gpu1)
- -- Bezeichnungen --
- line="--------------------------"
- -- OPTION --
- Tank1:flush()
- Tank2:flush()
- -- DATEN --
- z = 0
- o = 5 -- oberes ende
- u = o+13 -- unteres ende
- function getdata()
- V1 = Tank1.fluidcontent
- F1 = Tank1.flowfill*60 - Tank1.flowdrain*60
- V1 = math.floor(V1) -- runden --
- F1 = math.floor(F1) -- runden --
- V2 = Tank2.fluidcontent
- F2 = Tank2.flowfill*60 - Tank2.flowdrain*60
- V2 = math.floor(V2) -- runden --
- F2 = math.floor(F2) -- runden --
- end
- -- AUSGABE --
- function stream()
- gpu1:fill(0,0,100,20," ")
- gpu1:setText(0,z,"Tank 1: "..V1.."L") -- Tank1
- gpu1:setText(15,z,"|".."\tNET: "..F1)
- gpu1:setText(0,z+1,line) -- Trennlinie
- gpu1:setText(0,z+2,"Tank 2: "..V2.."L") -- Tank2
- gpu1:setText(15,z+2,"|".."\tNET: "..F2)
- gpu1:setText(0,z+3,line) -- Trennlinie
- h = math.random(2400)
- -- h = 2400
- p = math.floor((100/2400)*h/10)
- x = 29 -- x Spalte für Anzeigen
- gpu1:setBackground(0,0,255,1)
- gpu1:fill(x+1,u-p,2,p," ")
- gpu1:setBackground(0,0,0,0)
- gpu1:setText(x,u,"----")
- gpu1:fill(x,o+3,1,10,"|")
- gpu1:fill(x+3,o+3,1,10,"|")
- gpu1:setText(x,o+2,"----")
- gpu1:setText(x,o+1,h)
- gpu1:setText(x,o,"----")
- gpu1:flush()
- end
- function Balken()
- end
- -- RUN --
- while true do
- event.pull(2)
- getdata()
- -- print(V1,"\t",V2)
- stream()
- end
Add Comment
Please, Sign In to add comment