Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("button")
- m=peripheral.wrap("top")
- m.clear()
- dial=peripheral.wrap("ep_dialling_device_0")
- portals=dial.getStoredCount()
- for i=0,portals-1,1 do
- if dial.getStoredName(i)=="Hiler's" then
- hilers=i
- --print("hiler=" .. i)
- end
- if dial.getStoredName(i)=="Garm's" then
- garms=i
- --print("garm=" .. i)
- end
- if dial.getStoredName(i)=="Space" then
- spaces=i
- --print("space=" .. i)
- end
- if dial.getStoredName(i)=="Moon" then
- moons=i
- --print("moon=" .. i)
- end
- end
- function fillTable()
- button.setTable("Hiler", hiler, 2, 10, 2, 4)
- button.setTable("Garm", garm, 2, 10, 6, 8)
- button.setTable("Moon", moon, 2, 10, 10, 12)
- button.setTable("Space", space, 2, 10, 14, 16)
- button.screen()
- end
- function getClick()
- event,side,x,y = os.pullEvent("monitor_touch")
- button.checkxy(x,y)
- end
- function hiler()
- print("Hiler")
- button.flash("Hiler")
- dial.dialStored(hilers)
- sleep(3)
- dial.terminate()
- end
- function garm()
- print("Garm")
- button.flash("Garm")
- dial.dialStored(garms)
- sleep(3)
- dial.terminate()
- end
- function space()
- print("Space")
- button.flash("Space")
- dial.dialStored(spaces)
- sleep(3)
- dial.terminate()
- end
- function moon()
- print("moon")
- button.flash("Moon")
- dial.dialStored(moons)
- sleep(3)
- dial.terminate()
- end
- fillTable()
- while true do
- getClick()
- end
Add Comment
Please, Sign In to add comment