Advertisement
minimite

zi.zsf

Jun 4th, 2015
302
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.91 KB | None | 0 0
  1. ---Self-Extracting Zippy Archive---
  2. --File generated with Atenefyr's ZSF--
  3. --v1.2--
  4. local file = [============[zippy1testprint("foo")    
  5. print("bar")     ]============]
  6. --[=[
  7. The MIT License (MIT)
  8.  
  9. Copyright (c) 2015 Shefla
  10.  
  11. Permission is hereby granted, free of charge, to any person obtaining a copy
  12. of this software and associated documentation files (the "Software"), to deal
  13. in the Software without restriction, including without limitation the rights
  14. to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  15. copies of the Software, and to permit persons to whom the Software is
  16. furnished to do so, subject to the following conditions:
  17.  
  18. The above copyright notice and this permission notice shall be included in
  19. all copies or substantial portions of the Software.
  20.  
  21. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  22. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  23. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  24. AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  25. LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  26. OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  27. THE SOFTWARE.
  28. ]=]
  29. --Load Zippy API--
  30. local dl = false
  31. function load()
  32.         if fs.exists("zippy") then
  33.         os.loadAPI("zippy")
  34.                 return true
  35.         end
  36.         local txt = http.get("http://pastebin.com/raw.php?i=23QEETmW").readAll()
  37.         local open = fs.open("zippy", "w")
  38.         open.write(txt)
  39.         open.close()
  40.         os.loadAPI("zippy")
  41.         dl = true
  42.         return true
  43. end
  44. load()
  45. --Save file--
  46. local open = fs.open(".archive", "w")
  47. open.write(file)
  48. open.close()
  49. --Extract file--
  50. extract(".archive", "/")
  51. --Delete file--
  52. fs.delete(".archive")
  53. --Delete API if downloaded--
  54. if dl then
  55.   fs.delete("zippy")
  56. end
  57. --Exit program--
  58. print("Done extracting!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement