Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- s = sleep(0.2)
- a = peripheral.wrap("back")
- mon = peripheral.wrap("left")
- mon.clear()
- ballMax = a.getMaxEnergyStored()
- print(ballMax/5)
- print(ballMax/4)
- print(ballMax/3)
- print(ballMax/2)
- function ballIO()
- ballMinNow = a.getEnergyStored()
- sleep(1)
- ballMinLater = a.getEnergyStored()
- ballState = ballMinLater - ballMinNow
- if ballState >= 0.0 then
- mon.setCursorPos(1,2)
- mon.setTextColor(colors.green)
- mon.write("+"+tostring(ballState)+" RF/s")
- elseif ballState <= 0.0 then
- mon.setCursorPos(1,2)
- mon.setTextColor(colors.orange)
- mon.write("-"+tostring(ballState)+" RF/s")
- end
- end
- function ballBuffer()
- ballCharge = a.getEnergyStored()
- if ballCharge >= ballMax/2 then
- mon.setCursorPos(1,1)
- mon.setTextColor(colors.purple)
- mon.write(tostring(ballCharge)+" RF ")
- elseif ballCharge >= ballMax/3 then
- mon.setCursorPos(1,1)
- mon.setTextColor(colors.cyan)
- mon.write(tostring(ballCharge)+" RF ")
- elseif ballCharge >= ballMax/4 then
- mon.setCursorPos(1,1)
- mon.setTextColor(colors.lightblue)
- mon.write(tostring(ballCharge)+" RF ")
- elseif ballCharge >= ballMax/5 then
- mon.setCursorPos(1,1)
- mon.setTextColor(colors.blue)
- mon.write(tostring(ballCharge)+" RF ")
- elseif ballCharge >= ballMax/6 then
- mon.setCursorPos(1,1)
- mon.setTextColor(colors.lime)
- mon.write(tostring(ballCharge)+" RF ")
- elseif ballCharge >= ballMax/7 then
- mon.setCursorPos(1,1)
- mon.setTextColor(colors.green)
- mon.write(tostring(ballCharge)+" RF ")
- elseif ballCharge >= ballMax/8 then
- mon.setCursorPos(1,1)
- mon.setTextColor(colors.yellow)
- mon.write(tostring(ballCharge)+" RF ")
- elseif ballCharge >= ballMax/9 then
- mon.setCursorPos(1,1)
- mon.setTextColor(colors.orange)
- mon.write(tostring(ballCharge)+" RF ")
- elseif ballCharge >= ballMax/10 then
- mon.setCursorPos(1,1)
- mon.setTextColor(colors.red)
- mon.write(tostring(ballCharge)+" RF ")
- elseif ballCharge >= ballMax/11 then
- mon.setCursorPos(1,1)
- mon.setTextColor(colors.white)
- mon.write(tostring(ballCharge)+" RF ")
- end
- end
- function update()
- ballIO()
- ballBuffer()
- end
- while true do
- sleep(s)
- update()
- end
- --Größer-als-Zeichen (>) und das Kleiner-als-Zeichen (<)
- --2 140 000 000 000 trillion
Add Comment
Please, Sign In to add comment