SRL Archive - OSR Help

ATP Help


BigRedJapan

2013-03-07 20:03:13

Function FindRope: Boolean;

Var
TPAA: T2DPointArray;
TPA: TPointArray;
CTS, I, X, Y: Integer;
Begin
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, 4276674, MSX1, MSY1, MSX2, MSY2, 10);
ColorToleranceSpeed(CTS);
TPAA := TPAToATPAEx(TPA, 50, 50);
SortATPASize(TPAA, True);
For I := 0 To High(TPAA) Do
If GetArraylength(TPAA[i]) > 150 Then
Begin
MiddleTPAEx(TPAA[i], X, Y);
ClickMouse2(mouse_Left);
If WaitUpText('ncing', 300) Then
Begin
Result := True;
GetMousePos(X, Y);
Break;
End;
End;
End;

What am i doing Wrong?

x[Warrior]x3500

2013-03-07 20:07:44

well at first glance, you never set the cts 2 modifiers.

edit:
u never move the mouse anywhere.

Le Jingle

2013-03-07 20:16:53

I don't know what your problem is, please state it, elaborating more on what is going wrong.
One error that sticks out from a glace is the non-mouse movements and clicking before you wait for uptext.

x[Warrior]x3500

2013-03-07 20:17:26

lol u dont even know what its called. man guides musta really failed u. (they are called ATPAs). use aca to set the cts2 modifiers. and read a beginners guide for how to move the mouse. overall, its almost done, just needs minor modifications

BigRedJapan

2013-03-07 20:21:07

Yea iv read just about all the guides! I still cant find a good one except for the brief description in how to script a Privet Server. iv been studying for 3 days as much as i can on TPA and still nothing!

 Procedure RopeTPA;
var
tmpCTS, l, r:Integer;
ObjectTPA:TPointArray;
begin
MouseSpeed:=15;
P07_MakeCompassSouth;
P07_MakeCameraAngleHigh;
tmpCTS := GetToleranceSpeed;
SetColorToleranceSpeed(2);
SetToleranceSpeed2Modifiers(0.07, 0.11);
if FindColorsTolerance(ObjectTPA, 5206412, MSX1, MSY1, MSX2, MSY2, 3) then
begin
Repeat
SetColorToleranceSpeed(tmpCTS);
SetToleranceSpeed2Modifiers(0.02, 0.02);
L := High(ObjectTPA);
mmouse((ObjectTPA[r].x), (ObjectTPA[r].y), 2, 2);
wait(randomrange(100, 150));
clickmouse2(mouse_left);
until(P07_DidRedClick);
Writeln('We found the Object');
wait(randomrange(2000, 2500));
end;
end;

Yet its not flaw it fails and doesn't click i was trying to figure out how to find a box around the rope! Yet no script can help me figure it out!

Ian

2013-03-07 20:30:35

Have you read http://villavu.com/forum/showthread.php?t=92301 ?

It will show you how to make a box from an ATPA.

BigRedJapan

2013-03-07 20:42:46

Yes i have read it and the code that he advised did nothing! I tried to make an outline of where the log laid and for it to find the log within the brown area! It didn't even attempt to do anything just executed right away!

x[Warrior]x3500

2013-03-07 21:51:24

go here. go to ATPA. go all the way to the bottom. use that code as reference for creating your function

BigRedJapan

2013-03-07 22:15:55

I have a new Procedure idea!

procedure Rope;
Var
tmpCTS:Integer;

begin
P07_MakeCameraAngleHigh;
P07_MakeCompassSouth;
ropecol := 5536408 Writeln('Walk Rope');
SetColorToleranceSpeed(2);
SetToleranceSpeed2Modifiers(0.04, 0.31);
if P07_FindObjCustom(x, y, ['Walk', 'lk-on'], [ropecol], 6) then
begin
SetColorToleranceSpeed(tmpCTS);
SetToleranceSpeed2Modifiers(0.02, 0.02);
wait(1000);
ClickMouse2(mouse_left);
end;
end;

Will this work?

Smidqe

2013-03-08 01:29:27

From: Rules of Joe
I have a new Procedure idea!

procedure Rope;
Var
tmpCTS:Integer;

begin
P07_MakeCameraAngleHigh;
P07_MakeCompassSouth;
ropecol := 5536408 Writeln('Walk Rope');
SetColorToleranceSpeed(2);
SetToleranceSpeed2Modifiers(0.04, 0.31);
if P07_FindObjCustom(x, y, ['Walk', 'lk-on'], [ropecol], 6) then
begin
SetColorToleranceSpeed(tmpCTS);
SetToleranceSpeed2Modifiers(0.02, 0.02);
wait(1000);
ClickMouse2(mouse_left);
end;
end;

Will this work?


Yes and no. What if it doesn't find the correct object? Then it won't change the CTS back to 1 which affects other functions and possibly messes them up, you also would've set wrong modifiers when it would've found it, usually sat and hue modifiers are set to 0.2 when setting CTS back to 1.

Also remember to first set modifiers then change CTS. Altough I'm not sure if there is no harm doing it like you had.

Secondly, you haven't set tmpCTS or any other necessary variables (x, y, ropecol) anywhere, but other than that it'll work codewise.

I fixed the standards and declared the necessary variables:
procedure Rope;
var
tmpCTS, ropecol, x, y : Integer;
begin
P07_MakeCameraAngleHigh;
P07_MakeCompassSouth;

tmpCTS := GetToleranceSpeed;
ropecol := 5536408;
Writeln('Walk Rope');

SetColorToleranceSpeed(2);
SetToleranceSpeed2Modifiers(0.04, 0.31);

if P07_FindObjCustom(x, y, ['Walk', 'lk-on'], [ropecol], 6) then
begin
wait(1000);
ClickMouse2(mouse_left);
end;

SetToleranceSpeed2Modifiers(0.2, 0.2);
SetColorToleranceSpeed(tmpCTS);
end;

BigRedJapan

2013-03-08 03:37:05

I just found that the CTS .2 works so much better in finding the rope on ACA. I just didn't know if it was possible! I got tired of using all those sketchy TPA guides!

Sjoe

2013-03-08 03:45:48

From: Rules of Joe
I just found that the CTS .2 works so much better in finding the rope on ACA. I just didn't know if it was possible! I got tired of using all those sketchy TPA guides!


Just check out scripts from more exerienced people.
Since TPA/ATPA is a great way to find object, they implement it often.
Check out how they use it, you're not far off.

You'll get the hang of it. You'll see that it's not that hard.

Eduard

2013-03-08 04:12:53

From: Rules of Joe
I just found that the CTS .2 works so much better in finding the rope on ACA. I just didn't know if it was possible! I got tired of using all those sketchy TPA guides!


Hi mate,

wanna script that gnome agility course together? I can help you understand and learn ATPA/TPA's and we'll both make a good gnome agility script :).
Win/win.