Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Replace with the appropriate modem address and client computer ID
- local modemAddress = "left"
- local clientComputerID = 26
- local monitor = peripheral.wrap("back")
- function drawProgressBar(x, y, percentage)
- monitor.setCursorPos(x, y)
- monitor.setBackgroundColor(colors.white)
- monitor.clearRow(y)
- monitor.setBackgroundColor(colors.blue)
- local width = math.floor(percentage / 100 * (monitor.getSize()))
- monitor.setCursorPos(x, y)
- monitor.write(string.rep(" ", width))
- monitor.setBackgroundColor(colors.white)
- end
- rednet.open(modemAddress)
- while true do
- local senderID, message = rednet.receive()
- if senderID == clientComputerID then
- monitor.clear()
- drawProgressBar(1, 1, message)
- monitor.setCursorPos(1, 2)
- monitor.setTextColor(colors.black)
- monitor.write("RF: " .. message .. "%")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement