kerrnel

Mu Lambda 165 - v1.0

Jun 15th, 2014
256
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. -- Mu Lambda 165
  2. -- by MCKerrnel
  3. --
  4. -- YouTube: http://www.youtube.com/MCKerrnel
  5. -- Twitter: @MCKerrnel
  6. --
  7. -- This program is the base menu system for
  8. -- the main computer on my TPPI server LP.
  9. -- Each menu item will call out to run a
  10. -- different program. Each program will use
  11. -- a common set of functions.
  12.  
  13. -- Load common libraries.
  14. os.loadAPI("mlapi")
  15. os.loadAPI("tppi")
  16. os.loadAPI("touchpoint")
  17.  
  18. -- Define variables.
  19. -- Menu boxes:
  20. local touch = touchpoint.new("back")
  21. touch:add("Progression", nil, 2, 2, 16, 6, colors.blue, colors.lightblue)
  22. touch:add("Upgrade", upgradeReboot, 56, 14, 70, 18, colors.blue, colors.lightblue)
  23.  
  24. -- Upgrade System Files and Reboot
  25. function upgradeReboot()
  26. touch:toggleButton("Upgrade")
  27. mlapi.tp("Downloading & Upgrading...standby.", 19, 17, colors.white, colors.red)
  28. term.restore()
  29. print "Updating..."
  30. shell.run("update")
  31. os.reboot()
  32. end
  33.  
  34.  
  35. -- MAINLINE
  36. while true do
  37. mlapi.clear()
  38. touch:draw()
  39. tppi.title(22, 6)
  40.  
  41.  
  42. -- Detect click and see if it's valid.
  43. -- If it is, break out of the loop and
  44. -- run the appropriate code.
  45. touch:run()
  46. end
Advertisement
Add Comment
Please, Sign In to add comment