SHOW:
|
|
- or go back to the newest paste.
1 | --#load the touchpoint API | |
2 | os.loadAPI("touchpoint") | |
3 | os.sleep(1) | |
4 | ||
5 | --# wrap the modem to the computer | |
6 | local wlan = peripheral.wrap("bottom") | |
7 | ||
8 | --# initialize the button instance set on the monitor | |
9 | local t = touchpoint.new("right") | |
10 | ||
11 | --# Add a new button | |
12 | t:add("WWCS - Click To Enable/Disable", nil, 5, 1, 45, 1, colors.gray, colors.gray) | |
13 | t:add("Shulker", nil, 5, 3, 17, 3, colors.red, colors.green) | |
14 | t:add("Wither", nil, 19, 3, 31, 3, colors.red, colors.green) | |
15 | - | t:add("Feral Ghoul", nil, 33, 3, 45, 3, colors.red, colors.green) |
15 | + | t:add("FeralGhoul", nil, 33, 3, 45, 3, colors.red, colors.green) |
16 | t:add("Evoker", nil, 5, 5, 17, 5, colors.red, colors.green) | |
17 | - | t:add("Z Pigman", nil, 19, 5, 31, 5, colors.red, colors.green) |
17 | + | t:add("ZPigman", nil, 19, 5, 31, 5, colors.red, colors.green) |
18 | t:add("Ghast", nil, 33, 5, 45, 5, colors.red, colors.green) | |
19 | t:add("Skeleton", nil, 5, 7, 17, 7, colors.red, colors.green) | |
20 | - | t:add("Z Miner", nil, 19, 7, 31, 7, colors.red, colors.green) |
20 | + | t:add("ZMiner", nil, 19, 7, 31, 7, colors.red, colors.green) |
21 | t:add("Witch", nil, 33, 7, 45, 7, colors.red, colors.green) | |
22 | t:add("Blizz", nil, 5, 9, 17, 9, colors.red, colors.green) | |
23 | t:add("Slime", nil, 19, 9, 31, 9, colors.red, colors.green) | |
24 | t:add("Cyberdemon", nil, 33, 9, 45, 9, colors.red, colors.green) | |
25 | t:add("Spider", nil, 5, 11, 17, 11, colors.red, colors.green) | |
26 | t:add("Enderman", nil, 19, 11, 31, 11, colors.red, colors.green) | |
27 | ||
28 | --# draw the buttons | |
29 | t:draw() | |
30 | ||
31 | while true do | |
32 | - | --t:add("You will be teleported upon picking a kit", nil, 3, 17, 47, 18, colors.black, colors.black) |
32 | + | |
33 | local event, p1 = t:handleEvents(os.pullEvent()) | |
34 | if event == "button_click" then | |
35 | if p1 == "Shulker" then | |
36 | t:toggleButton(p1) | |
37 | if t.buttonList.Shulker.active then | |
38 | wlan.transmit(1,10,"WWCSON") | |
39 | else | |
40 | wlan.transmit(1,10,"WWCSOFF") | |
41 | end | |
42 | elseif p1 == "Wither" then | |
43 | t:toggleButton(p1) | |
44 | if t.buttonList.Wither.active then | |
45 | - | |
45 | + | wlan.transmit(2,10,"WWCSON") |
46 | else | |
47 | wlan.transmit(2,10,"WWCSOFF") | |
48 | end | |
49 | - | wlan.transmit(2,10,"WWCSON") |
49 | + | elseif p1 == "FeralGhoul" then |
50 | - | t:toggleButton(p1) |
50 | + | |
51 | - | elseif p1 == "Feral Ghoul" then |
51 | + | if t.buttonList.FeralGhoul.active then |
52 | - | wlan.transmit(3,10,"WWCSON") |
52 | + | wlan.transmit(3,10,"WWCSON") |
53 | - | t:toggleButton(p1) |
53 | + | |
54 | wlan.transmit(3,10,"WWCSOFF") | |
55 | - | wlan.transmit(4,10,"WWCSON") |
55 | + | |
56 | - | t:toggleButton(p1) |
56 | + | |
57 | - | elseif p1 == "Z Pigman" then |
57 | + | |
58 | - | wlan.transmit(5,10,"WWCSON") |
58 | + | if t.buttonList.Evoker.active then |
59 | - | t:toggleButton(p1) |
59 | + | wlan.transmit(4,10,"WWCSON") |
60 | else | |
61 | - | wlan.transmit(6,10,"WWCSON") |
61 | + | wlan.transmit(4,10,"WWCSOFF") |
62 | - | t:toggleButton(p1) |
62 | + | |
63 | elseif p1 == "ZPigman" then | |
64 | - | wlan.transmit(7,10,"WWCSON") |
64 | + | |
65 | - | t:toggleButton(p1) |
65 | + | if t.buttonList.ZPigman.active then |
66 | - | elseif p1 == "Z Miner" then |
66 | + | wlan.transmit(5,10,"WWCSON") |
67 | - | wlan.transmit(8,10,"WWCSON") |
67 | + | |
68 | - | t:toggleButton(p1) |
68 | + | wlan.transmit(5,10,"WWCSOFF") |
69 | end | |
70 | - | wlan.transmit(9,10,"WWCSON") |
70 | + | |
71 | - | t:toggleButton(p1) |
71 | + | |
72 | if t.buttonList.Ghast.active then | |
73 | - | wlan.transmit(10,10,"WWCSON") |
73 | + | wlan.transmit(6,10,"WWCSON") |
74 | - | t:toggleButton(p1) |
74 | + | |
75 | wlan.transmit(6,10,"WWCSOFF") | |
76 | - | wlan.transmit(11,10,"WWCSON") |
76 | + | |
77 | - | t:toggleButton(p1) |
77 | + | |
78 | t:toggleButton(p1) | |
79 | - | wlan.transmit(12,10,"WWCSON") |
79 | + | if t.buttonList.Skeleton.active then |
80 | - | t:toggleButton(p1) |
80 | + | wlan.transmit(7,10,"WWCSON") |
81 | else | |
82 | - | wlan.transmit(13,10,"WWCSON") |
82 | + | wlan.transmit(7,10,"WWCSOFF") |
83 | - | t:toggleButton(p1) |
83 | + | |
84 | elseif p1 == "ZMiner" then | |
85 | - | wlan.transmit(14,10,"WWCSON") |
85 | + | |
86 | - | t:toggleButton(p1) |
86 | + | if t.buttonList.ZMiner.active then |
87 | - | end |
87 | + | wlan.transmit(8,10,"WWCSON") |
88 | else | |
89 | wlan.transmit(8,10,"WWCSOFF") | |
90 | end | |
91 | elseif p1 == "Witch" then | |
92 | t:toggleButton(p1) | |
93 | if t.buttonList.Witch.active then | |
94 | wlan.transmit(9,10,"WWCSON") | |
95 | else | |
96 | wlan.transmit(9,10,"WWCSOFF") | |
97 | end | |
98 | elseif p1 == "Blizz" then | |
99 | t:toggleButton(p1) | |
100 | if t.buttonList.Blizz.active then | |
101 | wlan.transmit(10,10,"WWCSON") | |
102 | else | |
103 | wlan.transmit(10,10,"WWCSOFF") | |
104 | end | |
105 | elseif p1 == "Slime" then | |
106 | t:toggleButton(p1) | |
107 | if t.buttonList.Slime.active then | |
108 | wlan.transmit(11,10,"WWCSON") | |
109 | else | |
110 | wlan.transmit(11,10,"WWCSOFF") | |
111 | end | |
112 | elseif p1 == "Cyberdemon" then | |
113 | t:toggleButton(p1) | |
114 | if t.buttonList.Cyberdemon.active then | |
115 | wlan.transmit(12,10,"WWCSON") | |
116 | else | |
117 | wlan.transmit(12,10,"WWCSOFF") | |
118 | end | |
119 | elseif p1 == "Spider" then | |
120 | t:toggleButton(p1) | |
121 | if t.buttonList.Spider.active then | |
122 | wlan.transmit(13,10,"WWCSON") | |
123 | else | |
124 | wlan.transmit(13,10,"WWCSOFF") | |
125 | end | |
126 | elseif p1 == "Enderman" then | |
127 | t:toggleButton(p1) | |
128 | if t.buttonList.Enderman.active then | |
129 | wlan.transmit(14,10,"WWCSON") | |
130 | else | |
131 | wlan.transmit(14,10,"WWCSOFF") | |
132 | end | |
133 | end | |
134 | end | |
135 | end |