Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local modem = peripheral.wrap("right")
- local auth = 17138
- local mon = peripheral.wrap("top")
- local messages = {}
- local cooldown = 3
- local refreshtime = 1
- list = {
- [17138] = {"Gesamt ",1},
- [17153] = {"Hv-Maschie ",2},
- [17152] = {"Hv-Mesystem",3},
- [17150] = {"Me-System ",4}
- }
- os.startTimer(cooldown)
- modem.open(65535)
- function moncc()
- mon.clear()
- mon.setCursorPos(1,1)
- end
- while true do
- local event, a1, a2, a3, a4, a5 = os.pullEvent()
- if event == "modem_message" then
- if list[tonumber(a3)] then
- if messages[tonumber(a3)] then
- table.remove(messages,tonumber(a3))
- end
- table.insert(messages,tonumber(a3),a4)
- end
- elseif event == "timer" then
- moncc()
- mon.setCursorPos(3,2)
- mon.setTextColor(colors.white); mon.write("----------------------------")
- for k,v in pairs(messages) do
- newv = textutils.unserialize(v)
- mon.setCursorPos(3,2+list[k][2])
- value = math.floor(newv[1])
- mon.setTextColor(colors.lightGray); mon.write(list[k][1])
- mon.setTextColor(colors.white); mon.write(": ")
- if value > 0 then
- mon.setTextColor(colors.lime)
- else
- mon.setTextColor(colors.red)
- end
- mon.write(value)
- mon.setCursorPos(24,2+list[k][2])
- mon.setTextColor(colors.white); mon.write(" eu/t")
- end
- os.startTimer(refreshtime)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement