Advertisement
funnybunnyofdoom

installertesto2

Feb 4th, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.55 KB | None | 0 0
  1.  
  2. --Build the startup file
  3.  
  4. file = fs.open("startup",'w')
  5.  
  6. file.write('--load apis\n')
  7. file.write('os.loadAPI("BunnyOS/ProgramFiles/install")\n')
  8. file.write('os.loadAPI("BunnyOS/Display/menu")\n')
  9. file.write('os.loadAPI("BunnyOS/Display/clock")\n')
  10. file.write('shell.run("BunnyOS/Display/Control")\n')
  11.  
  12. file.write('--disable terminating\n')
  13. file.write('oldPullEvent = os.pullEvent\n')
  14. file.write('os.pullEvent = os.pullEventRaw\n')
  15.  
  16. file.close()
  17.  
  18. file = fs.open("/BunnyOS/ProgramFiles/menu",'w')
  19.  
  20. file.write'function buildProgramList()\n')
  21. file.write' programlist = {}\n')
  22. file.write' i = 0\n')
  23. file.write' file = fs.open("/BunnyOS/ProgramFiles/programs", "r")\n')
  24. file.write' x = file.readLine()\n')
  25. file.write' while x ~= nil do\n')
  26. file.write' programlist[i] = x\n')
  27. file.write' x = file.readLine()\n')
  28. file.write' i = i + 1\n')
  29. file.write' end\n')
  30. file.write' file.close()\n')
  31. file.write' return programlist\n')
  32. file.write'end\n')
  33. file.write' \n')
  34. file.write'Pname = " "\n')
  35. file.write' \n')
  36. file.write'function frame0()\n')
  37. file.write' x,y = term.getSize()\n')
  38. file.write' term.clear()\n')
  39. file.write' term.setCursorPos(1,y)\n')
  40. file.write' \n')
  41. file.write' term.setBackgroundColor(colors.gray)\n')
  42. file.write' term.write(" ")\n')
  43. file.write' term.setBackgroundColor(colors.gray)\n')
  44. file.write' term.write("Start")\n')
  45. file.write' term.setBackgroundColor(colors.gray)\n')
  46. file.write' term.write(" ")\n')
  47. file.write' term.setBackgroundColor(colors.black)\n')
  48. file.write' term.write("Programs")\n')
  49. file.write' term.setBackgroundColor(colors.gray)\n')
  50. file.write' term.write(" ")\n')
  51. file.write' term.setBackgroundColor(colors.black)\n')
  52. file.write' term.write("Documents")\n')
  53. file.write' term.setBackgroundColor(colors.gray)\n')
  54. file.write' term.write(" ")\n')
  55. file.write' \n')
  56. file.write' term.setCursorPos(1,y-1)\n')
  57. file.write' term.setBackgroundColor(colors.gray)\n')
  58. file.write' term.write("ShutDown")\n')
  59. file.write' term.setCursorPos(1,y-2)\n')
  60. file.write' term.write("CMD ")\n')
  61. file.write' term.setCursorPos(1,y-3)\n')
  62. file.write' term.write("Files ")\n')
  63. file.write' term.setCursorPos(1,1)\n')
  64. file.write' \n')
  65. file.write' clock.get()\n')
  66. file.write' \n')
  67. file.write' term.setBackgroundColor(colors.black)\n')
  68. file.write' term.setCursorPos(1,1)\n')
  69. file.write'end\n')
  70. file.write' \n')
  71. file.write'function frame1()\n')
  72. file.write' x,y = term.getSize()\n')
  73. file.write' term.clear()\n')
  74. file.write' term.setCursorPos(1,y)\n')
  75. file.write' \n')
  76. file.write' term.setBackgroundColor(colors.gray)\n')
  77. file.write' term.write(" ")\n')
  78. file.write' term.setBackgroundColor(colors.blue)\n')
  79. file.write' term.write("Start")\n')
  80. file.write' term.setBackgroundColor(colors.gray)\n')
  81. file.write' term.write(" ")\n')
  82. file.write' term.setBackgroundColor(colors.black)\n')
  83. file.write' term.write("Programs")\n')
  84. file.write' term.setBackgroundColor(colors.gray)\n')
  85. file.write' term.write(" ")\n')
  86. file.write' term.setBackgroundColor(colors.black)\n')
  87. file.write' term.write("Documents")\n')
  88. file.write' term.setBackgroundColor(colors.gray)\n')
  89. file.write' term.write(" ")\n')
  90. file.write' \n')
  91. file.write' term.setCursorPos(1,y-1)\n')
  92. file.write' term.setBackgroundColor(colors.gray)\n')
  93. file.write' term.write("ShutDown")\n')
  94. file.write' term.setCursorPos(1,y-2)\n')
  95. file.write' term.write("CMD ")\n')
  96. file.write' term.setCursorPos(1,y-3)\n')
  97. file.write' term.write("Files ")\n')
  98. file.write' term.setCursorPos(1,1)\n')
  99. file.write' \n')
  100. file.write' clock.get()\n')
  101. file.write' \n')
  102. file.write' term.setBackgroundColor(colors.black)\n')
  103. file.write' term.setCursorPos(1,1)\n')
  104. file.write'end\n')
  105. file.write' \n')
  106. file.write'function frame2(r)\n')
  107. file.write' x,y = term.getSize()\n')
  108. file.write' term.clear()\n')
  109. file.write' term.setCursorPos(1,y)\n')
  110. file.write' \n')
  111. file.write' term.setBackgroundColor(colors.gray)\n')
  112. file.write' term.write(" ")\n')
  113. file.write' term.setBackgroundColor(colors.black)\n')
  114. file.write' term.write("Start")\n')
  115. file.write' term.setBackgroundColor(colors.gray)\n')
  116. file.write' term.write(" ")\n')
  117. file.write' if r == nil then\n')
  118. file.write' term.setBackgroundColor(colors.blue)\n')
  119. file.write' else\n')
  120. file.write' term.setBackgroundColor(colors.black)\n')
  121. file.write' end\n')
  122. file.write' term.write("Programs")\n')
  123. file.write' term.setBackgroundColor(colors.gray)\n')
  124. file.write' term.write(" ")\n')
  125. file.write' term.setBackgroundColor(colors.black)\n')
  126. file.write' term.write("Documents")\n')
  127. file.write' term.setBackgroundColor(colors.gray)\n')
  128. file.write' term.write(" ")\n')
  129. file.write' \n')
  130. file.write' Programs = {}\n')
  131. file.write' Programs = buildProgramList() --get the list to feed in the menu\n')
  132. file.write' term.setCursorPos(8,y-1)\n')
  133. file.write' term.setBackgroundColor(colors.gray)\n')
  134. file.write' local lengthnum = 0\n')
  135. file.write' for k,v in pairs(Programs) do\n')
  136. file.write' lengthnum = lengthnum + 1\n')
  137. file.write' end\n')
  138. file.write' local q = 0\n')
  139. file.write' local w = 1\n')
  140. file.write' \n')
  141. file.write' while q <= lengthnum-1 do\n')
  142. file.write' term.setCursorPos(8,y-w)\n')
  143. file.write' if q == r then\n')
  144. file.write' term.setBackgroundColor(colors.blue)\n')
  145. file.write' else\n')
  146. file.write' term.setBackgroundColor(colors.gray)\n')
  147. file.write' end\n')
  148. file.write' term.write(Programs[q])\n')
  149. file.write' Pname = Programs[q] --try this\n')
  150. file.write' w = w + 1\n')
  151. file.write' q = q + 1 \n')
  152. file.write' end\n')
  153. file.write' \n')
  154. file.write' clock.get()\n')
  155. file.write' \n')
  156. file.write' term.setBackgroundColor(colors.black)\n')
  157. file.write' term.setCursorPos(1,1)\n')
  158. file.write' return Pname\n')
  159. file.write'end\n')
  160. file.write' \n')
  161. file.write'function frame3()\n')
  162. file.write' x,y = term.getSize()\n')
  163. file.write' term.clear()\n')
  164. file.write' term.setCursorPos(1,y)\n')
  165. file.write' \n')
  166. file.write' term.setBackgroundColor(colors.gray)\n')
  167. file.write' term.write(" ")\n')
  168. file.write' term.setBackgroundColor(colors.black)\n')
  169. file.write' term.write("Start")\n')
  170. file.write' term.setBackgroundColor(colors.gray)\n')
  171. file.write' term.write(" ")\n')
  172. file.write' term.setBackgroundColor(colors.black)\n')
  173. file.write' term.write("Programs")\n')
  174. file.write' term.setBackgroundColor(colors.gray)\n')
  175. file.write' term.write(" ")\n')
  176. file.write' term.setBackgroundColor(colors.blue)\n')
  177. file.write' term.write("Documents")\n')
  178. file.write' term.setBackgroundColor(colors.gray)\n')
  179. file.write' term.write(" ")\n')
  180. file.write' \n')
  181. file.write' clock.get()\n')
  182. file.write' \n')
  183. file.write' term.setBackgroundColor(colors.black)\n')
  184. file.write' term.setCursorPos(1,1)\n')
  185. file.write'end\n')
  186. file.write' \n')
  187. file.write'function frame4()\n')
  188. file.write' x,y = term.getSize()\n')
  189. file.write' term.clear()\n')
  190. file.write' term.setCursorPos(1,y)\n')
  191. file.write' \n')
  192. file.write' term.setBackgroundColor(colors.gray)\n')
  193. file.write' term.write(" ")\n')
  194. file.write' term.setBackgroundColor(colors.black)\n')
  195. file.write' term.write("Start")\n')
  196. file.write' term.setBackgroundColor(colors.gray)\n')
  197. file.write' term.write(" ")\n')
  198. file.write' term.setBackgroundColor(colors.black)\n')
  199. file.write' term.write("Programs")\n')
  200. file.write' term.setBackgroundColor(colors.gray)\n')
  201. file.write' term.write(" ")\n')
  202. file.write' term.setBackgroundColor(colors.black)\n')
  203. file.write' term.write("Documents")\n')
  204. file.write' term.setBackgroundColor(colors.gray)\n')
  205. file.write' term.write(" ")\n')
  206. file.write' \n')
  207. file.write' term.setCursorPos(1,y-1)\n')
  208. file.write' term.setBackgroundColor(colors.blue)\n')
  209. file.write' term.write("ShutDown")\n')
  210. file.write' term.setCursorPos(1,y-2)\n')
  211. file.write' term.setBackgroundColor(colors.gray)\n')
  212. file.write' term.write("CMD ")\n')
  213. file.write' term.setCursorPos(1,y-3)\n')
  214. file.write' term.write("Files ")\n')
  215. file.write' term.setCursorPos(1,1)\n')
  216. file.write' \n')
  217. file.write' clock.get()\n')
  218. file.write' \n')
  219. file.write' term.setBackgroundColor(colors.black)\n')
  220. file.write' term.setCursorPos(1,1)\n')
  221. file.write'end\n')
  222. file.write' \n')
  223. file.write'function frame5()\n')
  224. file.write' x,y = term.getSize()\n')
  225. file.write' term.clear()\n')
  226. file.write' term.setCursorPos(1,y)\n')
  227. file.write' \n')
  228. file.write' term.setBackgroundColor(colors.gray)\n')
  229. file.write' term.write(" ")\n')
  230. file.write' term.setBackgroundColor(colors.black)\n')
  231. file.write' term.write("Start")\n')
  232. file.write' term.setBackgroundColor(colors.gray)\n')
  233. file.write' term.write(" ")\n')
  234. file.write' term.setBackgroundColor(colors.black)\n')
  235. file.write' term.write("Programs")\n')
  236. file.write' term.setBackgroundColor(colors.gray)\n')
  237. file.write' term.write(" ")\n')
  238. file.write' term.setBackgroundColor(colors.black)\n')
  239. file.write' term.write("Documents")\n')
  240. file.write' term.setBackgroundColor(colors.gray)\n')
  241. file.write' term.write(" ")\n')
  242. file.write' \n')
  243. file.write' term.setCursorPos(1,y-1)\n')
  244. file.write' term.setBackgroundColor(colors.gray)\n')
  245. file.write' term.write("ShutDown")\n')
  246. file.write' term.setCursorPos(1,y-2)\n')
  247. file.write' term.setBackgroundColor(colors.blue)\n')
  248. file.write' term.write("CMD ")\n')
  249. file.write' term.setCursorPos(1,y-3)\n')
  250. file.write' term.setBackgroundColor(colors.gray)\n')
  251. file.write' term.write("Files ")\n')
  252. file.write' term.setCursorPos(1,1)\n')
  253. file.write' \n')
  254. file.write' clock.get()\n')
  255. file.write' \n')
  256. file.write' term.setBackgroundColor(colors.black)\n')
  257. file.write' term.setCursorPos(1,1)\n')
  258. file.write' \n')
  259. file.write' end\n')
  260. file.write' \n')
  261. file.write'function frame6()\n')
  262. file.write' x,y = term.getSize()\n')
  263. file.write' term.clear()\n')
  264. file.write' term.setCursorPos(1,y)\n')
  265. file.write' \n')
  266. file.write' term.setBackgroundColor(colors.gray)\n')
  267. file.write' term.write(" ")\n')
  268. file.write' term.setBackgroundColor(colors.black)\n')
  269. file.write' term.write("Start")\n')
  270. file.write' term.setBackgroundColor(colors.gray)\n')
  271. file.write' term.write(" ")\n')
  272. file.write' term.setBackgroundColor(colors.black)\n')
  273. file.write' term.write("Programs")\n')
  274. file.write' term.setBackgroundColor(colors.gray)\n')
  275. file.write' term.write(" ")\n')
  276. file.write' term.setBackgroundColor(colors.black)\n')
  277. file.write' term.write("Documents")\n')
  278. file.write' term.setBackgroundColor(colors.gray)\n')
  279. file.write' term.write(" ")\n')
  280. file.write' \n')
  281. file.write' term.setCursorPos(1,y-1)\n')
  282. file.write' term.setBackgroundColor(colors.gray)\n')
  283. file.write' term.write("ShutDown")\n')
  284. file.write' term.setCursorPos(1,y-2)\n')
  285. file.write' term.setBackgroundColor(colors.gray)\n')
  286. file.write' term.write("CMD ")\n')
  287. file.write' term.setCursorPos(1,y-3)\n')
  288. file.write' term.setBackgroundColor(colors.blue)\n')
  289. file.write' term.write("Files ")\n')
  290. file.write' term.setCursorPos(1,1)\n')
  291. file.write' \n')
  292. file.write' clock.get()\n')
  293. file.write' \n')
  294. file.write' term.setBackgroundColor(colors.black)\n')
  295. file.write' term.setCursorPos(1,1)\n')
  296. file.write' \n')
  297. file.write'end\n')
  298.  
  299. file.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement