Posted 06 August 2012 - 07:43 PM
Watermark v 1.0 - Make an always-visible text on your monitor
About
This little program hacks the term API and adds some code to print a Watermark text on top of the screen.
Also it tricks the running programs, by telling them the monitor is one-line smaller, so that all programs run normally, and no text is overwritten by the watermark.
Screenshot
Playing worm after watermark was activated
Instructions
1. Simply save this program as 'mark'
Now run the program ONCE, and the text appears The effect stays until you reboot the computer.
2. You can also give the program the name 'startup', for automatic startup.
Code
Configuration
To change the text:
1. Use the API: type 'lua' and then 'setWaterMark("New Text")'
2. Hard-code it. Edit the last line of the program.
License
1. I am not responsible for damage
2. Don't remove the license when sharing
3. please give me credit if you share it :P/>/>
About
This little program hacks the term API and adds some code to print a Watermark text on top of the screen.
Also it tricks the running programs, by telling them the monitor is one-line smaller, so that all programs run normally, and no text is overwritten by the watermark.
Screenshot
Playing worm after watermark was activated
Instructions
1. Simply save this program as 'mark'
Now run the program ONCE, and the text appears The effect stays until you reboot the computer.
2. You can also give the program the name 'startup', for automatic startup.
Code
Spoiler
function waterUpdate()
waterx,watery=watero.getCursorPos()
watero.setCursorPos(1,1)
watero.clearLine()
term.write(watertext)
watero.setCursorPos(waterx,watery)
end
function setWaterMark(text)
watertext=text
waterUpdate()
end
watero = {}
watero.getCursorPos = term.getCursorPos
term.getCursorPos = function()
waterx,watery=watero.getCursorPos()
return waterx,watery-1
end
watero.setCursorPos = term.setCursorPos
term.setCursorPos = function(waterx,watery)
watero.setCursorPos(waterx,watery+1)
end
watero.getSize = term.getSize
term.getSize = function()
waterx,watery=watero.getSize()
return waterx,watery-1
end
watero.clear = term.clear
term.clear = function()
watero.clear()
waterUpdate()
end
watero.clearLine = term.clearLine
term.clearLine = function()
watero.clearLine()
waterUpdate()
end
watero.scroll = term.scroll
term.scroll = function(watern)
watero.scroll(watern)
waterUpdate()
end
setWaterMark("[ Place some cool text here! ]")
Configuration
To change the text:
1. Use the API: type 'lua' and then 'setWaterMark("New Text")'
2. Hard-code it. Edit the last line of the program.
License
1. I am not responsible for damage
2. Don't remove the license when sharing
3. please give me credit if you share it :P/>/>