Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rednet.open("right")
- function checkTags(toCheck)
- comon = 0
- for i=1,#toCheck do
- for o=1,#tags do
- if tags[o] == toCheck[i] then
- comon = comon + 1
- end
- end
- end
- if comon >= #toCheck then
- return true
- else
- return false
- end
- end
- function checkUpdate()
- local id, local func, local tags, local filename, local filedata = rednet.receive()
- if type(tags) == "table" then
- if checkTags(tags) then
- if func == "Update" then
- file = fs.open(filename, "w")
- file.write(filedata)
- file.close()
- elseif func == "Delete" then
- fs.delete(filename)
- elseif func == "Shutdown" then
- os.shutdown()
- end
- end
- end
- end
- while true do
- checkUpdate()
- end
Advertisement
Add Comment
Please, Sign In to add comment