Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- b={}
- l=1
- function ctr() s=syscall.execute("stdin_read") return s end
- function p(d) syscall.execute("stdout_write",d) end
- while true do
- c=ctr()
- if c=="l" then for k,v in pairs(b) do p(v) end
- elseif c=="lc" then p(tostring(b[l]).."\n")
- elseif c=="s" then p">" l=tonumber(ctr())
- elseif c=="so" then p(l)
- elseif c=="a" then p":" c=ctr() repeat table.insert(b,l,c) l=l+1 c=ctr() until c=="."
- elseif c=="r" then p":" b[l]=ctr()
- elseif c=="d" then p(table.remove(b,l))
- elseif c=="o" then p">" rF=ctr() f=syscall.execute("fs_open",rF,"r") a="" repeat c=syscall.execute("fs_read",f) if c==nil then c="" end a=a..c until c=="" syscall.execute("fs_close",f) for L in a:gmatch("[^\r\n]+") do table.insert(b,l,L) l=l+1 end
- elseif c=="w" then p">" wT=ctr() f=syscall.execute("fs_open",wT,"w") for k,v in pairs(b) do syscall.execute("fs_write",f,v.."\n") end syscall.execute("fs_close",f)
- elseif c=="e" then cd="" for k,v in pairs(b) do cd=cd..v.."\n" end pcall(load(cd))
- elseif c=="q" then break else p"?" end end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement