View difference between Paste ID: sbSSP1ky and Pyn36UB4
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 = x
10
	while i < w do
11
	j = y
12
		while j < h do
13
			paintutils.drawPixel(i,j,c)
14
			j = j+1
15
		end
16
	i = i+1
17
	end
18
end
19
function drawGUI()
20
	mon.setCursorPos(1,1)
21-
	if spawners[0] == true then
21+
	if spawners[0] == false then
22-
		drawBox(mw/2 - mw/4, mh/2 - mh/4, 5,2, 32)
22+
		drawBox(3,3,10,6, red)
23-
	else 
23+
	else
24-
		drawBox(mw/2 - mw/4, mh/2 - mh/4, 5,2, 2)
24+
		drawBox(3,3,10,6, green)
25
	end
26-
	if spawners[1] == true then
26+
27-
		drawBox(mw/2 - mw/4, mh/2 + mh/4, 5,2, 32)
27+
	if spawners[1] == false then
28-
	else 
28+
		drawBox(3,12,10,6, red)
29-
		drawBox(mw/2 - mw/4, mh/2 + mh/4, 5,2, 2)
29+
	else
30
		drawBox(3,12,10,6, green)
31
	end
32
33
end
34
function update()
35
36
end
37
38
function init()
39
if peripheral.isPresent("bottom") then	
40
	mon = peripheral.wrap("bottom")
41
	mw, mh = mon.getSize()
42
	mon.setBackgroundColor(1)
43
	mon.clear()
44
	term.redirect(mon)
45
	foundMonitor = true
46
else
47
	foundMonitor = false
48
	print("Monitor not found - Aborting")
49
end
50
if foundMonitor == true then
51
	--while true do 
52
		update()
53
		drawGUI()
54
		sleep(1)
55
	--end
56
	term.restore()
57
end
58
end
59
60
init()