Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --#load the touchpoint API
- os.loadAPI("touchpoint")
- os.sleep(1)
- --# wrap the modem to the computer
- local wlan = peripheral.wrap("bottom")
- --# initialize the button instance set on the monitor
- local t = touchpoint.new("right")
- --# Add a new button
- t:add("WWCS - Click To Enable/Disable", nil, 5, 1, 45, 1, colors.gray, colors.gray)
- t:add("Shulker", nil, 5, 3, 17, 3, colors.red, colors.green)
- t:add("Wither", nil, 19, 3, 31, 3, colors.red, colors.green)
- t:add("Feral Ghoul", nil, 33, 3, 45, 3, colors.red, colors.green)
- t:add("Evoker", nil, 5, 5, 17, 5, colors.red, colors.green)
- t:add("Z Pigman", nil, 19, 5, 31, 5, colors.red, colors.green)
- t:add("Ghast", nil, 33, 5, 45, 5, colors.red, colors.green)
- t:add("Skeleton", nil, 5, 7, 17, 7, colors.red, colors.green)
- t:add("Z Miner", nil, 19, 7, 31, 7, colors.red, colors.green)
- t:add("Witch", nil, 33, 7, 45, 7, colors.red, colors.green)
- t:add("Blizz", nil, 5, 9, 17, 9, colors.red, colors.green)
- t:add("Slime", nil, 19, 9, 31, 9, colors.red, colors.green)
- t:add("Cyberdemon", nil, 33, 9, 45, 9, colors.red, colors.green)
- t:add("Spider", nil, 5, 11, 17, 11, colors.red, colors.green)
- t:add("Enderman", nil, 19, 11, 31, 11, colors.red, colors.green)
- --t:add("You will be teleported upon picking a kit", nil, 3, 17, 47, 18, colors.black, colors.black)
- --# draw the buttons
- t:draw()
- while true do
- --# handleEvents will convert monitor_touch events to button_click if it was on a button
- local event, p1 = t:handleEvents(os.pullEvent())
- if event == "button_click" then
- if p1 == "Shulker" then
- if t.buttonList.p1.active then
- wlan.transmit(1,10,"WWCSON")
- else
- wlan.transmit(1,10,"WWCSOFF")
- end
- wlan.transmit(1,10,"WWCSON")
- t:toggleButton(p1)
- elseif p1 == "Wither" then
- wlan.transmit(2,10,"WWCSON")
- t:toggleButton(p1)
- elseif p1 == "Feral Ghoul" then
- wlan.transmit(3,10,"WWCSON")
- t:toggleButton(p1)
- elseif p1 == "Evoker" then
- wlan.transmit(4,10,"WWCSON")
- t:toggleButton(p1)
- elseif p1 == "Z Pigman" then
- wlan.transmit(5,10,"WWCSON")
- t:toggleButton(p1)
- elseif p1 == "Ghast" then
- wlan.transmit(6,10,"WWCSON")
- t:toggleButton(p1)
- elseif p1 == "Skeleton" then
- wlan.transmit(7,10,"WWCSON")
- t:toggleButton(p1)
- elseif p1 == "Z Miner" then
- wlan.transmit(8,10,"WWCSON")
- t:toggleButton(p1)
- elseif p1 == "Witch" then
- wlan.transmit(9,10,"WWCSON")
- t:toggleButton(p1)
- elseif p1 == "Blizz" then
- wlan.transmit(10,10,"WWCSON")
- t:toggleButton(p1)
- elseif p1 == "Slime" then
- wlan.transmit(11,10,"WWCSON")
- t:toggleButton(p1)
- elseif p1 == "Cyberdemon" then
- wlan.transmit(12,10,"WWCSON")
- t:toggleButton(p1)
- elseif p1 == "Spider" then
- wlan.transmit(13,10,"WWCSON")
- t:toggleButton(p1)
- elseif p1 == "Enderman" then
- wlan.transmit(14,10,"WWCSON")
- t:toggleButton(p1)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement