Advertisement
HDR

Example

HDR
Nov 17th, 2016
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.46 KB | None | 0 0
  1. --# Load the api
  2. os.loadAPI("touchpoint")
  3.  
  4. --# This piece of code makes it so that you can place the monitor on any side of the computer.
  5. for a,b in pairs(rs.getSides()) do
  6.   if peripheral.getType(b) == 'monitor' then
  7.    t = touchpoint.new(b)
  8.    break
  9.   end
  10. end
  11.  
  12.  
  13. --#Functions
  14. function wither()
  15. --#t:flash("Wither") -- Needs to be the same as the button label -- makes button flash when it is clicked
  16. --#t:toggleButton("Wither") -- Toggles button between active and inactive colors, use this if you want it to toggle something on and off.
  17.  --#sets the red wire in the connected bundled cable at the back to on.
  18.  redstone.setBundledOutput("back", colors.red)
  19. end
  20.  
  21. function zombie()
  22.  --#sets the blue wire in the connected bundled cable at the back to on.
  23.  redstone.setBundledOutput("back", colors.blue)
  24. end
  25.  
  26. --#t:add("buttonlabel", function, x1,y1,x2,y2, inactivecolor, activecolor, inactivetextcolor, activetextcolor)
  27. --# the button label is what it will show on screen, the function is the function you want to call, the coordinates allow you to set the size of your button (may not overlap) the inactive color is the color of the button when it is not toggled, the acinactive color is the toggled button color, the inactive text and active text are the same as the first two.
  28. t:add("Wither", wither, 2,3,12,5, colors.orange, colors.red, colors.black, colors.black)
  29. t:add("Zombie", zombie, 14,3,24,5, colors.orange, colors.red, colors.black, colors.black)
  30. t:run()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement