Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mon = peripheral.wrap("right")
- function refreshBar(x, xmax)
- ratio = x / xmax * 10
- text =""
- a = 0
- while a < ratio do
- a = a + 1
- text = text .. " "
- end
- mon.write(text)
- print(ratio)
- end
- x = 0
- mon.setTextScale(1)
- while true do
- mon.clear()
- if x < 10 then
- x = x + 1
- end
- if x == 10 then
- x = 0
- end
- mon.setCursorPos(1,1)
- mon.setBackgroundColor(colors.lime)
- refreshBar(x,10)
- mon.setBackgroundColor(colors.black)
- sleep(0.5)
- print(x)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement