Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function main()
- if fs.exists("users/" .. rp2 .. "/" .. rp3) then
- if fs.exists("users/" .. rp3 .. "/privalege/superuser") then
- print(rp2, " found. sending admin login codes")
- rednet.broadcast(rp1)
- sleep(2)
- rednet.broadcast(rp2)
- sleep(2)
- rednet.broadcast(rp4)
- sleep(2)
- rednet.broadcast("superuser")
- print(rp2, ":", rp4, ":", "superuser:has logged in")
- elseif fs.exists("users/" .. rp2 .. "/" .. rp3) then
- print(rp2, " found. sending norm login codes")
- rednet.broadcast(rp1)
- sleep(2)
- rednet.broadcast(rp2)
- sleep(2)
- rednet.broadcast(rp4)
- sleep(2)
- rednet.broadcast("norm")
- print(rp2, ":", rp4, ":", "norm:has logged in")
- end
- function ashutdown()
- print("shutting down")
- sleep(2)
- os.shutdown()
- end
- print("Starting CraftOs Server Program By Alex_")
- print("which side is the modem?")
- modem=read()
- print("Admin password for session")
- apass=read()
- fs.delete("users/admin")
- fs.makeDir("users/admin")
- fs.makeDir("users/admin/" .. apass)
- fs.makeDir("users/admin/privalege")
- fs.makeDir("users/admin/privalege/superuser")
- print("password set with privalege superuser")
- sleep(1)
- rednet.open(modem)
- term.clear()
- term.setCursorPos(1,1)
- print("Server Started")
- print("Click CTRL For Console")
- print("===============================================")
- while true do
- print("scanning")
- from,rp1=rednet.receive(60)
- sleep(1)
- from,rp2=rednet.receive(60)
- sleep(1)
- from,rp3=rednet.receive(60)
- sleep(1)
- from,rp4=rednet.receive(60)
- sleep(1)
- if rp1=="login" then main()
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment