SRL Archive - SRL Suggestions

possible uptext change


m34tcode

2012-04-08 02:11:54

If there is a white object behind the RS Uptext area, it will screw up the ocr. So, instead of spending all that hard work figuring out what it says, why not just test whether it says what your looking for and move on?

If you are testing against a single uptext it should be faster than Rs_GetUpText, and hopefully more accurate. The shadows behind the chars should prevent false positives.

Simba Code:
[LEFT]function UpTextMatches(Text : string) : Boolean;
var
TP : TPoint;
begin
Result := FindText(TP.x,TP.y,Text,UpChars,0,0,MSX1+300,MSY1+30);
end;
[/LEFT]

Coh3n

2012-04-08 22:23:43

Does that actually work when the OCR doesn't? Can you give a location as an example? I'd like to try it out if it does work.

m34tcode

2012-04-08 22:26:23

Ahh i don't remember the location I was having up text problems, that prompted me to create this >.>

Maybe it was the rune essence? I'll check that out

Coh3n

2012-04-08 22:28:12

Please, let me know. The uptext has been a frustrating issue for a while.

m34tcode

2012-04-08 22:29:43

In theory, this should work perfectly. But then should'nt everything?

Coh3n

2012-04-08 22:33:07

In that case, I would need someone to lend me a member's account, and tell me where the entrance to GWD is. :p

m34tcode

2012-04-08 22:34:24

aha demise you are prob right. Ill head down there now =]

And cohen if you ever do need a members account to test anything, ill lend mine as long as needed.

Coh3n

2012-04-08 22:38:58

Good to know, thanks.

m34tcode

2012-04-08 23:11:51

