Advertisement
Guest User

main

a guest
Jan 28th, 2015
239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.18 KB | None | 0 0
  1. wallpaper = paintutils.loadImage("Windows7/wallpaper.nfp")
  2. paintutils.drawImage(wallpaper, 1, 1)
  3.  
  4. taskbar = paintutils.loadImage("Windows7/windows-desktop/taskbar.nfp")
  5. paintutils.drawImage(taskbar, 1, 18)
  6.  
  7. while true do
  8. term.setTextColour(colours.white)
  9. term.setBackgroundColour(colours.lightBlue)
  10. term.setCursorPos(4, 18)
  11. print("SosOS 1 ComputerCraft Edition by Simon Kjørslevik Thomassen")
  12. term.setCursorPos(4, 19)
  13.  
  14. event, button, xPos, yPos = os.pullEvent("mouse_click")
  15.  
  16. if xPos == 1 and yPos == 18 or xPos == 2 and yPos == 18 or xPos == 1 and yPos == 19 or xPos == 2 and yPos == 19 then
  17. startMenu = paintutils.loadImage("Windows7/windows-desktop/startMenu.nfp")
  18. paintutils.drawImage(startMenu, 1, 3)
  19. term.setCursorPos(1, 6)
  20. term.setTextColour(colours.black)
  21. print("> Apps")
  22. print("> File expl.")
  23. print("> Edit theme")
  24. term.setCursorPos(1, 16)
  25. print("> Close menu")
  26. print("> Shutdown")
  27. eventS, buttonS, xPosS, yPosS = os.pullEvent("mouse_click")
  28. if xPosS == 1 and yPosS == 6 then
  29. fsWin = paintutils.loadImage("Windows7/windows-desktop/appsWindow.nfp")
  30. paintutils.drawImage(fsWin, 1, 1)
  31. term.setCursorPos(1, 1)
  32. term.setTextColour(colours.black)
  33. term.setBackgroundColour(colours.lightBlue)
  34. print("Apps browser")
  35. term.setTextColour(colours.black)
  36. term.setBackgroundColour(colours.white)
  37. term.setCursorPos(1, 2)
  38. shell.run("programs")
  39. term.setCursorPos(1, 12)
  40. print("Run: ")
  41. term.setCursorPos(6, 12)
  42. run, arg1, arg2, arg3, arg4 = read(), read(), read(), read(), read()
  43. term.setCursorPos(1, 17)
  44. print("To exit the program, just wait 3 seconds after the code.")
  45. term.clear()
  46. term.setCursorPos(1, 1)
  47. shell.run(run, arg1, arg2, arg3, arg4)
  48. sleep(3)
  49. shell.run("cd", "SosOS-desktop")
  50. shell.run("main")
  51. shell.run("cd", "..")
  52. elseif xPosS == 1 and yPosS == 7 then
  53. fsWin = paintutils.loadImage("Windows7/windows-desktop/appsWindow.nfp")
  54. paintutils.drawImage(fsWin, 1, 1)
  55. term.setTextColour(colours.black)
  56. term.setBackgroundColour(colours.lightBlue)
  57. term.setCursorPos(1, 1)
  58. print("File browser [not working, type !exit]")
  59. term.setBackgroundColour(colours.white)
  60. term.setTextColour(colours.black)
  61. repeat
  62. exitCode = 0
  63. term.setCursorPos(1, 2)
  64. shell.run("ls")
  65. term.setCursorPos(1, 16)
  66. print("Type !exit to quit. To run apps, use App browser.")
  67. term.setCursorPos(1, 17)
  68. print("Goto: ")
  69. term.setCursorPos(7, 17)
  70. goto = read()
  71. if goto == "!exit" then
  72. shell.run("windows-desktop/main")
  73. else
  74. term.setCursorPos(1, 2)
  75. shell.run("cd", goto)
  76. end
  77. until exitCode == 256
  78. elseif xPosS == 1 and yPosS == 8 then
  79. shell.run("cd", "..")
  80. shell.run("npaintpro", "wallpaper.nfp")
  81. shell.run("windows-logon")
  82. elseif xPosS == 1 and yPosS == 17 then
  83. os.shutdown()
  84. else
  85. shell.run("cd", "SosOS-desktop")
  86. shell.run("main")
  87. shell.run("cd", "..")
  88. end
  89. end
  90. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement