View difference between Paste ID: mNUwicV2 and 9jcigaGU
SHOW: | | - or go back to the newest paste.
1
os.loadAPI("button")
2
m = peripheral.wrap("top")
3
m.clear()
4
5
function fillTable()
6-
   button.setTable("Thaumium", test1, 2,16,4,4)
6+
   button.setTable("SPAWN1", test1, 2,16,4,4)
7-
   button.setTable("Nitor", test2, 2,16,6,6)
7+
   button.setTable("SPAWN2", test2, 2,16,6,6)
8-
   button.setTable("Alumentum", test3, 2,16,8,8)
8+
   button.setTable("SPAWN3", test3, 2,16,8,8)
9-
   button.setTable("Tallow", test4, 2,16,10,10)
9+
   button.setTable("STOP", test4, 2,16,10,10)
10
   button.screen()
11
end
12
13
function getClick()
14
   event,side,x,y = os.pullEvent("monitor_touch")
15
   button.checkxy(x,y)
16
end
17
18
function test1()
19-
   button.toggleButton("Thaumium")
19+
   button.toggleButton("SPAWN1")
20-
   print("1")
20+
   rednet.open("right")
21
   rednet.broadcast("SP1")
22
   sleep(0.1)
23
   rednet.broadcast(" ")
24-
   button.toggleButton("Nitor")
24+
25-
   print("2")
25+
26
function test2()
27
   button.toggleButton("SPAWN2")
28
   rednet.open("right")
29-
   button.toggleButton("Alumentum")
29+
   rednet.broadcast("SP2")
30-
   print("3")
30+
   sleep(0.1)
31
   rednet.broadcast(" ")
32
end
33
34-
   button.toggleButton("Tallow")
34+
35-
   print("4")
35+
   button.toggleButton("SPAWN3")
36
   rednet.open("right")
37
   rednet.broadcast("SP3")
38
   sleep(0.1)
39
   rednet.broadcast(" ")
40
end
41
42
function test4()
43
   button.toggleButton("STOP")
44
   rednet.open("right")
45
   rednet.broadcast("STOP")
46
   sleep(0.1)
47
   rednet.broadcast(" ")
48
end
49
50
fillTable()
51
--button.heading("Demo Button Prog")
52
button.label(2,2,"Materials")
53
54
while true do
55
   getClick()
56
end