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()
- mon.setCursorPos(1,1)
- if spawners[0] == true then
- drawBox(mw/2 - mw/4, mh/2 - mh/4, 5,2, 32)
- else
- drawBox(mw/2 - mw/4, mh/2 - mh/4, 5,2, 2)
- end
- if spawners[1] == true then
- drawBox(mw/2 - mw/4, mh/2 + mh/4, 5,2, 32)
- else
- drawBox(mw/2 - mw/4, mh/2 + mh/4, 5,2, 2)
- end
- end
- function update()
- end
- function init()
- if peripheral.isPresent("bottom") then
- mon = peripheral.wrap("bottom")
- mw, mh = mon.getSize()
- term.redirect(mon)
- foundMonitor = true
- else
- foundMonitor = false
- print("Monitor not found - Aborting")
- end
- if foundMonitor == true then
- --while true do
- update()
- drawGUI()
- sleep(1)
- --end
- term.restore()
- end
- end
- init()
Advertisement
Add Comment
Please, Sign In to add comment