SRL Archive - Research & Development Lounge

Procedure AWalkCol(Degree, Radius, Color, Ranx, Rany:integer)


itSchRis917

2007-07-14 20:45:53

This function will walk you at a specific angle (degree) at a specified distance from center of Minimap (radius) until it finds a set color. Ranx and Rany = Random x and y for Mouse. Hope you enjoy! And I dont know if someone already made this or not, if someone did, sorry.

Procedure AWalkCol(Degree, Radius, Color, Ranx, Rany: integer);
Var
Ax, Ay, Clicks : Integer;
Begin
Ax := Round ( Radius * Sin (Degree * Pi / 180))+648;
Ay := Round (-Radius * Cos (Degree * Pi / 180))+83;
Repeat
Mouse(Ax, Ay, Ranx, Rany, True);
FFlag(5);
Clicks:=Clicks+1;
Until(FindColor(x, y, Color, MMX1, MMY1, MMX2, MMY2))OR (Clicks >=30);
End;

Edit: Here's a few more of the same type of walking procedures, just with different variables… if that makes sense… lol

This one will walk at a specified angle again, once again, at a specified radius, but JUST ONCE.

Procedure AWalk3(Degree, Radius, ranx,rany : Integer);
Var
Ax, Ay : Integer;
begin
If (Radius > 57) then
Radius := 57;
Ax := Round ( Radius * Sin (Degree * Pi / 180)) + 648;
Ay := Round (- Radius * Cos (Degree * Pi / 180)) + 83;
Mouse(Ax, Ay, ranx, rany, True);
end;

This one will walk until it finds a symbol of your choosing..

Procedure AWalkSymbol(Degree, Radius, Ranx, Rany : Integer; Symbol :String);
Var
Ax, Ay, Clicks : Integer;
Begin
Ax := Round ( Radius * Sin (Degree * Pi / 180))+648;
Ay := Round (-Radius * Cos (Degree * Pi / 180))+83;
Repeat
Mouse(Ax, Ay, Ranx, Rany, True);
FFlag(5);
Clicks:=Clicks+1;
Until(FindSymbol(x, y, Symbol)) OR (Clicks >= 30);
End;

Esteban

2007-07-15 14:54:41

So it's like RW? I don't see how anyone can set to how far they want to walk or where they want to walk.

itSchRis917

2007-07-15 23:09:47

Radius sets the distance away from the center of the minimap, same as RadialWalk etc. But, RadialWalk and RadialRoadWalk didnt work for me, so I made this. It will keep walking until it finds a specified color in the Minimap.

3Garrett3

2007-07-20 17:10:43

degree is like when we set the things for radial walk right, like 0/360 is the top and stuff? Its basically like a blind click there until it finds the color?

itSchRis917

2007-07-20 17:19:42

Yea. 0 = N, 90 = E, 180 = S, 270 = W, 360 = N(again)

3Garrett3

2007-07-25 11:28:15

So, do you mind if i update it a bit to be a bit more like radial walk? And add some tolerance in there for the find color too.

itSchRis917

2007-07-25 11:40:34

Yea, thats fine by me.

3Garrett3

2007-07-25 12:12:43


Function AWalkCol(Degree, Radius, Color, Ranx, Rany: integer) : Boolean;//Made By ItsChris917, Modified by 3Garrett3
var
Ax, Ay, Ax1, Ay1, Ax2, Ay2, Clicks : Integer;
begin
Ax := Round ( Radius * Sin (Degree * Pi / 180))+648;
Ay := Round (-Radius * Cos (Degree * Pi / 180))+83;
Ax1 := (Ax - 10);
Ay1 := (Ay - 10);
Ax2 := (Ax + 10);
Ay2 := (Ay + 10);
if FindColorSpiralTolerance(x, y, Color, Ax1, Ay1, Ax2, Ay2, 5) then
begin
Mouse(x, y, Ranx, Rany, True);
FFlag(5);
Result := True;
Exit;
end else
Result:= False;
Writeln('Didnt Find Color :(');
end;

Is what I changed it too.

itSchRis917

2007-07-25 12:22:13

Shouldn't it be Function AWalkCol(Degree, Radius, Color, Ranx, Rany: integer):Boolean if you are returning a boolean result? You still have it labeled as a procedure..

3Garrett3

2007-07-25 12:28:03

ya, it should, but whatever :p. I just made a quick change and never compiled it.

itSchRis917

2007-07-25 16:33:16

Ok, just checkin. ;)