Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function mirror(redir)
- redir=redir or term.current()
- mirror = {
- write = function(str)
- str=tostring(str)
- local w,h=redir.getSize()
- local x,y=redir.getCursorPos()
- redir.setCursorPos(x-#str+1,y)
- redir.write(str:reverse())
- redir.setCursorPos(x-#str,y)
- end,
- getCursorPos = function()
- local x,y=redir.getCursorPos()
- local w,h=redir.getSize()
- return w-x+1,y
- end,
- setCursorPos = function(x,y)
- local w,h=redir.getSize()
- redir.setCursorPos(w-x+1,y)
- end,
- }
- for k,v in pairs(redir) do
- if mirror[k]==nil then
- mirror[k]=v
- end
- end
- return mirror
- end
- local prev=term.redirect(mirror())
- term.clear()
- term.setCursorPos(1,1)
- shell.run("shell")
- term.redirect(prev)
- term.clear()
- term.setCursorPos(1,1)
Advertisement
Add Comment
Please, Sign In to add comment