Results 1 to 5 of 5

Thread: Carlover's supercharged G.E. Walker [reflection]

  1. #1
    Join Date
    Jun 2008
    Location
    Somewhere between here and there
    Posts
    117
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Carlover's supercharged G.E. Walker [reflection]

    Well everyone here it is my first working script. Pretty much just read what I said in the script and it should work like a charm. Please give info on how it could be made better.:}

    NOT WORKING ATM NEED SOMEBODY WHO CAN SHOW ME HOW TO MAKE THIS THING WORK IT WOULD BE MUCH APPRECIATED




    SCAR Code:
    //   MY FIRST WORKING SCRIPT
    //      DESCRIPTION: Walks to the Grand Exchange from the Falador East Bank.
    //         Must have reflection
    //             Please tell me some ways that I could improve this script
    //                 Thinking of adding something like this to another script
    //                     that would walk to the G.E. after a specific amount
    //                         of whatever is attained.
    //                             ~Made By Carlover~
    //                                  Credit: Sumilion for showing me how to make
    //                                           it walk and for your path tool
    //
    //
    //       Made for SCAR Divi 3.15b SRL Revision 20 Reflection Revision 64




    program GEWalker;
    {.include SRL\SRL\misc\Smart.scar}
    {.include SRL\SRL.scar}
    {.include SRL\SRL\reflection\reflection.scar}

    Procedure DeclarePlayers;
    Begin
      CurrentPlayer := 0;
      HowManyPlayers  := 1;
      NumberOfPlayers( HowManyPlayers );

      Players[0].Name  := '';
      Players[0].Pass  := '';
      Players[0].Nick  := '';
      Players[0].Active:= True;
    End;

    {-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
    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.

  2. #2
    Join Date
    Aug 2007
    Location
    Georgia, U.S.
    Posts
    890
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    add failsafes.

  3. #3
    Join Date
    May 2007
    Location
    Ohio
    Posts
    2,296
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    WOW!!! Those are my functions, but there outdated... ... Try these!

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

    Function WalkToTile2(TileX, TileY, Rx, Ry: Integer): Boolean;
    Var
      x, y: Integer;
    Begin
      TileToMinimap(Tilex, Tiley, x, y);
      if (not (InCircle(x, y, MMCX, MMCY, 74))) then
      begin
        Writeln('Tile off minimap!');
        Result := False;
        Exit;
      end;
      Mouse(x, 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;
      Px, Py, I: Integer;

    Begin
      GetMyPox(Px, Py);
      aPath := Path;
      SortTPAFrom(aPath, Px, Py);
      If (Not (TileOnMM(aPath[0].X, aPath[0].Y))) Then
        Exit;
      For I := 0 To High(Path) Do
        If (Path[i] = aPath[0]) 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;

  4. #4
    Join Date
    Jun 2008
    Location
    Somewhere between here and there
    Posts
    117
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    yea sorry timer i forgot to credit you for the gr8 functions. I guess i didnt know they were outdated isnt reflection at rev 60 or did it change again? And yes i'm adding failsafes right now. Wait a second there are already fail-safes so what are you talking about skilld u?

  5. #5
    Join Date
    Jun 2008
    Location
    Somewhere between here and there
    Posts
    117
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Updated to Timer's new functions. Still working perfectly.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Radial walker
    By Extracht in forum OSR Help
    Replies: 3
    Last Post: 11-14-2007, 05:27 PM
  2. Best Walker
    By Ejjman in forum News and General
    Replies: 23
    Last Post: 03-28-2007, 01:50 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •