Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local mon = peripheral.wrap("left")
- local glass = peripheral.wrap("right")
- local me = peripheral.wrap("appeng_me_tilecraftingterminal_2")
- local colorRange = {0x04ff00, 0x6fff00, 0x91ff00, 0xbfff00, 0xfbff00, 0xffdd00, 0xffb700, 0xff7b00, 0xff5500, 0xff0000}
- me.getUsedBytes = me.getUnusedBytes
- function glassUpdate()
- while (true) do
- glass.clear()
- glass.addBox(0,0,52,18,colorRange[math.floor((me.getUsedBytes() / me.getTotalBytes()) * 10)],1)
- glass.addText(5, 5, "ME: " .. math.floor((me.getUsedBytes() / me.getTotalBytes()) * 100) .. "%", 0xffffff)
- sleep(5)
- end
- end
- function monitorUpdate()
- while (true) do
- mon.clear()
- mon.setCursorPos(1,1)
- if (#glass.getUsers() == 0) then
- mon.write("No active users :(")
- else
- mon.write("Active Users")
- users = glass.getUsers()
- i = 1
- for key, value in pairs(users) do
- i = i + 1
- mon.setCursorPos(1,i)
- mon.write(key .. " " .. tostring(value))
- end
- end
- sleep(1)
- end
- end
- parallel.waitForAll(glassUpdate, monitorUpdate)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement