Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bat=peripheral.wrap("top")
- mon=peripheral.wrap("bottom")
- stanje=rs.getBundledOutput("left")
- if (stanje==1) then
- reaktor="ukljucen"
- else
- reaktor="Iskljucen"
- end
- maxBat=bat.getMaxEnergyStored("unkhnown")
- y=1
- mon.clear()
- function nr()
- y=y+1
- mon.setCursorPos(1,y)
- end
- while true do
- y=3
- mon.setCursorPos(1,1)
- mon.setTextColor(colors.yellow)
- -- mon.setBackgroundColor(colors.blue)
- mon.write("Stanje Baterije ;")
- -- mon,setBackground(colors.black)
- mon.setCursorPos(1,3)
- struja=bat.getEnergyStored("unkhnown")
- mon.write(struja)
- proc=math.floor((struja/maxBat)*100)
- mon.write(" "..proc.."%")
- sleep(0.5)
- if proc <= 50 then
- mon.clear()
- rs.setBundledOutput("left",1)
- reaktor="ukljucen"
- boja=colors.green
- else
- if proc >=98 then
- mon.clear()
- rs.setBundledOutput("left",0)
- reaktor="Iskljucen"
- boja=colors.red
- end
- end
- nr()
- mon.setTextColor(boja)
- mon.write("reaktor je : "..reaktor)
- mon.setTextColor(colors.white)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement