Log in

View Full Version : Am I using this right?



John
06-11-2012, 06:48 AM
I trying to find This:
http://puu.sh/AaQr

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
06-11-2012, 07:59 AM
Try GetTextAtExWrap

Main
06-11-2012, 08:27 AM
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
06-11-2012, 03:48 PM
FindTextAtExWrap doesn't work here, just saying, all the fonts are wrong for it, tried everyone, got nothing correct.

Fascinate
06-11-2012, 03:50 PM
I would go with Main's idea i've never thought of that way!