Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if fs.exists("disk/") then
- if fs.exists("disk/.bal") then
- term.clear()
- else
- shell.run("cp", "startup", "disk/.bal")
- end
- end
- local function script(C, B)
- w = true
- while w do
- print("::::")
- rednet.send(C, "WELCOME ENTER COMMAND OR ?")
- RXID, RX = rednet.receive()
- if RXID == C then
- if B == 0 then
- rednet.send(C, "OUT OF CREDDITS - PLEASE RECONNECT!")
- os.reboot()
- end
- if RX == "?" then
- rednet.send(C, "BAL | IN | OUT | END")
- elseif RX == "BAL" then
- rednet.send(C, B.."creddits")
- elseif RX == "END" then
- rednet.send(C, "Thank you!")
- os.reboot()
- elseif RX == "IN" then
- rednet.send(C, fs.list("disk/")[2])
- if fs.list("disk/")[2] == ".bal" or fs.list("disk/")[2] == "emails" then
- print("")
- else
- fs.delete("disk/"..fs.list("disk/")[2])
- end
- elseif RX == "OUT" then
- rednet.send(C, "TO?")
- z = true
- while z do
- x, y = rednet.receive()
- if x == C then
- TO = y
- rednet.send(C, "MSG?")
- t = true
- while t do
- p, o = rednet.receive()
- if p == C then
- rednet.send(tonumber(TO), "RE")
- sleep(1)
- rednet.send(tonumber(TO), o)
- print(C.."sent"..o.."to"..TO)
- B = B - 25
- rednet.send(C, "DONE")
- t = false
- z = false
- else
- end
- end
- else
- end
- end
- else
- rednet.send(RXID, "SERVER IN USE")
- end
- end
- end
- end
- B = 100
- if fs.exists("disk/.bal") then
- PASS = "A"
- print("STARTING!")
- rednet.open("top")
- rednet.broadcast("I AM ALIVE!")
- print(os.time())
- while true do
- shell.run("id")
- print("READY")
- CLIENT, C_MSG = rednet.receive()
- if C_MSG == "LOGIN" then
- print(CLIENT.." is connecting")
- rednet.send(CLIENT, "PSWD?")
- CLI = false
- w = true
- while w do
- X, Y = rednet.receive()
- if X == CLIENT then
- if PASS == Y then
- print(CLIENT.." : joined")
- w = false
- CLI = true
- script(CLIENT, B)
- print("SCRIPT STOPPED")
- break
- else
- print("Wrong pass")
- rednet.broadcast(CLIENT.."IS BREAKING INTO MY SYSTEM!")
- w = false
- break
- end
- w = false
- break
- end
- end
- elseif C_MSG == "RE" then
- l = true
- while l do
- AA, BB = rednet.receive()
- if AA == CLIENT then
- shell.run("mkdir disk/emails/")
- shell.run("cp", "disk/.bal", BB)
- l = false
- print("RECIVED EMAILS")
- break
- end
- end
- end
- end
- else
- print("insert disk and reboot!")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement