Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- CompDCoreMon
- rednetHostname = "compCore"
- rednet.open("back")
- rednetProtocol = "core"
- rednetTimeout = 40
- rednet.host(rednetProtocol,rednetHostname)
- hostnameCMD = "cmdCore"
- m = peripheral.wrap("bottom")
- function Draw(v)
- -- v = {totalEnergy,MaxEnergy,tickPerS)
- m.clear()
- m.setBackgroundColor(colors.lightblue)
- m.setCursorPos(1,1)
- m.setTextColor(colors.black)
- m.write("Total charge : ")
- m.setCursorPos(16,1)
- if (v[1] > 0 ) then
- m.setTextColor(colors.green)
- else
- m.setTextColor(colors.red)
- end
- m.write(v[1])
- m.setTextColor(colors.black)
- m.setCursorPos(1,2)
- m.write("[")
- local nbGreen = (v[1] * 100) / v[2]
- m.setTextColor(colors.lime)
- for i=0,nbGreen,+1 do
- m.write("I")
- end
- m.setTextColor(colors.black)
- for j=0,(27-nbGreen),+1 do,
- m.write('-')
- end
- m.write("]")
- m.setCursorPos(1,4)
- m.write("Rf/tick = "
- m.setCursorPos(12,4)
- if v[3] > 0 then
- m.setTextColor(colors.green)
- else
- m.setTextColor(colors.red)
- end
- m.write(v[3])
- end
- while true do
- id, msg, p, d = rednet.receive(rednetProtocol)
- Draw(v)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement