Advertisement
WorldTeacher

Untitled

Jun 6th, 2022
842
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.45 KB | None | 0 0
  1. os.loadAPI("BryButtonAPI")
  2.  
  3. monitor = peripheral.find("monitor")
  4. monitor.setTextScale(1)
  5. monitor.setBackgroundColor(colors.black)
  6. --Define the colors used in the program
  7.  
  8. black = colors.black
  9. white = colors.white
  10. red = colors.red
  11. green = colors.green
  12.  
  13. --Define the functions used in the program
  14. function disableRedstone()
  15.     rs.setOutput("left", false)
  16.     rs.setOutput("right", false)
  17.     rs.setOutput("back", false)
  18.     rs.setOutput("front", false)
  19.     rs.setOutput("top", false)
  20.     rs.setOutput("down", false)
  21. end
  22.  
  23. function Enderfarm(state)
  24.    
  25.     if state then
  26.         rs.setOutput("left", true)
  27.     else
  28.         rs.setOutput("left", false)
  29.     end
  30. end
  31.  
  32. function Blazefarm(state)
  33.  
  34.     if state then
  35.         rs.setOutput("right", true)
  36.     else
  37.         rs.setOutput("right", false)
  38.     end
  39. end
  40.  
  41. function Witherfarm(state)
  42.    
  43.     if state then
  44.         rs.setOutput("back", true)
  45.     else
  46.         rs.setOutput("back", false)
  47.     end
  48. end
  49. --Define the buttons used in the program
  50.  
  51. Mobfarm1 = BryButtonAPI.createButton(2,2,"Enderman"red, green, true, Enderfarm)
  52. Mobfarm2 = BryButtonAPI.createButton(2,4,"Blaze"red, green, true, Blazefarm)
  53. Mobfarm3 = BryButtonAPI.createButton(2,6,"Wither Skeleton"red, green, true, Witherfarm)
  54. --Make ButtonList
  55. list={Mobfarm1,Mobfarm2,Mobfarm3}
  56. --Draw Buttons on the screen
  57. BryButtonAPI.drawButton(monitor,list)
  58. while true do
  59.     BryButtonAPI.checkButtons(monitor,list, 0, print)
  60. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement