Log in

View Full Version : I Need Proffesional Help :(



carlover
08-10-2008, 10:34 PM
Ok my problem is that i do not have a clue what to do. I'm just learning how to use reflection and it would be nice if i could have a little help.. Ive read tuts and sometimes i just dont get my questions answered. So here's my one question for right now.
1. I used sumilions new reflection path maker tool to get all this

function LoadPath: TPointArray;
begin
SetLength(Result, 42);

Result[0] := Point(3012, 3354);
Result[1] := Point(3008, 3362);
Result[2] := Point(3000, 3362);
Result[3] := Point(2995, 3367);
Result[4] := Point(2987, 3371);
Result[5] := Point(2980, 3377);
Result[6] := Point(2971, 3378);
Result[7] := Point(2967, 3384);
Result[8] := Point(2967, 3394);
Result[9] := Point(2965, 3402);
Result[10] := Point(2969, 3409);
Result[11] := Point(2975, 3414);
Result[12] := Point(2984, 3419);
Result[13] := Point(2988, 3426);
Result[14] := Point(2997, 3432);
Result[15] := Point(3008, 3431);
Result[16] := Point(3016, 3425);
Result[17] := Point(3022, 3422);
Result[18] := Point(3027, 3425);
Result[19] := Point(3036, 3425);
Result[20] := Point(3041, 3415);
Result[21] := Point(3051, 3414);
Result[22] := Point(3057, 3415);
Result[23] := Point(3068, 3416);
Result[24] := Point(3079, 3416);
Result[25] := Point(3087, 3421);
Result[26] := Point(3098, 3420);
Result[27] := Point(3112, 3420);
Result[28] := Point(3119, 3417);
Result[29] := Point(3126, 3414);
Result[30] := Point(3137, 3416);
Result[31] := Point(3147, 3416);
Result[32] := Point(3158, 3418);
Result[33] := Point(3166, 3426);
Result[34] := Point(3176, 3428);
Result[35] := Point(3175, 3442);
Result[36] := Point(3171, 3453);
Result[37] := Point(3166, 3460);
Result[38] := Point(3164, 3467);
Result[39] := Point(3164, 3475);
Result[40] := Point(3164, 3481);
Result[41] := Point(3165, 3487);

end;

Now that I have all that how do I make that into a script that will walk that path? It might be something really simple, but please help me anyways it would be much appreciated.:duh:

Widget
08-10-2008, 11:38 PM
function WalkThePath: boolean;
var
Path: TPointArray;
i: integer;
begin
Path := LoadPath;
for i := 0 to High(Path) do
WalkToTile(Path[i], 3, 3);
result := DistanceFrom(Path[High(Path)])<5;
end;
I think that should do it

carlover
08-11-2008, 02:08 AM
Figured it out thanks anyways. Using this instead.

{-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
Function WalkToTile2(TileX, TileY: Integer): Boolean;
By: Timer
Description: Walks to the tile using minimap.
-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-}
Function WalkToTile2(TileX, TileY, Rx, Ry: Integer): Boolean;

Var
Tw: TPoint;

Begin
Tw := TileToMM(IntToPoint(Tilex, Tiley));
if (not (InCircle(Tw.x, Tw.y, MMCX, MMCY, 74))) then
begin
Writeln('Tile off minimap!');
Result := False;
Exit;
end;
Mouse(Tw.x, Tw.y, Rx, Rx, True);
Result := True;
end;

{-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
Function GetMyPosOnPath(Var aVar: Integer; Path: TPointArray): Boolean;
By: Timer
Description: Finds your character on a specified path. Results True If Sucsess.
aVar is the tile in array;
-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-}
Function GetMyPosOnPath(Var aVar: Integer; Path: TPointArray): Boolean;

Var
aPath: TPointArray;
I: Integer;
PosG: TPoint;

Begin
PosG := GetMyPos;
aPath := Path;
SortTPAFrom(aPath, IntToPoint(PosG.x, PosG.y));
If (Not (TileOnMM(IntToPoint(aPath[0].X, aPath[0].Y)))) Then
Exit;
For I := 0 To High(Path) Do
If ((Path[i].X = aPath[0].X) And (Path[i].Y = aPath[0].Y)) Then
Begin
aVar := I;
Result := True;
Exit;
End;
End;

{-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
Function PathWalk(Path: TPointArray): Boolean;
By: Timer
Description: Walks The Path, If Lost, Finds Character, And Reverts To A
R_FFlag(0); Instead Of R_FFlag(8); - Randomizes Tiles.
-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-}
Function PathWalk(Path: TPointArray): Boolean;

Var
I, I2: Integer;

Begin
For I := 0 To High(Path) Do
If (Not (WalkToTile2(Path[i].X + (Random(3) - Random(3)), Path[i].Y + (Random(3) - Random(3)), (Random(3) - Random(3)), (Random(3) - Random(3))))) Then
Begin
Result := False;
Break;
End Else
Begin
R_FFlag(8);
FindNormalRandoms;
Result := True;
End;
If (Result) Then
Exit;
If (GetMyPosOnPath(I2, Path)) Then
Begin
For I := I2 To High(Path) Do
If (Not (WalkToTile2(Path[i].X + (Random(3) - Random(3)), Path[i].Y + (Random(3) - Random(3)), 3, 3))) Then
Begin
Result := False;
Exit;
End Else
Begin
R_FFlag(0);
FindNormalRandoms;
Result := True;
End;
End;
End;

function LoadPath: TPointArray;
begin
SetLength(Result, 42);

Result[0] := Point(3012, 3354);
Result[1] := Point(3008, 3362);
Result[2] := Point(3000, 3362);
Result[3] := Point(2995, 3367);
Result[4] := Point(2987, 3371);
Result[5] := Point(2980, 3377);
Result[6] := Point(2971, 3378);
Result[7] := Point(2967, 3384);
Result[8] := Point(2967, 3394);
Result[9] := Point(2965, 3402);
Result[10] := Point(2969, 3409);
Result[11] := Point(2975, 3414);
Result[12] := Point(2984, 3419);
Result[13] := Point(2988, 3426);
Result[14] := Point(2997, 3432);
Result[15] := Point(3008, 3431);
Result[16] := Point(3016, 3425);
Result[17] := Point(3022, 3422);
Result[18] := Point(3027, 3425);
Result[19] := Point(3036, 3425);
Result[20] := Point(3041, 3415);
Result[21] := Point(3051, 3414);
Result[22] := Point(3057, 3415);
Result[23] := Point(3068, 3416);
Result[24] := Point(3079, 3416);
Result[25] := Point(3087, 3421);
Result[26] := Point(3098, 3420);
Result[27] := Point(3112, 3420);
Result[28] := Point(3119, 3417);
Result[29] := Point(3126, 3414);
Result[30] := Point(3137, 3416);
Result[31] := Point(3147, 3416);
Result[32] := Point(3158, 3418);
Result[33] := Point(3166, 3426);
Result[34] := Point(3176, 3428);
Result[35] := Point(3175, 3442);
Result[36] := Point(3171, 3453);
Result[37] := Point(3166, 3460);
Result[38] := Point(3164, 3467);
Result[39] := Point(3164, 3475);
Result[40] := Point(3164, 3481);
Result[41] := Point(3165, 3487);
end;

Procedure SetupSMART;
Begin
SmartSetupEx(136, True, True, False);
SetTargetDC(SmartGetDC);
If Not (LoggedIn) Then
While Not (SmartGetColor(360, 172) = 13158) Do
Wait(100);
End;
begin
SetupSRL;
SetupSMART;
DeclarePlayers;
LoginPlayer;
Wait(2000 + Random(500));
PathWalk(LoadPath);
end.

TViYH
08-11-2008, 02:41 AM
I think all those Point(x, y) should be changed to IntToPoint(x, y).

Method
08-11-2008, 02:43 AM
I think all those Point(x, y) should be changed to IntToPoint(x, y).

Why? Both functions return a TPoint as a result and, as far as I know, both functions do exactly the same thing (though maybe not the same way).

TViYH
08-11-2008, 04:16 AM
I didn't think Point did the same thing as IntToPoint..
do you have to disagree with everything i say?

Method
08-11-2008, 05:02 AM
do you have to disagree with everything i say?

I've replied to two of your posts because you gave a user the wrong information. Since when it is a bad thing to give the correct information?

Daniel
08-11-2008, 07:15 AM
I've replied to two of your posts because you gave a user the wrong information. Since when it is a bad thing to give the correct information?
You = Always.
Anyone Else = Never.

:p

carlover
08-11-2008, 01:16 PM
OK, OK now that's enough i will not have all this fighting on my thread. And point and IntToPoint do the same thing...