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