Not a member of Pastebin yet?
                        Sign Up,
                        it unlocks many cool features!                    
                - --Get the new updated version here:
 - -- http://pastebin.com/J9DAzTKf
 - function createfolders()
 - fs.makeDir("/CookieSystem")
 - fs.makeDir("/CookieSystem/CS-System")
 - fs.makeDir("/CookieSystem/DB")
 - fs.makeDir("/CookieSystem/DB/DBlog")
 - fs.makeDir("/CookieSystem/DB/DBlevels")
 - fs.makeDir("/CookieSystem/DB/DBlevels/uselevel")
 - fs.makeDir("/CookieSystem/DB/DBlevels/editlevel")
 - end
 - function createadminaccount()
 - file = io.open("CookieSystem/DB/DBlog/admin", "w")
 - file:write("admin\n4")
 - file:close()
 - end
 - function createlevelfiles()
 - file = io.open("CookieSystem/DB/DBlevels/editlevel/1", "w")
 - file:close()
 - file = io.open("CookieSystem/DB/DBlevels/editlevel/2", "w")
 - file:close()
 - file = io.open("CookieSystem/DB/DBlevels/editlevel/3", "w")
 - file:close()
 - file = io.open("CookieSystem/DB/DBlevels/uselevel/1", "w")
 - file:write([[/CookieSystem/changepass
 - /rom/programs/id
 - /rom/programs/label
 - /rom/programs/reboot
 - /rom/programs/shutdown
 - /rom/programs/worm
 - ]])
 - file:close()
 - file = io.open("CookieSystem/DB/DBlevels/uselevel/2", "w")
 - file:write([[/CookieSystem/create
 - ]])
 - file:close()
 - file = io.open("CookieSystem/DB/DBlevels/uselevel/3", "w")
 - file:write([[/CookieSystem/delete
 - /CookieSystem/setlvl
 - ]])
 - file:close()
 - end
 - function createlogin()
 - file = io.open("CookieSystem/login", "w")
 - file:write([[term.clear()
 - term.setCursorPos(10,5)
 - write("==============================")
 - term.setCursorPos(10,14)
 - write("==============================")
 - for n=6,13 do
 - term.setCursorPos(10,n)
 - write("|")
 - term.setCursorPos(39,n)
 - write("|")
 - end
 - term.setCursorPos(22,7)
 - write("LOGIN")
 - term.setCursorPos(15,9)
 - write("Name:")
 - term.setCursorPos(15,11)
 - write("Pass:")
 - term.setCursorPos(21,9)
 - curname = read()
 - term.setCursorPos(21,11)
 - pass = read("*")
 - corlogin = false
 - DB = io.open("/CookieSystem/DB/DBlog/" ..curname)
 - if DB
 - then
 - corpass = DB:read()
 - DB:close()
 - if pass == corpass
 - then
 - corlogin = true
 - end
 - end
 - if corlogin == false
 - then
 - term.setCursorPos(18,13)
 - write("Login denied")
 - sleep(2)
 - os.shutdown()
 - end
 - ]])
 - file:close()
 - end
 - function createcreate()
 - file = io.open("/CookieSystem/create", "w")
 - file:write([[term.clear()
 - term.setCursorPos(18,3)
 - print("Account Creation")
 - term.setCursorPos(10,8)
 - write("Name: ")
 - term.setCursorPos(10,10)
 - write("Password: ")
 - term.setCursorPos(20,8)
 - local newname = read()
 - term.setCursorPos(20,10)
 - local newpass = read()
 - term.setCursorPos(5,12)
 - DB = io.open("/CookieSystem/DB/DBlog/"..newname, "r")
 - if DB
 - then
 - DB:close()
 - print("Username already exists")
 - else
 - DB = io.open("/CookieSystem/DB/DBlog/"..newname, "w")
 - DB:write(newpass.."\n"..1)
 - DB:close()
 - print("New account created")
 - end ]])
 - file:close()
 - end
 - function createdelete()
 - file = io.open("/CookieSystem/delete", "w")
 - file:write([[term.clear()
 - term.setCursorPos(20,3)
 - print("Account Deletion")
 - term.setCursorPos(5,6)
 - print("Which account do you want to delete?")
 - term.setCursorPos(10,8)
 - local delname = read()
 - term.setCursorPos(5,10)
 - if delname ~= curname and delname ~= "admin" then
 - db = io.open("/CookieSystem/DB/DBlog/"..delname,"r" )
 - if db
 - then
 - db:close()
 - shell.run("rm", "/CookieSystem/DB/DBlog/"..delname)
 - print("Account deleted")
 - else
 - print("Account doesn't exist.")
 - end
 - end
 - sleep(1)]])
 - file:close()
 - end
 - function createsetlvl()
 - file = io.open("/CookieSystem/setlvl", "w")
 - file:write([[term.clear()
 - term.setCursorPos(17,4)
 - print("Set Clearance level")
 - term.setCursorPos(5,6)
 - print("Who's level do you want to change?")
 - term.setCursorPos(10,8)
 - local clname = read()
 - term.setCursorPos(5,10)
 - print("What do you want to set the level to?")
 - term.setCursorPos(10,12)
 - local newlevel = read()
 - newlevel = tonumber(newlevel)
 - term.setCursorPos(5,14)
 - sleep(1)
 - DB = io.open("/CookieSystem/DB/DBlog/"..clname, "r")
 - if DB
 - then
 - local tarpass = DB:read()
 - local tarlevel = DB:read()
 - tarlevel = tonumber(tarlevel)
 - DB:close()
 - if curlevel > tarlevel
 - then
 - if curlevel > newlevel
 - then
 - DB = io.open("/CookieSystem/DB/DBlog/"..clname, "w")
 - DB:write(tarpass.."\n"..newlevel)
 - DB:close()
 - print(clname.."'s level changed to "..newlevel)
 - else
 - print("The desired level must be lower than your own")
 - end
 - else
 - print("Target's level is too high to be changed")
 - end
 - else
 - print("Name not found")
 - end
 - sleep(1) ]])
 - file:close()
 - end
 - function createchangepass()
 - file = io.open("/CookieSystem/changepass", "w")
 - file:write([[term.clear()
 - term.setCursorPos(18,3)
 - print("Change Password")
 - term.setCursorPos(5,5)
 - print("Do you want to change your password?")
 - term.setCursorPos(10,7)
 - local answer = read()
 - if answer == "yes"
 - then
 - term.setCursorPos(5,9)
 - print("Give your current password")
 - term.setCursorPos(10,11)
 - local passtry = read()
 - if passtry == curpass
 - then
 - term.setCursorPos(5,13)
 - print("What do you want your new password to be?")
 - term.setCursorPos(10,15)
 - local newpass = read()
 - DB = io.open("/CookieSystem/DB/DBlog/"..curname, "w")
 - DB:write(newpass.."\n"..curlevel)
 - DB:close()
 - curpass = newpass
 - term.setCursorPos(5,17)
 - print("New password set")
 - else
 - term.setCursorPos(5,13)
 - print("Password incorrect")
 - end
 - end
 - sleep(1)
 - ]])
 - file:close()
 - end
 - function createinterface()
 - file = io.open("/CookieSystem/CS-System/interface", "w")
 - file:write([[
 - function ini()
 - path = "/"
 - curselx = 1
 - cursely = 1
 - preselx = 1
 - presely = 1
 - curselthing = ""
 - cmdln = ""
 - curtabloc = 1
 - curpage = 1
 - infoline = ""
 - curselminuselvl = 5
 - curselmineditlvl = 5
 - maintenance = false
 - DBlog = io.open("/CookieSystem/DB/DBlog/"..curname, "r")
 - curpass = DBlog:read()
 - curlevel = DBlog:read()
 - curlevel = tonumber(curlevel)
 - DBlog:close()
 - end
 - function bordersui()
 - for n=2, 15 do
 - if n == 2
 - then
 - term.setCursorPos(1,1)
 - write("===================CookieSystem===================")
 - elseif n == 15
 - then
 - write("==================================================")
 - else
 - term.setCursorPos(1,n-1)
 - write("||||||||||||||||||||||||||||||||||||||||||||||||||")
 - end
 - end
 - for n=3, 14 do
 - for i=2,49 do
 - term.setCursorPos(i,n)
 - write(" ")
 - end
 - end
 - end
 - function topui()
 - term.setCursorPos(1,1)
 - term.clearLine()
 - write(curname.." | "..curlevel)
 - term.setCursorPos(40,1)
 - time = textutils.formatTime(os.time(), true)
 - write("V1.0 "..time)
 - end
 - function bottomui()
 - term.setCursorPos(1,18)
 - term.clearLine()
 - showpath = path
 - if string.len(path) > 18
 - then showpath = string.sub(path, -18)
 - end
 - write("Path: "..showpath)
 - term.setCursorPos(25,18)
 - write(" Sel: "..curselthing)
 - term.setCursorPos(1,17)
 - term.clearLine()
 - write("Info: "..infoline)
 - term.setCursorPos(1,16)
 - term.clearLine()
 - end
 - function basescreen()
 - term.clear()
 - topui()
 - bordersui()
 - bottomui()
 - end
 - function getlist(path)
 - fullist = {}
 - fulllist = fs.list(path)
 - folderlist = {}
 - programlist = {}
 - local nl = 0
 - local il = 0
 - local jl = 0
 - while true do
 - nl = nl + 1
 - if fulllist[nl] == nil then break end
 - if fs.isDir(path..fulllist[nl])
 - then
 - il = il + 1
 - folderlist[il] = fulllist[nl]
 - else
 - jl = jl + 1
 - programlist[jl] = fulllist[nl]
 - end
 - end
 - end
 - function getdisplayname(thingy)
 - displayname = thingy
 - displaylength = string.len(displayname)
 - if displaylength < 8
 - then firsteightchar = string.sub(displayname,1,displaylength)
 - else firsteightchar = string.sub(displayname,1,8)
 - end
 - if displaylength > 8
 - then secondeightchar = string.sub(displayname, 9, 16)
 - else secondeightchar = ""
 - end
 - if fs.isDir(path..thingy) then
 - displaylineone = "=folder="
 - else
 - if string.sub(displayname,-4) == ".txt"
 - then displaylineone = "==text=="
 - else displaylineone = "=progrm="
 - end
 - end
 - displaylinetwo = firsteightchar
 - displaylinethree = secondeightchar
 - end
 - function getcoordspot(n)
 - x = n%5
 - if x == 0 then x = 5 end
 - y = n/5 - x/5 +1
 - if x == 1 then prx = 1
 - elseif x == 2 then prx = 11
 - elseif x == 3 then prx = 21
 - elseif x == 4 then prx = 31
 - elseif x == 5 then prx = 41
 - end
 - pry = (y*3)
 - end
 - function printtileborders(prx,pry)
 - term.setCursorPos(prx,pry)
 - write("|")
 - term.setCursorPos(prx,pry+1)
 - write("|")
 - term.setCursorPos(prx,pry+2)
 - write("|")
 - term.setCursorPos(prx+9,pry)
 - write("|")
 - term.setCursorPos(prx+9,pry+1)
 - write("|")
 - term.setCursorPos(prx+9,pry+2)
 - write("|")
 - end
 - function printtilebordersselected(prx,pry)
 - term.setCursorPos(prx,pry)
 - write("*")
 - term.setCursorPos(prx,pry+1)
 - write("*")
 - term.setCursorPos(prx,pry+2)
 - write("*")
 - term.setCursorPos(prx+9,pry)
 - write("*")
 - term.setCursorPos(prx+9,pry+1)
 - write("*")
 - term.setCursorPos(prx+9,pry+2)
 - write("*")
 - end
 - function printtile(prx,pry)
 - term.setCursorPos(prx+1, pry)
 - write(displaylineone)
 - term.setCursorPos(prx+1, pry+1)
 - write(displaylinetwo)
 - if displaylinethree ~= nil
 - then
 - term.setCursorPos(prx+1, pry+2)
 - write(displaylinethree)
 - end
 - end
 - function showstuff()
 - getlist(path)
 - maxpage = (math.floor(#fulllist/20) + 1)
 - i=0
 - for n=((curpage*20)-20+1), (curpage*20) do
 - i = i + 1
 - if fulllist[n] == nil then break end
 - getdisplayname(fulllist[n])
 - getcoordspot(i)
 - printtile(prx,pry)
 - end
 - for n=1, 20 do
 - getcoordspot(n)
 - printtileborders(prx,pry)
 - end
 - end
 - function pagedown()
 - if curpage < maxpage
 - then
 - curpage = curpage + 1
 - fullrefresh()
 - end
 - end
 - function pageup()
 - if curpage > 1
 - then
 - curpage = curpage - 1
 - fullrefresh()
 - end
 - end
 - function movecursor(direction)
 - if direction == "left"
 - then
 - if curselx > 1
 - then
 - preselx = curselx
 - curselx = curselx - 1
 - end
 - end
 - if direction == "right"
 - then
 - if curselx < 5
 - then
 - preselx = curselx
 - curselx = curselx + 1
 - end
 - end
 - if direction == "up"
 - then
 - if cursely > 1
 - then
 - presely = cursely
 - cursely = cursely - 1
 - end
 - end
 - if direction == "down"
 - then
 - if cursely < 4
 - then
 - presely = cursely
 - cursely = cursely + 1
 - end
 - end
 - end
 - function getminimumlevel()
 - curselminuselvl = 4
 - curselmineditlvl = 4
 - for k=3, 1,-1 do
 - DBU = io.open("/CookieSystem/DB/DBlevels/uselevel/"..k, "r")
 - while true do
 - ucheck = DBU:read()
 - if ucheck == nil then break end
 - if (path..curselthing) == ucheck then curselminuselvl = k end
 - end
 - DBU:close()
 - DBE = io.open("/CookieSystem/DB/DBlevels/editlevel/"..k, "r")
 - while true do
 - echeck = DBE:read()
 - if echeck == nil then break end
 - if (path..curselthing) == echeck then curselmineditlvl = k end
 - end
 - DBE:close()
 - end
 - end
 - function select()
 - if curselthing ~= "empty spot" then
 - if fs.isDir(path..curselthing)
 - then
 - path = (path..curselthing.."/")
 - else
 - getminimumlevel()
 - if curselminuselvl <= curlevel
 - then
 - if string.sub(curselthing, -4) == ".txt"
 - then shell.run("edit", path..curselthing)
 - else shell.run(path..curselthing)
 - end
 - sleep(1)
 - else
 - infoline = "Level too low"
 - end
 - end
 - curpage = 1
 - fullrefresh()
 - end
 - end
 - function back()
 - if path ~= "/"
 - then
 - pathhelp = path
 - pathhelpn = 1
 - pathhelpnrawr = 0
 - pathhelpnpre = 0
 - while true do
 - pathhelpnrawr = pathhelpnpre
 - pathhelpnpre = pathhelpn
 - pathhelpn = pathhelpn - pathhelpnrawr
 - if pathhelp == "" or pathhelp == nil then break end
 - pathhelp = string.sub(pathhelp, pathhelpn+1)
 - if pathhelp == "" or pathhelp == nil then break end
 - pathhelpn = string.find(pathhelp, "/")
 - end
 - path = string.sub(path,1,pathhelpnrawr)
 - end
 - curpage = 1
 - fullrefresh()
 - end
 - function tabkey()
 - tabmax = 2
 - if curtabloc == 1 then newtabloc = (curtabloc + 1) end
 - if curtabloc == tabmax then newtabloc = 1 end
 - curtabloc = newtabloc
 - end
 - function home()
 - curpage = 1
 - path = "/"
 - curselx = 1
 - cursely = 1
 - basescreen()
 - showstuff()
 - getcurselthing()
 - end
 - function exdelete()
 - if cursel ~= "empty spot"
 - then
 - getminimumlevel()
 - if curselmineditlvl <= curlevel
 - then
 - shell.run("rm", path..curselthing)
 - fullrefresh()
 - else
 - infoline = "Level too low"
 - end
 - else
 - infoline = "Select something first"
 - end
 - end
 - function interfacebrowser()
 - event, argument = os.pullEvent()
 - if event == "key" and argument == 203 then movecursor("left") end
 - if event == "key" and argument == 205 then movecursor("right") end
 - if event == "key" and argument == 200 then movecursor("up") end
 - if event == "key" and argument == 208 then movecursor("down") end
 - if event == "key" and argument == 28 then select() end
 - if event == "key" and argument == 14 then back() end
 - if event == "key" and argument == 15 then tabkey() end
 - if event == "key" and argument == 209 then pagedown() end
 - if event == "key" and argument == 201 then pageup() end
 - if event == "key" and argument == 211 then exdelete() end
 - if event == "key" and argument == 199 then home() end
 - end
 - function getcurselthing()
 - local ns = ((cursely-1)*5 + curselx)+((curpage-1)*20)
 - if ns <= #fulllist
 - then
 - curselthing = fulllist[ns]
 - else
 - curselthing = "empty spot"
 - end
 - end
 - function exedit()
 - if curselthing ~= "empty spot"
 - then
 - getminimumlevel()
 - if curselmineditlvl <= curlevel
 - then
 - shell.run("edit", path..curselthing)
 - fullrefresh()
 - else
 - infoline = "Level too low"
 - end
 - else
 - infoline = "Select something first"
 - end
 - end
 - function exnew()
 - if string.sub(cmdln, 5, 11) == "program"
 - then
 - newprogramname = string.sub(cmdln, 13)
 - if newprogramname ~= nil and newprogramname ~= ""
 - then
 - if fs.exists(path..newprogramname) == false
 - then
 - shell.run("edit", path..newprogramname)
 - fullrefresh()
 - else
 - infoline = "That name already exists"
 - end
 - else
 - infoline = "Command is New <folder/program> <name>"
 - end
 - elseif string.sub(cmdln, 5, 10) == "folder"
 - then
 - newfoldername = string.sub(cmdln, 12)
 - if newfoldername ~= nil and newfoldername ~= ""
 - then
 - if fs.exists(path..newfoldername) == false
 - then
 - fs.makeDir(path..newfoldername)
 - fullrefresh()
 - else
 - infoline = "That name already exists"
 - end
 - else
 - infoline = "Command is New <folder/program> <name>"
 - end
 - else
 - infoline = "Command is New <folder/program> <name>"
 - end
 - end
 - function exshutdown()
 - infoline = "Shutting down computer..."
 - bottomui()
 - sleep(2)
 - os.shutdown()
 - end
 - function exhelp()
 - local helprawr = string.sub(cmdln,6)
 - term.clear()
 - term.setCursorPos(1,1)
 - shell.run("help", helprawr)
 - term.setCursorPos(5,18)
 - write("Press any key to continue")
 - while true do
 - event = os.pullEvent()
 - if event == "key" then break end
 - end
 - fullrefresh()
 - end
 - function excopy()
 - if curselthing ~= "empty spot"
 - then
 - curcopysel = (path..curselthing)
 - infoline = ("Copying "..curselthing)
 - else
 - infoline = "Select something first."
 - end
 - end
 - function expaste()
 - shell.run("cp", curcopysel, path)
 - fullrefresh()
 - end
 - function exsetlevel()
 - local editoruse = "rawr"
 - local setnewlevel = 0
 - if string.sub(cmdln,10,12) == "use" then
 - editoruse = "use"
 - if string.sub(cmdln, 14,14) == "1" then setnewlevel = "1"
 - elseif string.sub(cmdln, 14,14) == "2" then setnewlevel = "2"
 - elseif string.sub(cmdln, 14,14) == "3" then setnewlevel = "3"
 - else infoline = "Command is setlevel use/edit 1/2/3"
 - end
 - else infoline = "Command is setlevel use/edit 1/2/3"
 - end
 - if string.sub(cmdln,10,13) == "edit" then
 - editoruse = "edit"
 - if string.sub(cmdln, 15,15) == "1" then setnewlevel = "1"
 - elseif string.sub(cmdln, 15,15) == "2" then setnewlevel = "2"
 - elseif string.sub(cmdln, 15,15) == "3" then setnewlevel = "3"
 - else infoline = "Command is setlevel use/edit 1/2/3"
 - end
 - else infoline = "Command is setlevel use/edit 1/2/3"
 - end
 - if setnewlevel ~= 0 then
 - local curselthingmem = curselthing
 - local pathmem = path
 - path = ("/cookiesystem/DB/DBlevels/"..editoruse.."level/")
 - curselthing = setnewlevel
 - getminimumlevel()
 - if curselmineditlvl <= curlevel
 - then
 - file = io.open(path..curselthing, "a")
 - file:write("\n"..pathmem..curselthingmem)
 - file:close()
 - else
 - infoline = "Your level is too low"
 - end
 - path = pathmem
 - curselthing = curselthingmem
 - end
 - end
 - function exrename()
 - if curselthing ~= "empty spot"
 - then
 - local newname = string.sub(cmdln, 8)
 - shell.run("move", path..curselthing, path..newname)
 - fullrefresh()
 - else
 - infoline = "select something first"
 - end
 - end
 - function executeline()
 - if cmdln == "edit" then exedit() end
 - if string.sub(cmdln,1,3) == "new" then exnew() end
 - if cmdln == "delete" then exdelete() end
 - if cmdln == "shutdown" then exshutdown() end
 - if string.sub(cmdln,1,4) == "help" then exhelp() end
 - if cmdln == "copy" then excopy() end
 - if cmdln == "paste" then expaste() end
 - if string.sub(cmdln,1,8) == "setlevel" then exsetlevel() end
 - if cmdln == "maintenance" and curname == "admin" then maintenance = true infoline = "Maintenance mode activated, hold ctrl+T" end
 - if string.sub(cmdln,1,6) == "rename" then exrename() end
 - cmdln = ""
 - end
 - function commandline()
 - term.setCursorPos(1,16)
 - write(">")
 - while true do
 - event, argument = os.pullEvent()
 - if event == "key" and argument == 15 then tabkey() break end
 - if event == "key" and argument == 28 then executeline() break end
 - if event == "key" and argument == 14
 - then
 - if string.len(cmdln) > 0 then
 - cmdln = string.sub(cmdln, 1, (string.len(cmdln)-1))
 - term.setCursorPos(1,16)
 - write(">"..cmdln.." ")
 - end end
 - if event == "char"
 - then
 - term.setCursorPos(1,16)
 - cmdln = (cmdln..argument)
 - write(">"..cmdln)
 - end
 - end
 - term.setCursorPos(1,16)
 - write(" ")
 - end
 - function interfaceupdate()
 - topui()
 - bottomui()
 - if preselx == 1 then prpsx = 1
 - elseif preselx == 2 then prpsx = 11
 - elseif preselx == 3 then prpsx = 21
 - elseif preselx == 4 then prpsx = 31
 - elseif preselx == 5 then prpsx = 41
 - end
 - prpsy = (presely*3)
 - printtileborders(prpsx,prpsy)
 - if curselx == 1 then prselx = 1
 - elseif curselx == 2 then prselx = 11
 - elseif curselx == 3 then prselx = 21
 - elseif curselx == 4 then prselx = 31
 - elseif curselx == 5 then prselx = 41
 - end
 - prsely = (cursely*3)
 - printtilebordersselected(prselx,prsely)
 - preselx = curselx
 - presely = cursely
 - end
 - function fullrefresh()
 - curselx = 1
 - cursely = 1
 - basescreen()
 - showstuff()
 - getcurselthing()
 - end
 - ini()
 - basescreen()
 - showstuff()
 - getcurselthing()
 - while true do
 - interfaceupdate()
 - if curtabloc == 1
 - then
 - interfacebrowser()
 - getcurselthing()
 - end
 - if curtabloc == 2
 - then
 - commandline()
 - end
 - end
 - ]])
 - file:close()
 - end
 - function createhelpfiles()
 - file = io.open("/CookieSystem/CS-Help", "w")
 - file:write([[term.clear()
 - term.setCursorPos(1,1)
 - print("===================CookieSystem==================")
 - print("Press tab to change between tab modes.If there is")
 - print("a > before the commandline you're in cmdln mode. ")
 - print("In navigation mode you can move trough the field ")
 - print("with the arrow keys, if there are more than 20 ")
 - print("items you can move trough pages with pageup/down ")
 - print("Use backspace to move up a level and enter to go ")
 - print("in a folder or execute a program. Press home to ")
 - print("return to the main page and delete to delete. ")
 - print("In cmdln mode you can use the following commands:")
 - print("shutdown, help (same as normal), copy, paste, ")
 - print("delete, rename, setlevel and maintenance (admin ")
 - print("only). Commands like delete and copy apply to the")
 - print("currently selected program . ")
 - print("Add .txt to the end of a program to make a text ")
 - print("file. These are opened in edit mode when executed")
 - print("")
 - term.setCursorPos(5,18)
 - write("Press any key to continue")
 - while true do
 - event = os.pullEvent()
 - if event == "key" then break end
 - end
 - term.clear()
 - term.setCursorPos(1,1)
 - ]])
 - file:close()
 - file = io.open("/CookieSystem/CS-Help levels", "w")
 - file:write([[term.clear()
 - term.setCursorPos(1,1)
 - print("===================CookieSystem==================")
 - print("If the computer is used by multiple players then ")
 - print("you might want to set up different accounts and ")
 - print("access levels. The current account level can be ")
 - print("seen in the top left corner. To set a level you ")
 - print("must be able to edit the correct file in the DB ")
 - print("folder. Open it and add the path and name of the ")
 - print("program or go to the program itself and use the ")
 - print("command setlevel use/edit 1/2/3 ")
 - print("To use the command your level needs to be able to")
 - print("edit the right files. So if you want to set a ")
 - print("programs use level to 2, you need to be able to ")
 - print("edit the file CookieSystem/DB/DBlevels/uselevel/2")
 - print("")
 - print("The level system treats program and text files ")
 - print("in the same way, except that you can't execute ")
 - print("text files like programs. ")
 - term.setCursorPos(5,18)
 - write("Press any key to continue")
 - while true do
 - event = os.pullEvent()
 - if event == "key" then break end
 - end
 - term.clear()
 - term.setCursorPos(1,1)
 - ]])
 - file:close()
 - end
 - function createstartup()
 - file = io.open("startup", "w")
 - file:write([[while true do
 - shell.run("/CookieSystem/login")
 - if corlogin then break end
 - end
 - while true do
 - shell.run("/CookieSystem/CS-System/interface")
 - if maintenance then break end
 - end
 - term.clear()
 - term.setCursorPos(1,1)]])
 - file:close()
 - end
 - function install()
 - createfolders()
 - createlevelfiles()
 - createadminaccount()
 - createlogin()
 - createcreate()
 - createdelete()
 - createsetlvl()
 - createchangepass()
 - createinterface()
 - createhelpfiles()
 - createstartup()
 - end
 - function topthing()
 - term.clear()
 - term.setCursorPos(13,2)
 - write("========================")
 - term.setCursorPos(13,3)
 - write("|CookieSystem Installer|")
 - term.setCursorPos(13,4)
 - write("========================")
 - end
 - topthing()
 - term.setCursorPos(1,5)
 - print("Do you want to install CS V1 on your computer?")
 - answer = read()
 - if answer == "yes"
 - then
 - install()
 - else
 - term.setCursorPos(15,8)
 - print("Installation aborted.")
 - end
 
Advertisement
 
                    Add Comment                
                
                        Please, Sign In to add comment