SRL Archive - OSR Help

Uptext issue


jelknab

2013-05-05 10:59:21

Hi,

I am working on a custom system which clicks a fishspot. I got the detection working, but it seems to be unable to recognzie the uptext altrough the contrast with the background is quite ok.

I used findObjMulti() before this, which uses the same kind of uptext checking without a problem.


function SeekFishingSpot(var x, y : integer) : boolean;
var
ColToldSpeed, I : integer;
TPA : TpointArray;
ATPA : T2DPointArray;
begin
ColToldSpeed := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(1.3, 1.49);

FindColorsSpiralTolerance(MSCX, MSCY, TPA, 15056587, MSX1, MSY1, MSX2, MSY2, 12);
ATPA := TPAtoATPAEx(TPA, 25, 25);

for I:=Low(ATPA) to High(ATPA) do
begin
MMouse(MiddleTPA(ATPA[I]).X, MiddleTPA(ATPA[I]).Y, 10, 10);
WaitCustom(false);
WriteLn(GetUpText + ' | ' + rs_GetUpText + ' | ' + P07_GetUpText );

if WaitUptext(ToolName, RandomRange(500, 750)) then
begin

WaitCustom(false);
ClickMouse2(Mouse_right);
WaitCustom(false);

if ChooseOption(OptionName) then
begin
Result := true;
exit;
end else
begin
WriteLn('This spot does not support our fishing method :L.')
end;
end;
end;
end;

When debugging the uptext, i either get nothing or gibberish.

I hope someone could help me with this,
Thanks in advance.

Ian

2013-05-05 11:36:32

If uptext really isn't working you can use CountColor to check the uptext.

First get the coordinates of the box around the text you're looking for, make sure not to include the more options bit because those numbers could change. Then do a Writeln(CountColor) to get the number of pixels that are that color.

Then use an if statement to check if the number of pixels of that color are the same as the number of pixels of the color of the uptext.

Sorry if that's really confusing, I'm on my phone so I can't do the Simba tags and parameters for CountColor easily :p

jelknab

2013-05-05 12:00:44

Thing is, uptext should work as it works with other commands.

Sjoe

2013-05-05 12:10:53

From: jelknab
Thing is, uptext should work as it works with other commands.


update to simba 993, I think they got proper uptexts.

Haxz

2013-05-05 12:16:27

From: Sjoe
update to simba 993, I think they got proper uptexts.


Still need to edit the getuptext function in simba 993 to have it work properly I guess. There's an extra parameter for the function rs_GetUpTextAtEx on 993.

jelknab

2013-05-05 12:18:34

I use the latest version from wizzup.org

Sjoe

2013-05-05 12:25:00

From: jelknab
I use the latest version from wizzup.org


Ask Justin or another mod for the download link.

jelknab

2013-05-05 12:26:33

It would be a shame to have everyone using my script asking justin for a download. Is there really no other option?

jelknab

2013-05-05 18:09:43

I almost gave up on TPA's when i came across this working solution: http://villavu.com/forum/showthread.php?t=100372 . I spend over 6 hours trying everything i could :L…