Advertisement
Guest User

startup

a guest
Dec 22nd, 2014
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.62 KB | None | 0 0
  1. print("Ticket Manager")
  2.  
  3. t=peripheral.wrap("left")
  4. m=peripheral.wrap("monitor_0")
  5. local width, height = m.getSize()
  6. local dest={"Elfies","Luke"}
  7.  
  8. m.setBackgroundColor(colors.black)
  9. m.clear()
  10.  
  11. for it=1,#dest do
  12.     m.setCursorPos((width - string.len(dest[it]))/2,it*2)
  13.     m.setBackgroundColor(colors.cyan)
  14.     m.write(dest[it])
  15. end
  16.  
  17. m.setBackgroundColor(colors.black)
  18.  
  19. while true do
  20.     event, side, xPos, yPos = os.pullEvent("monitor_touch")
  21.     if yPos%2 == 0 then
  22.         t.createTicket(dest[(yPos/2)])
  23.         t.pushItem("up",3,1)
  24.         sleep(.1)
  25.         redstone.setOutput("top",true)
  26.         sleep(.1)
  27.         redstone.setOutput("top",false)
  28.     end
  29. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement