Advertisement
Landstryder

ticket

Jan 17th, 2014
1,059
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.81 KB | None | 0 0
  1. print("Super Ticket Master v0.90")
  2. print("made by Landstryder")
  3.  
  4. t=peripheral.wrap("back") --set the side connected to the ticket printer
  5. m=peripheral.wrap("monitor_0") --set the side or network address of the monitor
  6. local width, height = m.getSize()
  7. local dest={"Central","North","South","East","West"} --routing destination names
  8.  
  9. m.setBackgroundColor(colors.black)
  10. m.clear()
  11.  
  12.  
  13. for it=1,#dest do
  14.     m.setCursorPos((width - string.len(dest[it]))/2,it*2)
  15.     m.setBackgroundColor(colors.cyan)
  16.     m.write(dest[it])
  17. end
  18.  
  19. m.setBackgroundColor(colors.black)
  20.  
  21. while true do
  22.     event, side, xPos, yPos = os.pullEvent("monitor_touch")
  23.     if yPos%2 == 0 then
  24.         t.createTicket(dest[(yPos/2)])
  25.         t.pushItem("up",3,1)
  26.         sleep(.1)
  27.         redstone.setOutput("top",true)
  28.         sleep(.1)
  29.         redstone.setOutput("top",false)
  30.     end
  31. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement