Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- m = peripheral.wrap("back")
- m.open(51)
- local function pulse(side)
- rs.setOutput(side, true)
- sleep(3)
- rs.setOutput(side,false)
- end
- Tr = true
- function os.pullEvent()
- local event, p1,p2,p3,p4,p5 = os.pullEventRaw()
- if event == "terminate" then write("For terminate need password:")
- p = read()
- if p == "ex" then
- Tr = false
- print("exiting")
- end
- end
- return event,p1,p2,p3,p4,p5
- end
- function Add(Name)
- Fold = "Assets/"
- RC = Fold .. Name
- fs.makeDir("Assets")
- Name = tostring(Name)
- if fs.exists(Name) then
- return false
- else
- f = fs.open(Name,"w")
- f.close()
- return true
- end
- end
- function Rm(Name)
- inp = "Assets/" .. Name
- if fs.exists(inp) then
- fs.delete(inp)
- return true
- else
- return false
- end
- end
- while Tr do
- Recive = {"","",""}
- Recive[1],Recive[2],Recive[3],Recive[4],Recive[5] = os.pullEvent()
- for i=1,#Recive do
- print(Recive[i])
- end
- pL = fs.list("Assets")
- if Recive[1] == "player" or "modem_message" then
- if Recive[1] == "modem_message" then
- for k,v in string.gmatch(Recive[5], "(%w+)=(%w+)") do
- if k == "rOpen" then
- pulse("right")
- elseif k == "add" then
- Add(v)
- elseif k == "rm" then
- Rm(v)
- end
- end
- elseif Recive[1] == "player" then
- for i =1 , 10 ,1 do
- if Recive[3] == pL[i] then
- pulse("right")
- end
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment