Advertisement
Guest User

mobSpawnerControl.lua

a guest
Jun 18th, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.10 KB | None | 0 0
  1. rednet.open("top")
  2. os.loadAPI("touch")
  3. mon = peripheral.wrap("bottom")
  4.  
  5. local t1 = touch.new("bottom")
  6. local t = t1
  7.  
  8. function writeButtons()
  9.     t1:add("Blaze",nil,2,2,8,4,colors.red,colors.lime)
  10.     t1:add("Wither",nil,12,2,18,4,colors.red,colors.lime)
  11.     t1:add("Light",nil,22,2,28,4,colors.red,colors.lime)
  12.     t=t1
  13.     t:draw()
  14. end
  15.  
  16. function checkClick()
  17.     if p1 == "Light" then
  18.         if lightsStatus == "on" then
  19.             rednet.broadcast("spawnerLightsOff")
  20.         else
  21.             rednet.broadcast("spawnerLightsOn")
  22.         end
  23.     elseif p1 == "Blaze" then
  24.    
  25.     elseif p1 == "Wither" then
  26.    
  27.     end
  28. end
  29.  
  30. rednet.broadcast("spawnerLightsOn")
  31. local lightsStatus = "on"
  32. rednet.broadcast("witherSkeleOff")
  33. local witherStatus = "off"
  34. rednet.broadcast("blazeOff")
  35. local blazeStatus = "off"
  36.  
  37. writeButtons()
  38. while true do
  39.     local event,p1 = t:handleEvents(os.pullEvent())
  40.     if event == "button_click" then
  41.         t:toggleButton(p1)
  42.         print(p1)
  43.     end
  44. end
  45.  
  46. rednet.broadcast("spawnerLightsOn")
  47. rednet.broadcast("blazeOff")
  48. rednet.broadcast("witherSkeleOff")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement