Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("touchpoint")
- local mainMenu = touchpoint.new()
- local gamesMenu = touchpoint.new()
- local t
- --Basic Functions--
- local function update()
- shell.run("rm startup")
- shell.run("pastebin get wiUs761K startup")
- shell.run("startup")
- end
- local function clear()
- term.clear()
- term.setCursorPos(1,1)
- end
- --Applications--
- local function adventure()
- term.setTextColor(colors.white)
- term.setBackgroundColor(colors.black)
- clear()
- term.write("* Type quit to exit *")
- term.setCursorPos(1,2)
- shell.run("adventure")
- end
- local function cookieClicker()
- clear()
- shell.run("cclicker")
- end
- ---Set Up Pages--
- local function openMainMenu()
- t = mainMenu
- end
- local function openGamesMenu()
- t = gamesMenu
- end
- --Set Up Buttons--
- do
- --Main Menu--
- mainMenu:add("Main Menu", update, 1, 1, 26, 1, colors.black, colors.black)
- --mainMenu:add("Test", testAction, 2, 3, 25, 3)
- mainMenu:add("Games", openGamesMenu, 15, 19, 25, 19)
- --Games Menu--
- gamesMenu:add("Games", update, 1, 1, 26, 1, colors.black, colors.black)
- gamesMenu:add("Minecraft", adventure, 2, 3, 25, 3)
- gamesMenu:add("Cookie Clicker", cookieClicker, 2, 5, 25, 5)
- gamesMenu:add("Main Menu", openMainMenu, 2, 19, 12, 19)
- end
- openMainMenu()
- while true do
- t:draw()
- 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