SRL Archive - Help

Am I using this right?


John

2012-06-11 02:48:54

I trying to find This:

via this code:
Function InGame: Boolean;
var
x, y: integer;
begin
if FindTextTPAEx(2070783, 20, MSX1, MSY2, MSX2, MSY2, x, y, 'ew', 'e', Nothing) then
begin
WriteLn('We Arent in Game')
WriteLn('X = ' + IntToStr(x) + '' + 'Y = ' + IntToStr(y) + '');
end else
WriteLn('We Are in a game');
WriteLn('X = ' + IntToStr(x) + ' ' + 'Y = ' + IntToStr(y) + '');
end;
I cant seem to get it to work.

Brandon

2012-06-11 03:59:27

Try GetTextAtExWrap

Main

2012-06-11 04:27:20

you don't need to find the text. As you know the words "New game" is always present when you are in the waiting area. And they have a certain length of that color.

So If you know the area where the texts are present you just do

If FindColorsTolerance( X, Y, TPA, TextCol, TextStartX, TextStartY, TextEndX, TextEndY, TextTol) Then
If Length( TPA) > LengthOfNewGameText Then
InGame := True;


This way avoids jagex's uptext font update and will keep your script working :) also it should be more accurate as the find text and ocr isn't 100% (its like 99%)

NKN

2012-06-11 11:48:06

FindTextAtExWrap doesn't work here, just saying, all the fonts are wrong for it, tried everyone, got nothing correct.

Fascinate

2012-06-11 11:50:31

I would go with Main's idea i've never thought of that way!