Advertisement
Guest User

Untitled

a guest
Jul 16th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 KB | None | 0 0
  1. os.loadAPI("apis/qmain")
  2. os.loadAPI("apis/qformat")
  3. os.loadAPI("apis/qbutton")
  4.  
  5. mon = qmain.setDefaultScreen("back")
  6. mon.clear()
  7.  
  8. function setupButtons()
  9. mon.setCursorPos(5, 2)
  10. mon.write("Mob-Farm Interface")
  11. qbutton.setButton("spawner","Spawner", spawner, nil, {5, 5}, {7, 3}, {"a", "f"}, qmain.getScreen())
  12. qbutton.drawButton("spawner")
  13. qbutton.setButton("farm","Mob-Essence", farm, nil, {5, 12}, {11, 3}, {"a", "f"}, qmain.getScreen())
  14. qbutton.drawButton("farm")
  15. end
  16.  
  17. function spawner()
  18. if(redstone.getOutput("left") == false) then
  19. redstone.setOutput("left", true)
  20. qbutton.changeButton("spawner", "color", {"a", "i"})
  21. qbutton.drawButton("spawner")
  22. else
  23. redstone.setOutput("left", false)
  24. qbutton.changeButton("spawner", "color", {"a", "f"})
  25. qbutton.drawButton("spawner")
  26. end
  27. sleep(0.5)
  28. end
  29.  
  30. function farm()
  31. if(redstone.getOutput("right") == false) then
  32. redstone.setOutput("right", true)
  33. qbutton.changeButton("farm", "color", {"a", "i"})
  34. qbutton.drawButton("farm")
  35. else
  36. redstone.setOutput("right", false)
  37. qbutton.changeButton("farm", "color", {"a", "f"})
  38. qbutton.drawButton("farm")
  39. end
  40. sleep(0.5)
  41. end
  42.  
  43. setupButtons()
  44.  
  45. while true do
  46. ev, side, x, y = os.pullEvent("monitor_touch")
  47. qbutton.clickOn({x, y}, side)
  48. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement