Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function output(str)
- local i=1
- while i < string.len(str) do
- local char = string.sub(str,i,i)
- if char == '\n' then
- local x,y = monitor.getCursorPos()
- y = y + 1
- monitor.setCursorPos(1, y)
- elseif char == '#' then
- i = i + 1
- local color = tonumber(string.sub(str,i,i+4))
- monitor.setTextColor(color)
- i = i + 4
- else
- monitor.write(char)
- end
- i = i + 1
- end
- end
- monitor = peripheral.wrap("back")
- local request = http.get("https://fourconnected.homeip.net/cgi-bin/minecraft.cgi?action=monitor")
- monitor.clear()
- monitor.setCursorPos(1,1)
- output(request.readAll())
- request.close()
- local time = os.time()
- local formattedTime = textutils.formatTime(time, false)
- write(formattedTime .. "Status updated")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement