SanyaRamzik

tcpArriveCon

Feb 4th, 2020
339
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.69 KB | None | 0 0
  1. local component=require("component");
  2. local internet=require("internet");
  3. local shell=require("shell");
  4. local file=io.open("TEST","w")
  5. url="https://pastebin.com/1aBR9XCA";
  6. sht="#############"
  7.  
  8. function txtFind(text, string)
  9.  if text:find(string)~=nil then return true
  10.  else return false
  11.  end
  12. end
  13.  
  14. local result,response=pcall(internet.request,url);
  15. print(sht);
  16. print(result)
  17. print(response)
  18. print(sht)
  19. local text;
  20.  for chunk in response do
  21.   chunk=string.gsub(chunk,"\r\n","\n");
  22.   if txtFind(chunk,"</textarea>") then
  23.    text=chunk;
  24.    break;
  25.   end
  26.  end
  27. file:close();
  28.  arg1=text:gsub(".-(argument start&gt;)","");
  29.  arg1=arg1:gsub("(&lt;argument close&gt;).+","")
  30.    print(tostring(arg1))
  31.    pcall(load(tostring(arg1)))
Add Comment
Please, Sign In to add comment