Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("button")
- d = peripheral.wrap("front")
- m = peripheral.wrap("bottom")
- m.clear()
- sleepAmt = 5
- function fillTable()
- -- button.setTable("Ars Magica 2", am2, false, 5, 25, 3, 5)
- -- button.setTable("The End", theend, false,27, 47, 3, 5)
- -- button.setTable("Twilight Forest", twilight, false, 5, 25, 8, 10)
- -- button.setTable("Promised Land", promland, false, 27, 47, 8, 10)
- x = 1
- y = 1
- for i = 1, d.getStoredCount() do
- button.setTable(places[i], funcs[i], false, xs[x],xs[x]+20, ys[y],ys[y]+2)
- x = x+1
- if x > 3 then
- x = 0
- y = y + 1
- end
- end
- button.screen()
- end
- function getClick()
- event,side,x,y = os.pullEvent("monitor_touch")
- button.checkxy(x,y)
- end
- function connect(id)
- d.dialStored(id)
- sleep(sleepAmt)
- d.terminate()
- end
- function f1()
- button.flash(places[1])
- connect(0)
- end
- function f2()
- button.flash(places[2])
- connect(1)
- end
- function f3()
- button.flash(places[3])
- connect(2)
- end
- function f4()
- button.flash(places[4])
- connect(3)
- end
- function f5()
- button.flash(places[5])
- connect(4)
- end
- function f6()
- button.flash(places[6])
- connect(5)
- end
- function f7()
- button.flash(places[7])
- connect(6)
- end
- function f8()
- button.flash(places[8])
- connect(7)
- end
- function f9()
- button.flash(places[9])
- connect(8)
- end
- funcs = {f1,f2,f3,f4,f5,f6,f7,f8,f9}
- places = {}
- xs = {5, 27, 49}
- ys = {3, 7, 11}
- for i = 1, d.getStoredCount() do
- places[i] = d.getStoredName(i-1)
- print(places[i])
- end
- fillTable()
- button.heading("Stargate Dialing Computer")
- while true do
- getClick()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement