Advertisement
Pinkishu

rrdl

Aug 12th, 2012
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.69 KB | None | 0 0
  1. local f = "http://dl.dropbox.com/u/18783800/rr.out"
  2. local url = f
  3. fName = "rr.out"
  4. onF = http.get(url)
  5. --file = fs.open("test","w")
  6.  
  7. test = onF.readAll()
  8. --file.write(test)
  9. --file.close()
  10. onF.close()
  11.  
  12. print("Len:"..string.len(test))
  13.  
  14. index = 1
  15. file = fs.open(fName,"wb")
  16. local t = os.clock()
  17. while true do
  18.   if test:byte(index) == 239 or test:byte(index) == 189 then
  19.    
  20.     test = test:sub(0,index-1)..test:sub(index+1)
  21.     index = index - 1
  22.   else
  23.     file.write(test:byte(index))
  24.   end
  25.   index = index + 1
  26.   if index > string.len(test) then
  27.     break
  28.   end
  29.   if os.clock() -t >= 4 then
  30.     sleep(.05)
  31.     t = os.clock()
  32.   end
  33.   print(index)
  34. end
  35. file.close()
  36.  
  37.  
  38.  
  39.  
  40. print("done")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement