This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Waitdev_'s profile picture

getting character at specific location

Started by Waitdev_, 01 November 2015 - 12:03 AM
Waitdev_ #1
Posted 01 November 2015 - 01:03 AM
all it is saying, is just a function to get a character at a location.
example:

term.getCharacter(x,y)
if there is no character there, it will return nil or " "
this is just to make it easier to get a character for something like taking screenshots
Bomb Bloke #2
Posted 01 November 2015 - 02:18 AM
The "simple" way for you to get yourself this is to make a copy of the window API's code, and then just add the function into the window-defining section:

    function window.getCharacter( x, y )
        local tLine = tLines[ y ]
        return tLine.text:sub(x, x), tLine.textColor:sub(x, x), tLine.backgroundColor:sub(x, x)
    end