Advertisement
Guest User

master

a guest
Jan 20th, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.75 KB | None | 0 0
  1. -- This is the master file, open this to start
  2. -- chockos.
  3.  
  4. -- System Variables:
  5. id = os.getComputerID()
  6. -- :System Variables
  7.  
  8. -- APIs
  9. os.loadAPI("chockos/clickapi")
  10. os.loadAPI("chockos/fileapi")
  11. os.loadAPI("chockos/accountapi")
  12. os.loadAPI("chockos/config")
  13. os.loadAPI("chockos/pages/home")
  14. os.loadAPI("chockos/shutdown")
  15. os.loadAPI("chockos/commandapi")
  16. os.loadAPI("chockos/pages/signin")
  17. os.loadAPI("chockos/pages/create")
  18. os.loadAPI("chockos/typeapi")
  19. os.loadAPI("chockos/pages/menu")
  20. systemVersion = config.systemVersion()
  21. -- APIs
  22.  
  23. function startup()
  24.   -- this is just the startup sequence
  25.   sleep(1)
  26.   term.setTextColour(colours.yellow)
  27.   print("ChockOS v"..systemVersion)
  28.   print("by ChoCo Ind. - Making cool useless stuff")
  29.   sleep(2)
  30.   term.setCursorPos(1,2)
  31.   term.clear()
  32.   sleep(1)
  33.   print(fileapi.readFile("chockos/startupscreen.img"))
  34.   sleep(2)
  35.   term.clear()
  36.   sleep(1)
  37. end
  38.  
  39.  
  40. -- comment out the next line to disable startup
  41. -- sequence:
  42. startup()
  43. --
  44. function homepage()
  45.   term.clear()
  46.   homeLoop = false
  47.   while not homeLoop do homeLoop = home.main() end
  48.   if fs.exists("chockos/temp") then fs.delete("chockos/temp") end
  49.   if homeLoop == "signin" then
  50.     result = signin.main()
  51.   end
  52.   if homeLoop == "create" then
  53.     result = create.main()
  54.   end
  55.   if homeLoop == "shutdown" then
  56.     result = shutdown.main()
  57.   end
  58.   return result
  59. end
  60.  
  61. function Fhome()
  62.   homeResult = homepage()
  63.   while not homeResult do homeResult = homepage() end
  64.   username, password = homeResult
  65.   menuResult = menu.main(username,password)
  66.   return menuResult
  67. end
  68.  
  69. menuResult = 'logoff'
  70.  
  71. while menuResult == 'logoff' do
  72.   menuResult = Fhome()
  73. end
  74. if menuResult == 'filesys' then
  75.   print("Hoooo boy")
  76. end
  77.  
  78. print("end")
  79. sleep(2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement