Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Build the startup file
- file = fs.open("startup",'w')
- file.write('--load apis\n')
- file.write('os.loadAPI("BunnyOS/ProgramFiles/install")\n')
- file.write('os.loadAPI("BunnyOS/Display/menu")\n')
- file.write('os.loadAPI("BunnyOS/Display/clock")\n')
- file.write('shell.run("BunnyOS/Display/Control")\n')
- file.write('--disable terminating\n')
- file.write('oldPullEvent = os.pullEvent\n')
- file.write('os.pullEvent = os.pullEventRaw\n')
- file.close()
- file = fs.open("/BunnyOS/ProgramFiles/menu",'w')
- file.write'function buildProgramList()\n')
- file.write' programlist = {}\n')
- file.write' i = 0\n')
- file.write' file = fs.open("/BunnyOS/ProgramFiles/programs", "r")\n')
- file.write' x = file.readLine()\n')
- file.write' while x ~= nil do\n')
- file.write' programlist[i] = x\n')
- file.write' x = file.readLine()\n')
- file.write' i = i + 1\n')
- file.write' end\n')
- file.write' file.close()\n')
- file.write' return programlist\n')
- file.write'end\n')
- file.write' \n')
- file.write'Pname = " "\n')
- file.write' \n')
- file.write'function frame0()\n')
- file.write' x,y = term.getSize()\n')
- file.write' term.clear()\n')
- file.write' term.setCursorPos(1,y)\n')
- file.write' \n')
- file.write' term.setBackgroundColor(colors.gray)\n')
- file.write' term.write(" ")\n')
- file.write' term.setBackgroundColor(colors.gray)\n')
- file.write' term.write("Start")\n')
- file.write' term.setBackgroundColor(colors.gray)\n')
- file.write' term.write(" ")\n')
- file.write' term.setBackgroundColor(colors.black)\n')
- file.write' term.write("Programs")\n')
- file.write' term.setBackgroundColor(colors.gray)\n')
- file.write' term.write(" ")\n')
- file.write' term.setBackgroundColor(colors.black)\n')
- file.write' term.write("Documents")\n')
- file.write' term.setBackgroundColor(colors.gray)\n')
- file.write' term.write(" ")\n')
- file.write' \n')
- file.write' term.setCursorPos(1,y-1)\n')
- file.write' term.setBackgroundColor(colors.gray)\n')
- file.write' term.write("ShutDown")\n')
- file.write' term.setCursorPos(1,y-2)\n')
- file.write' term.write("CMD ")\n')
- file.write' term.setCursorPos(1,y-3)\n')
- file.write' term.write("Files ")\n')
- file.write' term.setCursorPos(1,1)\n')
- file.write' \n')
- file.write' clock.get()\n')
- file.write' \n')
- file.write' term.setBackgroundColor(colors.black)\n')
- file.write' term.setCursorPos(1,1)\n')
- file.write'end\n')
- file.write' \n')
- file.write'function frame1()\n')
- file.write' x,y = term.getSize()\n')
- file.write' term.clear()\n')
- file.write' term.setCursorPos(1,y)\n')
- file.write' \n')
- file.write' term.setBackgroundColor(colors.gray)\n')
- file.write' term.write(" ")\n')
- file.write' term.setBackgroundColor(colors.blue)\n')
- file.write' term.write("Start")\n')
- file.write' term.setBackgroundColor(colors.gray)\n')
- file.write' term.write(" ")\n')
- file.write' term.setBackgroundColor(colors.black)\n')
- file.write' term.write("Programs")\n')
- file.write' term.setBackgroundColor(colors.gray)\n')
- file.write' term.write(" ")\n')
- file.write' term.setBackgroundColor(colors.black)\n')
- file.write' term.write("Documents")\n')
- file.write' term.setBackgroundColor(colors.gray)\n')
- file.write' term.write(" ")\n')
- file.write' \n')
- file.write' term.setCursorPos(1,y-1)\n')
- file.write' term.setBackgroundColor(colors.gray)\n')
- file.write' term.write("ShutDown")\n')
- file.write' term.setCursorPos(1,y-2)\n')
- file.write' term.write("CMD ")\n')
- file.write' term.setCursorPos(1,y-3)\n')
- file.write' term.write("Files ")\n')
- file.write' term.setCursorPos(1,1)\n')
- file.write' \n')
- file.write' clock.get()\n')
- file.write' \n')
- file.write' term.setBackgroundColor(colors.black)\n')
- file.write' term.setCursorPos(1,1)\n')
- file.write'end\n')
- file.write' \n')
- file.write'function frame2(r)\n')
- file.write' x,y = term.getSize()\n')
- file.write' term.clear()\n')
- file.write' term.setCursorPos(1,y)\n')
- file.write' \n')
- file.write' term.setBackgroundColor(colors.gray)\n')
- file.write' term.write(" ")\n')
- file.write' term.setBackgroundColor(colors.black)\n')
- file.write' term.write("Start")\n')
- file.write' term.setBackgroundColor(colors.gray)\n')
- file.write' term.write(" ")\n')
- file.write' if r == nil then\n')
- file.write' term.setBackgroundColor(colors.blue)\n')
- file.write' else\n')
- file.write' term.setBackgroundColor(colors.black)\n')
- file.write' end\n')
- file.write' term.write("Programs")\n')
- file.write' term.setBackgroundColor(colors.gray)\n')
- file.write' term.write(" ")\n')
- file.write' term.setBackgroundColor(colors.black)\n')
- file.write' term.write("Documents")\n')
- file.write' term.setBackgroundColor(colors.gray)\n')
- file.write' term.write(" ")\n')
- file.write' \n')
- file.write' Programs = {}\n')
- file.write' Programs = buildProgramList() --get the list to feed in the menu\n')
- file.write' term.setCursorPos(8,y-1)\n')
- file.write' term.setBackgroundColor(colors.gray)\n')
- file.write' local lengthnum = 0\n')
- file.write' for k,v in pairs(Programs) do\n')
- file.write' lengthnum = lengthnum + 1\n')
- file.write' end\n')
- file.write' local q = 0\n')
- file.write' local w = 1\n')
- file.write' \n')
- file.write' while q <= lengthnum-1 do\n')
- file.write' term.setCursorPos(8,y-w)\n')
- file.write' if q == r then\n')
- file.write' term.setBackgroundColor(colors.blue)\n')
- file.write' else\n')
- file.write' term.setBackgroundColor(colors.gray)\n')
- file.write' end\n')
- file.write' term.write(Programs[q])\n')
- file.write' Pname = Programs[q] --try this\n')
- file.write' w = w + 1\n')
- file.write' q = q + 1 \n')
- file.write' end\n')
- file.write' \n')
- file.write' clock.get()\n')
- file.write' \n')
- file.write' term.setBackgroundColor(colors.black)\n')
- file.write' term.setCursorPos(1,1)\n')
- file.write' return Pname\n')
- file.write'end\n')
- file.write' \n')
- file.write'function frame3()\n')
- file.write' x,y = term.getSize()\n')
- file.write' term.clear()\n')
- file.write' term.setCursorPos(1,y)\n')
- file.write' \n')
- file.write' term.setBackgroundColor(colors.gray)\n')
- file.write' term.write(" ")\n')
- file.write' term.setBackgroundColor(colors.black)\n')
- file.write' term.write("Start")\n')
- file.write' term.setBackgroundColor(colors.gray)\n')
- file.write' term.write(" ")\n')
- file.write' term.setBackgroundColor(colors.black)\n')
- file.write' term.write("Programs")\n')
- file.write' term.setBackgroundColor(colors.gray)\n')
- file.write' term.write(" ")\n')
- file.write' term.setBackgroundColor(colors.blue)\n')
- file.write' term.write("Documents")\n')
- file.write' term.setBackgroundColor(colors.gray)\n')
- file.write' term.write(" ")\n')
- file.write' \n')
- file.write' clock.get()\n')
- file.write' \n')
- file.write' term.setBackgroundColor(colors.black)\n')
- file.write' term.setCursorPos(1,1)\n')
- file.write'end\n')
- file.write' \n')
- file.write'function frame4()\n')
- file.write' x,y = term.getSize()\n')
- file.write' term.clear()\n')
- file.write' term.setCursorPos(1,y)\n')
- file.write' \n')
- file.write' term.setBackgroundColor(colors.gray)\n')
- file.write' term.write(" ")\n')
- file.write' term.setBackgroundColor(colors.black)\n')
- file.write' term.write("Start")\n')
- file.write' term.setBackgroundColor(colors.gray)\n')
- file.write' term.write(" ")\n')
- file.write' term.setBackgroundColor(colors.black)\n')
- file.write' term.write("Programs")\n')
- file.write' term.setBackgroundColor(colors.gray)\n')
- file.write' term.write(" ")\n')
- file.write' term.setBackgroundColor(colors.black)\n')
- file.write' term.write("Documents")\n')
- file.write' term.setBackgroundColor(colors.gray)\n')
- file.write' term.write(" ")\n')
- file.write' \n')
- file.write' term.setCursorPos(1,y-1)\n')
- file.write' term.setBackgroundColor(colors.blue)\n')
- file.write' term.write("ShutDown")\n')
- file.write' term.setCursorPos(1,y-2)\n')
- file.write' term.setBackgroundColor(colors.gray)\n')
- file.write' term.write("CMD ")\n')
- file.write' term.setCursorPos(1,y-3)\n')
- file.write' term.write("Files ")\n')
- file.write' term.setCursorPos(1,1)\n')
- file.write' \n')
- file.write' clock.get()\n')
- file.write' \n')
- file.write' term.setBackgroundColor(colors.black)\n')
- file.write' term.setCursorPos(1,1)\n')
- file.write'end\n')
- file.write' \n')
- file.write'function frame5()\n')
- file.write' x,y = term.getSize()\n')
- file.write' term.clear()\n')
- file.write' term.setCursorPos(1,y)\n')
- file.write' \n')
- file.write' term.setBackgroundColor(colors.gray)\n')
- file.write' term.write(" ")\n')
- file.write' term.setBackgroundColor(colors.black)\n')
- file.write' term.write("Start")\n')
- file.write' term.setBackgroundColor(colors.gray)\n')
- file.write' term.write(" ")\n')
- file.write' term.setBackgroundColor(colors.black)\n')
- file.write' term.write("Programs")\n')
- file.write' term.setBackgroundColor(colors.gray)\n')
- file.write' term.write(" ")\n')
- file.write' term.setBackgroundColor(colors.black)\n')
- file.write' term.write("Documents")\n')
- file.write' term.setBackgroundColor(colors.gray)\n')
- file.write' term.write(" ")\n')
- file.write' \n')
- file.write' term.setCursorPos(1,y-1)\n')
- file.write' term.setBackgroundColor(colors.gray)\n')
- file.write' term.write("ShutDown")\n')
- file.write' term.setCursorPos(1,y-2)\n')
- file.write' term.setBackgroundColor(colors.blue)\n')
- file.write' term.write("CMD ")\n')
- file.write' term.setCursorPos(1,y-3)\n')
- file.write' term.setBackgroundColor(colors.gray)\n')
- file.write' term.write("Files ")\n')
- file.write' term.setCursorPos(1,1)\n')
- file.write' \n')
- file.write' clock.get()\n')
- file.write' \n')
- file.write' term.setBackgroundColor(colors.black)\n')
- file.write' term.setCursorPos(1,1)\n')
- file.write' \n')
- file.write' end\n')
- file.write' \n')
- file.write'function frame6()\n')
- file.write' x,y = term.getSize()\n')
- file.write' term.clear()\n')
- file.write' term.setCursorPos(1,y)\n')
- file.write' \n')
- file.write' term.setBackgroundColor(colors.gray)\n')
- file.write' term.write(" ")\n')
- file.write' term.setBackgroundColor(colors.black)\n')
- file.write' term.write("Start")\n')
- file.write' term.setBackgroundColor(colors.gray)\n')
- file.write' term.write(" ")\n')
- file.write' term.setBackgroundColor(colors.black)\n')
- file.write' term.write("Programs")\n')
- file.write' term.setBackgroundColor(colors.gray)\n')
- file.write' term.write(" ")\n')
- file.write' term.setBackgroundColor(colors.black)\n')
- file.write' term.write("Documents")\n')
- file.write' term.setBackgroundColor(colors.gray)\n')
- file.write' term.write(" ")\n')
- file.write' \n')
- file.write' term.setCursorPos(1,y-1)\n')
- file.write' term.setBackgroundColor(colors.gray)\n')
- file.write' term.write("ShutDown")\n')
- file.write' term.setCursorPos(1,y-2)\n')
- file.write' term.setBackgroundColor(colors.gray)\n')
- file.write' term.write("CMD ")\n')
- file.write' term.setCursorPos(1,y-3)\n')
- file.write' term.setBackgroundColor(colors.blue)\n')
- file.write' term.write("Files ")\n')
- file.write' term.setCursorPos(1,1)\n')
- file.write' \n')
- file.write' clock.get()\n')
- file.write' \n')
- file.write' term.setBackgroundColor(colors.black)\n')
- file.write' term.setCursorPos(1,1)\n')
- file.write' \n')
- file.write'end\n')
- file.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement