View difference between Paste ID: dBtVw1UJ and SufZNFM8
SHOW: | | - or go back to the newest paste.
1
foundMonitor = false
2
mw, mh = 0
3
spawners = {}
4
spawners[0] = false
5
spawners[1] = true
6
red = 16384
7
green = 32
8
function drawBox(x,y,w,h,c)
9
	i, j = 0
10
	for i = x, w do
11
		for j = y, h do
12
			paintutils.drawPixel(i,j,c)
13
		end
14
	end
15
end
16
function drawGUI()
17
	mon.setCursorPos(1,1)
18
	if spawners[0] == true then
19-
		drawBox(mw - mw/2, mh - mh/2, 5,2, 32)
19+
		drawBox(mw/2 - mw/4, mh/2 - mh/4, 5,2, 32)
20
	else 
21-
		drawBox(mw - mw/2, mh - mh/2, 5,2, 2)
21+
		drawBox(mw/2 - mw/4, mh/2 - mh/4, 5,2, 2)
22
	end
23
	if spawners[1] == true then
24-
		drawBox(mw - mw/2, mh + mh/2, 5,2, 32)
24+
		drawBox(mw/2 - mw/4, mh/2 + mh/4, 5,2, 32)
25
	else 
26-
		drawBox(mw - mw/2, mh + mh/2, 5,2, 2)
26+
		drawBox(mw/2 - mw/4, mh/2 + mh/4, 5,2, 2)
27
	end
28
end
29
function update()
30
31
end
32
33
function init()
34
if peripheral.isPresent("bottom") then	
35
	mon = peripheral.wrap("bottom")
36
	mw, mh = mon.getSize()
37
	term.redirect(mon)
38
	foundMonitor = true
39
else
40
	foundMonitor = false
41
	print("Monitor not found - Aborting")
42
end
43
if foundMonitor == true then
44-
	while true do 
44+
	--while true do 
45
		update()
46
		drawGUI()
47
		sleep(1)
48
	--end
49
	term.restore()
50
end
51
end
52
53
init()