Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("This should only run once...")
- print("And this twice")
- local fso=fs.open
- local lf=loadfile
- local done=false
- local function chopLines(s,n)
- local w=n
- local res=""
- for i=1,#s do
- if w==0 then res=res..s:sub(i,i) end
- if s:sub(i,i)=="\n" and w>0 then w=w-1 end
- end
- return res
- end
- loadfile=function(f,e)
- local tmp=fs.open
- fs.open=fso
- local res,res2=lf(f,e)
- fs.open=tmp
- return res,res2
- end
- fs.open=function(f,m)
- local file=fso(f,m)
- local fro=file.readAll
- --if done or shell.getRunningProgram()~="test.lua" then return file end
- --done=true
- file.readLine() --skips first line
- file.readAll=function()
- return chopLines(fro(),1) --yes, removing the first line
- end
- return file
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement