Advertisement
LDDestroier

CC blacklist

Apr 11th, 2017
250
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.47 KB | None | 0 0
  1. local youNoToushDese = { -- ze absolut paths of la files that the knights who say ni must never access
  2.     "startup",
  3. }
  4.  
  5. local _fs = {}
  6. for k,v in pairs(fs) do
  7.     _fs[k] = v
  8. end
  9.  
  10. local notgood = function() --in case of any need of change
  11.     error("access denied")
  12. end
  13.  
  14. local search = function(tbl,str)
  15.     str = fs.combine("",str)
  16.     for k,v in pairs(tbl) do
  17.         if v == str then
  18.             return k, v
  19.         end
  20.     end
  21.     return false
  22. end
  23.  
  24. fs.isReadOnly = function(path)
  25.     if search(youNoToushDese,path) then
  26.         return true
  27.     else
  28.         return _fs.isReadOnly(path)
  29.     end
  30. end
  31. fs.getSize = function(path)
  32.     if search(youNoToushDese,path) then
  33.         return 0
  34.     else
  35.         return _fs.getSize(path)
  36.     end
  37. end
  38. fs.makeDir = function(path)
  39.     if search(youNoToushDese,path) then
  40.         notgood()
  41.     else
  42.         return _fs.makeDir(path)
  43.     end
  44. end
  45. fs.move = function(fromPath,toPath)
  46.     if search(youNoToushDese,fromPath) or search(youNoToushDese,toPath) then
  47.         notgood()
  48.     else
  49.         return _fs.move(fromPath,toPath)
  50.     end
  51. end
  52. fs.copy = function(fromPath,toPath)
  53.     if search(youNoToushDese,fromPath) or search(youNoToushDese,toPath) then
  54.         notgood()
  55.     else
  56.         return _fs.copy(fromPath,toPath)
  57.     end
  58. end
  59. fs.delete = function(path)
  60.     if search(youNoToushDese,path) then
  61.         notgood()
  62.     else
  63.         return _fs.delete(path)
  64.     end
  65. end
  66. fs.open = function(path,mode)
  67.     if search(youNoToushDese,path) then
  68.         notgood()
  69.     else
  70.         return _fs.open(path,mode)
  71.     end
  72. end
  73.  
  74. _G.fs = fs
  75. if fs.exists("userstartup") then
  76.     shell.run("userstartup")
  77. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement