Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- hookFuncs.write = function(str)
- local screen = getActiveScreen()
- log("Writeing /"..str.."/ on /"..screen.screenName.."/")
- local wLine = screen.screenData[screen.cursorPosY]
- local sX = screen.cursorPosX
- local pre = ""
- if sX > 1 then
- pre = string.sub(wLine,1,sX-1)
- end
- local post = ""
- sX = screen.cursorPosX + string.len(str)
- if sX <= screenSizeX then
- post = string.sub(wLine,sX)
- end
- local newLine = string.sub(pre..str..post,1,screenSizeX)
- screen.screenData[screen.cursorPosY] = newLine
- if getDisplayScreen().screenName == screen.screenName then
- screen:redraw(screen.cursorPosX,screen.cursorPosY,string.len(str),1)
- end
- screen.cursorPosX = math.min(screen.cursorPosX + string.len(str),screenSizeX)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement