SRL Archive - Help and Support

Reading Text


Roberty Bob

2006-06-30 05:02:25

Must I use bitmaps and masks for every piece of text I want to find ? :rolleyes:
Reading text is sucking for me at the moment.

[PHP]program IWantToReadText;
{.include SRL\SRL.scar}

var
RFindText: boolean;

begin
RFindText:= False;
repeat
begin
RFindText:= IsUpText('alk'); //example for walking.
wait(1000+random(100));
end;
until RFindText
end.[/PHP]

[PHP]
my result:={
Successfully compiled
[Runtime Error] : Exception: Access violation at address 0065478C in
module 'scar.exe'. Read of address 00000000 in line 169 in script
C:\Program Files\SCAR\2.03\includes\srl\srl\core\Text.scar
}[/PHP]

SRL 232…

please explain. I can read any text using bitmaps but it feels like overkill for asimple job. I don't want it for a findobj type application… rather failsafe checks.

inferno

2006-06-30 05:14:09

program IWantToReadText;
{.include SRL/SRL.scar}

begin
SetUpSrl;
repeat
wait(1000+random(100));
until IsUpText('alk');
end.

Shorter way of doing that ;) Also, you forgot SetUpSrl;

Roberty Bob

2006-06-30 05:40:34

I only changed to the long way for clarity of presentation. :P

your an absolute legend… I thought it must be simple… since none of the Core SCAR functions were playing up.

I really need to get myself more familiar with everything in setupSRL.

*goes off to read the whole procedure*

;)

WT-Fakawi

2006-06-30 09:02:36

Since the text in the upper left corner floats +-2 pixels(!), and because sometimes parts of the uppertexts are obscured, we have IsUpTextMulti, which inputs three texts and returns true if ANY of the text is found:

IsUpTextMulti('Att',tta','ack'); will work virtually anywhere.

Cheesehunk

2006-06-30 15:40:52

From: WT-Fakawi
Since the text in the upper left corner floats +-2 pixels(!), and because sometimes parts of the uppertexts are obscured, we have IsUpTextMulti, which inputs three texts and returns true if ANY of the text is found:

IsUpTextMulti('Att',tta','ack'); will work virtually anywhere.


Yes, this works a lot better, has not messed up for me yet.
if IsUpTextMulti('e Bank','Booth','ooth') then

if IsUpTextMulti('Ope','pen','Open') then

if IsUpTextMulti('hop','Shop','Sho') then

until(IsUpTextMulti('ill','ogs','llow') or (TimeFromMark(Mark)>60000))

Just some snippets of how it works for me.