SRL Archive - OSR Help

IsUpText


Wire

2014-07-18 22:25:44

Any ideas why my Uptext bit isn't working? I think it may have something to do with the previous search area being limited to ATPA tbox. This is for my new script of agility rooftops, thanks Wire.
procedure VRoughWall;
var
RWallTPA, BWallTPA:TPointArray;
RWallATPA:T2DPointArray;
RWallBox:TBox;
tmpCTs, i, l, r, counter:Integer;
begin
tmpCTS := GetToleranceSpeed;
MakeCompass(315)
SetColorToleranceSpeed(2);
SetToleranceSpeed2Modifiers(0.48, 0.43);
FindColorsTolerance(RWallTPA, 2111560, MSX1, MSY1, MSX2, MSY2, 1)

L := High(RWallTPA) //Counts how many TP's are found
marktime(counter);
for i := 0 to L do
begin
wait(randomrange(60, 200));
WriteLn('FoundColorWALL');
RWallATPA := SplitTPAEx(RWallTPA, 5, 5); //Makes Arrays of TPAs
SortATPASize(RWallATPA, True); //Sorts the ATPAs by size
for i := 0 to high(RWallATPA) do
begin
WriteLn('TPA');
RWallBox := GetTPABounds(RWallATPA[i]); //Searches within a TPA from sorted ATPAs
SetColorSpeed2Modifiers(0.00, 0.23);
if findcolorstolerance(BWallTPA, 4672588, RWallBox.x1, RWallBox.y1, RWallBox.x2, RWallBox.y2, 5) then //Looks for color inside ATPAs
begin
r := random(length(BWallTPA));
writeln('trying to click');
mmouse(BWallTPA[r].x, BWallTPA[r].y, 5, 7); //changed from i to r
if WaitUpTextMulti(['Climb', 'lim', 'oug', 'Rough', 'all'], randomrange(200, 300)) then
begin
mouse(BWallTPA[r].x, BWallTPA[r].y, 2, 2, true);
WriteLn('Found Rough Wall');
end;
end;
end;
end;
SetColorToleranceSpeed(tmpCTS); //Returns base CTS
SetToleranceSpeed2Modifiers(0.02, 0.02); //Orginal CTS Mods
end;

Hoodz

2014-07-18 22:48:54

try to debug the uptext first.

WriteLn('Uptext: ' + GetUpText);

The Mayor

2014-07-18 23:06:14

Set the CTS mods back to 0.2 before you check for upText.

Wire

2014-07-18 23:53:11

From: The Mayor
Set the CTS mods back to 0.2 before you check for upText.
That fixed it, making them noob mistake day and night!

From: hoodz
try to debug the uptext first.

WriteLn('Uptext: ' + GetUpText);

Will keep that in mind for the future thanks!


Any ideas on how to get the ATPA search to stop after actually climb? I'm thinking something along the lines of
 begin
mouse(BWallTPA[r].x, BWallTPA[r].y, 2, 2, true);
WriteLn('Found Rough Wall');
Wait(1000+random(5000));
if DidYellowClick then
exit

* that didn't work, maybe something with reflection? I'm trying to make this a strictly color bot, but will use reflection if needed.

Hoodz

2014-07-19 16:26:33

From: Wire

Any ideas on how to get the ATPA search to stop after actually climb? I'm thinking something along the lines of
 begin
mouse(BWallTPA[r].x, BWallTPA[r].y, 2, 2, true);
WriteLn('Found Rough Wall');
Wait(1000+random(5000));
if DidYellowClick then
exit

* that didn't work, maybe something with reflection? I'm trying to make this a strictly color bot, but will use reflection if needed.

you can just exit after the wait. but be sure you reset CTS before you exit