Advertisement
TwitchBlade

Mob Controller

Apr 22nd, 2024 (edited)
792
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.82 KB | Gaming | 0 0
  1. o = colors.orange
  2. w = colors.white
  3. p = colors.purple
  4.  
  5. mon = peripheral.find("monitor")
  6. dLib = require("DisplayLib")
  7.  
  8.  
  9. function toggleBlaze()
  10.     c = colors.combine(o,p,w)
  11.     if rs.getBundledOutput("bottom") == c then
  12.         rs.setBundledOutput("bottom", 0)
  13.         dLib.drawButton(screen, colors.white, colors.red, 2,2,7,3,3,3,"Blaze", toggleBlaze, mon)
  14.     else
  15.         rs.setBundledOutput("bottom", c)
  16.         dLib.drawButton(screen, colors.white, colors.green, 2,2,7,3,3,3,"Blaze", toggleBlaze, mon)
  17.     end
  18. end
  19.  
  20. mon.clear()
  21. screen = dLib.initDisplay(mon)
  22. dLib.drawButton(screen, colors.white, colors.red, 2,2,7,3,3,3,"Blaze", toggleBlaze, mon)
  23.  
  24. while true do
  25.     event, side, x, y  = os.pullEvent("monitor_touch")
  26.     if screen[x][y] ~= nil then
  27.       screen[x][y]()
  28.     end
  29.     os.sleep(0.1)
  30. end
  31.  
  32.  
  33.  
  34.  
  35.  
Tags: cc:tweaked
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement