Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- foundMonitor = false
- mw, mh = 0
- spawners = {}
- spawners[0] = false
- spawners[1] = true
- red = 16384
- green = 32
- function drawBox(x,y,w,h,c)
- i, j = 0;
- for i = x, w do
- for j = y, h do
- paintutils.drawPixel(i,j,c)
- end
- end
- end
- function drawGUI()
- if spawners[0] == true then
- drawBox(mw - mw/2, mh - mh/2, 5,2, green)
- else
- drawBox(mw - mw/2, mh - mh/2, 5,2, red)
- end
- if spawners[1] == true then
- drawBox(mw - mw/2, mh + mh/2, 5,2, green)
- else
- drawBox(mw - mw/2, mh + mh/2, 5,2, red)
- end
- end
- function update()
- end
- function init()
- if peripheral.isPresent("top") then
- mon = peripheral.wrap("top")
- mw, mh = mon.getSize()
- foundMonitor = true
- else
- foundMonitor = false
- print("Monitor not found - Aborting")
- end
- if foundMonitor == true then
- while true do
- term.redirect(mon)
- mon.clear()
- update()
- drawGUI()
- term.restore()
- sleep(1)
- end
- end
- end
- init()
Advertisement
Add Comment
Please, Sign In to add comment