34 posts
Posted 26 February 2013 - 10:09 AM
is there a way to say scan the screen and if line 4 says this then
288 posts
Location
The trashcan where all Undertale trash is
Posted 26 February 2013 - 10:11 AM
Two things: No, and this is the wrong section. This should be in Ask a Pro.
309 posts
Location
Sliding between sunbeams
Posted 27 February 2013 - 03:16 AM
it is possible if you store everything that is being printed in a table. Then you can look into that table what is being written where. It can be done for each character on every coordinate, or for each line. Just be creative with it, if you cant get it to work, there are some API's out there that make this possible for you
131 posts
Location
I am omnipresent... DUH
Posted 27 February 2013 - 08:53 AM
screen = {}
w, h = term.getSize()
for i = 1, w do
screen[i] = {}
end
oldWrite = term.write
function term.write(s)
s = string.gmatch(s, ".")
local x, y = term.getCursorPos()
for i = 0, #s-1 do
screen[x+i][y] = s[i+1]
end
end
function print(s)
term.write(s)
x, y = term.getCursorPos()
term.setCursorPos(1, y+1)
end
That should record the whole screen to a table, to see the character at x,y do screen[x][y]