[Hint] D:\Simba\Includes\SRL/SRL/core/mapwalk.simba(1353:3): Variable 'BOX' never used at line 1352
Compiled successfully in 2671 ms.
False
Walk here ? . < -
False
Walk here ? . < -
False
Walk here ? . < -
False
Walk here ? . < -
False
Walk here ? . I - -
False
Walk here ? . I - -
False
Walk here ? . I - -
False
l -. z --. - ? = = _-- s -z ? -Ps z S -
False
l -. z --. - ? = = _-- s -z ? -Ps z S -
False
l -. z --. - ? = = _-- s -z ? -Ps z S -
True
Walk here l -. z --. - ? = = _-- s -z ? -Ps z S -
False
? . I - .
False
? . I - -
True
Walk here ? . I - -
True
Walk here ? . I - -
True
Walk here ? . I - -
True
Walk here ? . I - -
True
Walk here ? . I - -
True
Walk here / 1 hore options - -
True
Walk here / 1 hore options - -
True
Walk here / 2 hore options - -
True
Walk here / 2 hore options - -
True
Walk here / 1 hore o^ions r -
True
Walk here ! . \ I r -
False
Climb-down Ho^ / 2 mre options r -
True
Walk here ! . \ I r -
True
Walk here ! . \ I r -
True
Walk here ! . \ I . -
True
Walk here / 4 hore o^ions r -
True
Walk here / 1 hore o^ions r -
True
Walk here ! . \ I r -
True
Walk here ! . \ I r -
True
Walk here ! . \ I r -
False
l -. z --. - ? = = _-- s -z ? -Ps z S -
False
l -. z --. - ? = = _-- s -z ? -Ps z S -
False
Click . -. z --. - ? = = _-- s -z ? -Ps z S -
True
Walk here l -. z --. - ? = = _-- s -z ? -Ps z S -
False
Climb-down Hole / 2 more options -
False
Climb-down Hole / 2 more options -
False
Climb-down Hole / 2 more options -
False
Climb-down Hole / 2 more options -
True
Walk here ? . I -
True
Walk here ? . I -
True
Walk here ? . I -
True
Walk here ? . I .
True
Walk here ? . I -
True
Walk here / 2 ^re options -
True
Walk here / 2 ^re options - -
True
Walk here / 2 ^re options - -
False
? . < - -
False
? . < - -
True
Walk here ? . < - -
True
Walk here ? . < - -
True
Walk here ? . < - -
False
Add friend Lia^./ 2 more options - -
False
? . < - -
False
? . < - -
False
? . < - -
True
Walk here ? . < - -
True
Walk here ? . < - -
True
Walk here ? . < - -
False
Climb-down Ho^./ 2 more options - -
False
Climb-down Ho^./ 2 more options - -
True
Walk here ? . < - -
True
Walk here ? . < - -
True
Walk here / 1 hore o^ions< - -
True
Walk here ? . < - -
True
Walk here / 1 hore o^ions< - -
True
Walk here ? . < - -
False
? . < - -
False
? . < - -
True
Walk here ? . < . -
True
Walk here ? . < - -
True
Walk here / 1 hore o^ions< - -
True
Walk here ? . < - -
True
Walk here / 2 hore o^ions< - -
False
Worn Equipmeh. < -
True
Walk here ? . < - -
True
Walk here ? . < - -
False
Select left-clibk option < -
False
Drink dPPer rescoreflas yt / 3 more options -
False
Drink Sup. r r^?tc.re .!a / 3 more options
False
Praye List ^
False
. .
False
AcHvate .
False
Activa^e (
False
.
False
Walk here
False
Walk here
False
Walk here
False
Walk here
False

False
Walk here / 2 more options
False

False

False
Walk here
False
Walk here
False
Walk here
False
Walk here
False
Walk here
False
Walk here
False
Walk here
False
Walk here
False
Quest Journals
False
S le ect left-click option
False
Turn run mode off / 1 more options
False
World Map
False
Toggle money pouch / 3 more options
False
Lift Boulder / 3 more options
False
Walk here
False
Lift Boulder / 3 more options
False
Lift Boulder / 3 more options
False
Lift Boulder / 3 more options
False
Lift Boulder / 3 more options
False
Lift Boulder / 3 more options
False
Lift Boulder / 3 more options
False
Lift Boulder / 3 more options
False

False

False
Activate
False
Walk here
False
Walk here
False
Lift Boulder / 3 more options
False
Lift Boulder / 3 more options
False
Lift Boulder / 3 more options
False
Lift Boulder / 3 more options
False
Lift Boulder / 3 more options
False
Lift Boulder / 3 more options
False
Lift Boulder / 3 more options
True
Walk here
True
Walk here
True
Walk here
False
Lift Boulder / 3 more options
False
Lift Boulder / 3 more options
False
Stats
False

False
Activate
False
Activate
False
Activate
False
Activate
False
Activate
False
Activate
False
Activate
False
Activate
True
Walk here
True
W la k here
True
Walk here
True
Walk here
False
-. z --. - ? = = _-- s -z ? -Ps z S -
False
-. z --. - ? = = _-- s -z ? -Ps z S -
Successfully executed.

My log for this script :

{$i srl/srl.simba}
function UpTextMatches(Text : string) : Boolean;
var
TP : TPoint;
begin
Result := FindText(TP.x,TP.y,Text,UpChars_s,0,0,MSX1+300,MSY1+30);
end;


begin
repeat
wait(500);
writeln(UpTextMatches('alk'));
writeln(rs_GetUpText);
until false;
end.

The beginning of the log shows that it messed up somehow. Once i moved the mouse away, and back it worked perfect though. I couldn't get it to fail, even when rs_getuptext did. Excluding that very first few lines.

So maybe expand on the initial idea with this?
function UpTextMatches(Text : string) : Boolean;
var
TP : TPoint;
begin
Result := FindText(TP.x,TP.y,Text,UpChars,0,0,MSX1+300,MSY1+30)
OR FindText(TP.x,TP.y,Text,UpChars_s,0,0,MSX1+300,MSY1+30)
OR FindText(TP.x,TP.y,Text,UpCharsEx,0,0,MSX1+300,MSY1+30)
OR pos(Text,rs_GetUpText) >= 0;
end;
I added all the uptext font because im not positive what the difference in usage is