Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Load the API
- os.loadAPI("touchpoint")
- --Wrap the Ticket Machine
- p=peripheral.wrap("top")
- --Establish Button Pages
- local page1 = touchpoint.new("right")
- local page2 = touchpoint.new("right")
- local page3 = touchpoint.new("right")
- local page4 = touchpoint.new("right")
- --one variable to put each page into in order to simplify switching
- local t
- --Village Ticket Functions
- function v1()
- t:flash("Village 1")
- p.createTicket("Village01",1)
- shell.run("shutdown")
- end
- function v2()
- t:flash("Village 2")
- p.createTicket("Village02",1)
- shell.run("shutdown")
- end
- function v3()
- t:flash("Village 3")
- p.createTicket("Village3",1)
- shell.run("shutdown")
- end
- function v4()
- t:flash("Village 4")
- p.createTicket("Village4",1)
- shell.run("shutdown")
- end
- function v5()
- t:flash("Village 5")
- p.createTicket("Village5",1)
- shell.run("shutdown")
- end
- function v6()
- t:flash("Village 6")
- p.createTicket("Village6",1)
- shell.run("shutdown")
- end
- function v7()
- t:flash("Village 7")
- p.createTicket("Village7",1)
- shell.run("shutdown")
- end
- function v8()
- t:flash("Village 8")
- p.createTicket("Village8",1)
- shell.run("shutdown")
- end
- function v9()
- t:flash("Village 9")
- p.createTicket("Village9",1)
- shell.run("shutdown")
- end
- function v10()
- t:flash("Village 10")
- p.createTicket("Village10",1)
- shell.run("shutdown")
- end
- function v11()
- t:flash("Village 11")
- p.createTicket("Village11",1)
- shell.run("shutdown")
- end
- function v12()
- t:flash("Village 12")
- p.createTicket("Village12",1)
- shell.run("shutdown")
- end
- function v13()
- t:flash("Village 13")
- p.createTicket("Village13",1)
- shell.run("shutdown")
- end
- function v14()
- t:flash("Village 14")
- p.createTicket("Village14",1)
- shell.run("shutdown")
- end
- function v15()
- t:flash("Village 15")
- p.createTicket("Village15",1)
- shell.run("shutdown")
- end
- function v16()
- t:flash("Village 16")
- p.createTicket("Village16",1)
- shell.run("shutdown")
- end
- function v17()
- t:flash("Village 17")
- p.createTicket("Village17",1)
- shell.run("shutdown")
- end
- function v18()
- t:flash("Village 18")
- p.createTicket("Village18",1)
- shell.run("shutdown")
- end
- function v19()
- t:flash("Village 19")
- p.createTicket("Village19",1)
- shell.run("shutdown")
- end
- function v20()
- t:flash("Village 20")
- p.createTicket("Village20",1)
- shell.run("shutdown")
- end
- --Base Ticket Functions
- function b1()
- t:flash("Base 1")
- p.createTicket("Base1",1)
- shell.run("shutdown")
- end
- function b2()
- t:flash("Base 2")
- p.createTicket("Base2",1)
- shell.run("shutdown")
- end
- function b3()
- t:flash("Base 3")
- p.createTicket("Base3",1)
- shell.run("shutdown")
- end
- function b4()
- t:flash("Kira")
- p.createTicket("Kira",1)
- shell.run("shutdown")
- end
- function b5()
- t: flash("Shelley")
- p.createTicket("Shelley",1)
- shell.run("shutdown")
- end
- --Menu Functions
- function l1()
- t = page1
- end
- function l2()
- t = page2
- end
- function l3()
- t = page3
- end
- function l4()
- t = page4
- end
- --Shutdown Function
- function sd()
- shell.run("shutdown")
- end
- --set up pages
- do
- page1:add("Village 1", v1, 3, 2, 16, 2, colors.red, colors.lime)
- page1:add("Village 2", v2, 3, 4, 16, 4, colors.red, colors.lime)
- page1:add("Village 3", v3, 3, 6, 16, 6, colors.red, colors.lime)
- page1:add("Village 4", v4, 3, 8, 16, 8, colors.red, colors.lime)
- page1:add("Village 5", v5, 3, 10, 16, 10, colors.red, colors.lime)
- page1:add("Village 6", v6, 3, 12, 16, 12, colors.red, colors.lime)
- page1:add("Village 7", v7, 3, 14, 16, 14, colors.red, colors.lime)
- page1:add("Next", l2, 3, 16, 16, 16, colors.lightBlue, colors.lightBlue)
- page1:add("Shutdown", sd, 3, 18, 16, 18, colors.orange, colors.orange)
- page2:add("Previous", l1, 3, 2, 16, 2, colors.lightBlue, colors.lightBlue)
- page2:add("Village 8", v8, 3, 4, 16, 4, colors.red, colors.lime)
- page2:add("Village 9", v9, 3, 6, 16, 6, colors.red, colors.lime)
- page2:add("Village 10", v10, 3, 8, 16, 8, colors.red, colors.lime)
- page2:add("Village 11", v11, 3, 10, 16, 10, colors.red, colors.lime)
- page2:add("Village 12", v12, 3, 12, 16, 12, colors.red, colors.lime)
- page2:add("Village 13", v13, 3, 14, 16, 14, colors.red, colors.lime)
- page2:add("Next", l3, 3, 16, 16, 16, colors.lightBlue, colors.lightBlue)
- page2:add("Shutdown", sd, 3, 18, 16, 18, colors.orange, colors.orange)
- page3:add("Previous", l2, 3, 2, 16, 2, colors.lightBlue, colors.lightBlue)
- page3:add("Village 14", v14, 3, 4, 16, 4, colors.red, colors.lime)
- page3:add("Village 15", v15, 3, 6, 16, 6, colors.red, colors.lime)
- page3:add("Village 16", v16, 3, 8, 16, 8, colors.red, colors.lime)
- page3:add("Village 17", v17, 3, 10, 16, 10, colors.red, colors.lime)
- page3:add("Village 18", v18, 3, 12, 16, 12, colors.red, colors.lime)
- page3:add("Village 19", v19, 3, 14, 16, 14, colors.red, colors.lime)
- page3:add("Next", l4, 3, 16, 16, 16, colors.lightBlue, colors.lightBlue)
- page3:add("Shutdown", sd, 3, 18, 16, 18, colors.orange, colors.orange)
- page4:add("Previous", l3, 3, 2, 16, 2, colors.lightBlue, colors.lightBlue)
- page4:add("Village 20", v20, 3, 4, 16, 4, colors.red, colors.lime)
- page4:add("Base 1", b1, 3, 6, 16, 6, colors.red, colors.lime)
- page4:add("Base 2", b2, 3, 8, 16, 8, colors.red, colors.lime)
- page4:add("Base 3", b3, 3, 10, 16, 10, colors.red, colors.lime)
- page4:add("Kira", b4, 3, 12, 16, 12, colors.red, colors.lime)
- page4:add("Shelley", b5, 3, 14, 16, 14, colors.red, colors.lime)
- page4:add("Shutdown", sd, 3, 18, 16, 18, colors.orange, colors.orange)
- end
- --Starts with Page 1, then checks for buttons clicked, toggles them, and runs the program it has with my modified t:run2()
- l1()
- while true do
- t:draw()
- -- local event, p1, p2, p3 = os.pullEvent() ---monitor_touch, side, xpos, ypos
- local event, p1 = t:handleEvents(os.pullEvent()) ---button_click, name
- if event == "button_click" then
- --remove toggling and simplify button running
- t.buttonList[p1].func()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement