Advertisement
Zantag

EnhancedPortals3_cc

Feb 24th, 2014
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.67 KB | None | 0 0
  1. os.loadAPI("button")
  2. d = peripheral.wrap("front")
  3. m = peripheral.wrap("bottom")
  4. m.clear()
  5. sleepAmt = 5
  6.  
  7. function fillTable()
  8. -- button.setTable("Ars Magica 2", am2, false, 5, 25, 3, 5)
  9. -- button.setTable("The End", theend, false,27, 47, 3, 5)
  10. -- button.setTable("Twilight Forest", twilight, false, 5, 25, 8, 10)
  11. -- button.setTable("Promised Land", promland, false, 27, 47, 8, 10)
  12. x = 1
  13. y = 1
  14. for i = 1, d.getStoredCount() do
  15. button.setTable(places[i], funcs[i], false, xs[x],xs[x]+20, ys[y],ys[y]+2)
  16. x = x+1
  17. if x > 3 then
  18. x = 0
  19. y = y + 1
  20. end
  21. end
  22. button.screen()
  23. end
  24.  
  25. function getClick()
  26. event,side,x,y = os.pullEvent("monitor_touch")
  27. button.checkxy(x,y)
  28. end
  29.  
  30. function connect(id)
  31. d.dialStored(id)
  32. sleep(sleepAmt)
  33. d.terminate()
  34. end
  35. function f1()
  36. button.flash(places[1])
  37. connect(0)
  38. end
  39.  
  40. function f2()
  41. button.flash(places[2])
  42. connect(1)
  43. end
  44.  
  45. function f3()
  46. button.flash(places[3])
  47. connect(2)
  48. end
  49. function f4()
  50. button.flash(places[4])
  51. connect(3)
  52. end
  53. function f5()
  54. button.flash(places[5])
  55. connect(4)
  56. end
  57. function f6()
  58. button.flash(places[6])
  59. connect(5)
  60. end
  61. function f7()
  62. button.flash(places[7])
  63. connect(6)
  64. end
  65. function f8()
  66. button.flash(places[8])
  67. connect(7)
  68. end
  69. function f9()
  70. button.flash(places[9])
  71. connect(8)
  72. end
  73.  
  74. funcs = {f1,f2,f3,f4,f5,f6,f7,f8,f9}
  75. places = {}
  76. xs = {5, 27, 49}
  77. ys = {3, 7, 11}
  78. for i = 1, d.getStoredCount() do
  79. places[i] = d.getStoredName(i-1)
  80. print(places[i])
  81. end
  82.  
  83. fillTable()
  84. button.heading("Stargate Dialing Computer")
  85.  
  86. while true do
  87. getClick()
  88. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement