Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[ TODO`s
- Get Officialmode to work
- ]]--
- shell.run("clear")
- print("SKIPP3Rs S3RV3R B00TM3NU")
- os.pullEvent=os.pullEventRaw
- print("Establishing Rednetconnection...")
- print("checking for existing config...")
- x=fs.exists("serverstuff/rsetting") --may be a problrm here with /
- if x==true then
- redn=rednet.isOpen()
- h=fs.open("serverstuff/rsetting", "r")
- rednat=h.readAll()
- print("if u can read this call the support or the lazy coder")
- rednet.open(rednat)
- h.close()
- shell.run("clear")
- print("SKIPP3Rs S3RV3R B00TM3NU")
- print("Established")
- else
- write("Where is your Modem?: ")
- mod=read()
- rednet.open(mod)
- h=fs.open("serverstuff/rsetting", "w")
- h.write(mod)
- h.close()
- end
- --rednet should be here established
- --going to look if it is first use
- x=fs.exists("serverstuff/Password")
- if x==false then
- print("First Setup please fill in all of it and remember it!")
- pw=0;pw1=1
- while pw1~=pw do
- write("Password: ") --think of a way to atleast cover the pw(maybe 100 dir and in one rdm )there is the pw
- pw=read()
- write("Retype Password: ")
- pw1=read()
- shell.run("clear")
- print("SKIPP3Rs B00TM3NU")
- end
- repeat
- write("Official (o)/Unofficial (u)")
- offic=read()
- if offic=="o" then
- lekey=1
- else if offic=="u" then
- lekey=1
- else
- lekey=0
- end
- end
- until lekey==1
- if offic=="o" then
- write("Preferred Domaimname: ")
- dmnm=read()
- resid=rednet.lookup("Resolver","Resolver")
- else
- end
- --insecure!!!!
- h= fs.open("serverstuff/Password", "w")
- h.write(pw)
- h.close()
- h=fs.open("serverstuff/OfficialLVL", "w")
- if offic=="o" then
- h.write("official")
- h.close()
- h=fs.open("serverstuff/ResolverID", "w")
- h.write(resid)
- h.close()
- h= fs.open("serverstuff/PrefDom", "w")
- h.write(dmnm)
- h.close()
- else if offic=="u" then
- h.write("unofficial")
- h.close()
- end
- end
- --damn girl that was "special"
- shell.run("clear")
- print("SKIPP3Rs Bootmenu")
- if offic=="o" then
- rednet.host("Server",dmnm)
- rednet.send(resid,"9aa1b03934893d7134a660af4204f2a9")
- sleep(0.05)
- rednet.send(resid,dmnm)
- sleep(3)
- else
- end
- os.reboot()
- else
- shell.run("clear")
- print("SKIPP3Rs S3RV3R")
- h=fs.open("serverstuff/Password", "r")
- Pw=h.readAll()
- h.close()
- h=fs.open("serverstuff/OfficialLVL", "r")
- Offic=h.readAll()
- h.close()
- index=fs.open("serverstuff/sides/index", "a")
- if Offic=="official" then
- h=fs.open("serverstuff/ResolverID", "r")
- Resolver=h.readAll()
- h.close()
- h=fs.open("serverstuff/PrefDom", "r")
- PrefDom=h.readAll()
- h.close()
- else
- end
- end
- eing=0
- while eing~=Pw do
- write("Password: ")
- eing=read("*")
- print("Wrong")
- end
- shell.run("clear")
- print("SKIPP3Rs S3RV3R v0.2")
- print("Type 'help' for a list of commands")
- repeat
- write(":> ")
- com=read()
- if com=="new" then
- indexnam="index"
- while indexnam=="index"do
- write("indexed y/n: ")
- inde=read()
- if inde=="y" then
- write("Name the side: ")
- indexnam=read()
- index.writeLine(indexnam)
- index.flush()
- else
- write("Name of the side: ")
- indexnam=read()
- end
- end
- a=1
- side="serverstuff/sides/"..indexnam
- shell.run("clear")
- print("SKIPP3Rs S3RV3R")
- sid=fs.open(side, "w")
- while a~=18 do --look how many lines the hold
- write("")
- infsi=read()
- sid.writeLine(infsi)
- sid.flush()
- a=a+1
- end
- shell.run("clear")
- print("SKIPP3Rs server")
- print("File Saved")
- sid.close()
- else
- if com=="display" then
- write("Name of the side u want to display: ")
- file=read()
- file="serverstuff/sides/"..file
- fil=fs.open(file, "r")
- inhalt=fil.readAll()
- print(inhalt)
- fil.close()
- else
- if com=="list" then
- local FileList = fs.list("serverstuff/sides/")
- for _, file in ipairs(FileList) do
- print(file)
- end
- else
- if com=="delete" then
- write("Name the side u want to delete: ")
- file=read()
- if file~="index" then
- file="rm serverstuff/sides/"..file
- shell.run(file) --watcha here
- end
- else
- if com=="reboot" then
- os.reboot()
- else
- if com=="shutdown" then
- os.shutdown()
- else
- if com=="run" then
- write("rly want to set this online? y/n: ")
- yn=read()
- if yn=="y" then
- onlinekey=1
- else
- end
- else
- print("Commands: help, new, delete, display, list, reboot, shutdown, run")
- end
- end
- end
- end
- end
- end
- end
- until onlinekey==1
- logs=fs.open("serverstuff/log", "a")
- eing=0
- shell.run("clear")
- while eing~=Pw do
- write("Password: ")
- eing=read("*")
- end
- if Offic=="official" then
- rednet.host("Server",PrefDom)
- else
- end
- shell.run("clear")
- repeat
- id,msg=rednet.receive()
- local time = os.time()
- local tima = textutils.formatTime(time, true)
- logs.writeLine(tima..": "..id..": "..msg)
- print(tima..": "..id..": "..msg)
- logs.flush()
- stbr="serverstuff/sides/"..msg --side to be requested
- x=fs.exists(stbr)
- if x == true then
- h=fs.open(stbr, "r")
- req=h.readAll()
- h.close()
- sleep(0.05)
- rednet.send(id,req)
- else
- rednet.send(id,"This Page doesnt exists!")
- end
- until onlinekey==1337
Advertisement
Add Comment
Please, Sign In to add comment