SRL Archive - OSR Help

Is my GetUpText wrong?


juunhoad

2013-03-01 15:28:35

Hee,

I was looking at this guide http://villavu.com/forum/showthread.php?t=90767 for TPA's.
And I got this script. The only thing I changed was the uptext, because it's for 07scape. but for some reason it still doesn't work..
It must be the GetUpText, because it can find the flax fine!

program new;
{$i SRL/SRL.simba}
{$I P07Include.Simba}

Procedure FindFlax;
var
tmpCTS, i, x, y, counter, r, l:integer;
FlaxTPA:TPointArray;
begin
tmpCTS := GetToleranceSpeed;

SetColorToleranceSpeed(2);
SetToleranceSpeed2Modifiers(0.13, 1.22);

FindColorsTolerance(FlaxTPA,608516 , MSX1, MSY1, MSX2, MSY2, 10);


SetColorToleranceSpeed(tmpCTS); //RIGHT AFTER we find our colors, we
SetToleranceSpeed2Modifiers(0.02, 0.02); //Change the CTS back.

L := High(FlaxTPA)
marktime(counter);
for i := 0 to L do
begin;
r := random(L);
Wait(RandomRange(60, 200));
mmouse(FlaxTPA[r].x, FlaxTPA[r].y, 2, 2);
if (P07_ContainsText(P07_GetUpText, ['ick', 'lax'] )) then
Break;
if timefrommark(counter) > 3000 then
begin
writeln('We failed to find the flax!');
Terminatescript;
end;
end;
writeln('We found the flax!');
clickmouse2(mouse_right);
end;

begin
SetupSRL;
SetupP07Include;
FindFlax;

end.

Sjoe

2013-03-01 15:30:19

Try P07_isUptextMultiCustom instead :)

juunhoad

2013-03-01 15:35:27

From: Sjoekeloe
Try P07_isUptextMultiCustom instead :)


if P07_isUptextMultiCustom(['ick', 'lax', 'Fla', 'Pic'] ) then 

I did this, but still doesn't work :(

Sjoe

2013-03-01 15:44:50

From: juunhoad
if P07_isUptextMultiCustom(['ick', 'lax', 'Fla', 'Pic'] ) then 

I did this, but still doesn't work :(


Does this kick in? writeln('We failed to find the flax!');

else move Clickmouse2(Mouse_right); after if P07_isUptextMultiCustom(['ick', 'lax', 'Fla', 'Pic'] ) then

juunhoad

2013-03-01 15:48:51

From: Sjoekeloe
Does this kick in? writeln('We failed to find the flax!');

else move Clickmouse2(Mouse_right); after if P07_isUptextMultiCustom(['ick', 'lax', 'Fla', 'Pic'] ) then


Ya it says, We failed to find the flax! Is that a color problem?

Sjoe

2013-03-01 15:56:32

From: juunhoad
Ya it says, We failed to find the flax! Is that a color problem?


Could be , I usually write my TPA's ATPA's like this:


program new;
{$i SRL/SRL.simba}
{$I P07Include.Simba}

Procedure FindFlax;
var
tmpCTS, i, x, y, counter, r, l:integer;
FlaxTPA:TPointArray;
begin
tmpCTS := GetToleranceSpeed;

SetColorToleranceSpeed(2);
SetToleranceSpeed2Modifiers(0.13, 1.22);

if FindColorsTolerance(FlaxTPA,608516 , MSX1, MSY1, MSX2, MSY2, 10) then
begin

SetColorToleranceSpeed(tmpCTS); //RIGHT AFTER we find our colors, we
SetToleranceSpeed2Modifiers(0.02, 0.02); //Change the CTS back.

L := High(FlaxTPA)
Marktime(counter);

for i := 0 to L do
begin;
r := random(L);
Wait(RandomRange(60, 200));
mmouse(FlaxTPA[r].x, FlaxTPA[r].y, 2, 2);
if P07_IsUptextMultiCustom(['Pic', 'ick', 'Fla']) then
begin
writeln('We found the flax!');
clickmouse2(mouse_right);
Exit;
end;
if TimeFromMark(Counter) > 3000 then
begin
writeln('We failed to find the flax!');
Terminatescript;
end;
end;
end;
end;

begin
SetupSRL; // I'm not sure if u have to call setupsrl;
P07_DeclarePlayers;
SetupP07Include;
FindFlax;

end.

Try without setting setupsrl? I'm not sure if it's needed.

juunhoad

2013-03-01 16:26:57

Try without setting setupsrl? I'm not sure if it's needed.


Lol the problem was SetupSRL, why is it not needed?

Eduard

2013-03-01 17:34:52

its a simple problem. The text finding has to be loaded by using P07 custom SRL setup. Otherwise it will mess up with the fonts.

Try this:


program new;
{$i SRL/SRL.simba}
{$I P07Include.Simba}

procedure FindFlax;
var
tmpCTS, i, x, y, counter, r, l: integer;
FlaxTPA: TPointArray;
begin
tmpCTS := GetToleranceSpeed;
SetColorToleranceSpeed(2);
SetToleranceSpeed2Modifiers(0.13, 1.22);
FindColorsTolerance(FlaxTPA, 608516, MSX1, MSY1, MSX2, MSY2, 10);
SetColorToleranceSpeed(tmpCTS);
SetToleranceSpeed2Modifiers(0.02, 0.02);
L := High(FlaxTPA) marktime(counter);
for i := 0 to L do
begin
r := random(L);
Wait(RandomRange(60, 200));
mmouse(FlaxTPA[r].x, FlaxTPA[r].y, 2, 2);
if (P07_IsUpTextMultiCustom(['fla'])) then
begin
writeln('UpText found!');
Break;
end;
if timefrommark(counter) > 3000 then
begin
writeln('We failed to find the flax!');
Terminatescript;
end;
end;
writeln('We found the flax!');
Mouse(FlaxTPA[r].x, FlaxTPA[r].y, 1, 1, 1);
end;

begin
SetupP07Include;
FindFlax;
end.