Results 1 to 3 of 3

Thread: Reflection Path Maker

  1. #1
    Join Date
    Jan 2015
    Posts
    6
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default Reflection Path Maker

    I just started making scripts for Old School Runescape today and after seeing Turpinator's version of a path maker, I decided that making my own version would be helpful for getting familiar with pascal as well as being a useful tool for the future. I kept with with Turpinator's general flow but made some slight changes.

    Instructions:

    1. Go to the first point on your path
    2. Make sure you have the inventory tab open
    3. Start it up(It will capture your first point and then disable SMART)
    4. Move on to your next point
    5. Enable SMART(It will disable itself shortly after it captures the coordinates)
    6. Move on to your next point and so on...
    7. When you are finished, simply switch to another game tab(Give it time to fully switch) and enable SMART once more
    8. Viola! There will be two separate outputs, one that displays the path with randomness and one that does not

    Here's the program:
    Code:
    program PathMaker;
    
    {$DEFINE SMART8}
    {$I SRL-OSR/SRL.Simba}
    {$I SRL-OSR/SRL/Reflection/Reflection.simba}
    
    var
      pc, CurrentTab, LevelofRandomness: Integer;
      locationX, locationY, r: String;
      location: TPoint;
      XLocations, YLocations: Array[1..100] of String;
      PathCount: Array of String;
      Randomness: Boolean;
    
    Procedure DeclarePlayers;
    Begin
      HowManyPlayers := 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;
    
      // Counter for the number of points
      pc := 1;
    
      // Change your level of randomness here
      LevelofRandomness := 1;
    
      // So I can be lazy and have it log in for me
      Players[0].Name := '';
      Players[0].Pass :='';
      Players[0].Nick :='';
      Players[0].Active:=True;
    end;
    
    Procedure getCurrentTile;
      begin
        location := R_GetTileGlobal;
      end;
    
    Procedure GetXCoord;
      begin
        locationX := IntToStr(location.x);
      end;
    
    Procedure GetYCoord;
      begin
        locationY := IntToStr(location.y);
      end;
    
    Procedure GetCoords;
      begin
        GetCurrentTile;
        GetXCoord;
        GetYCoord;
      end;
    
    Procedure PathToString;
    var
      i : integer;
      RandomString, PathWithRandomness, PathWithoutRandomness: String;
    begin
      SetLength(PathCount, pc);
    
      // Without Randomness
      r := '';
      for i := 1 to length(PathCount)-1 do
        r := r + ' Point(' + XLocations[i] + ', ' + YLocations[i] + '),';
      r[1] := '[';
      r[length(r)] := ']';
      PathWithoutRandomness := r;
    
      // With Randomness
      r := '';
      RandomString := ' + RandomRange(' + IntToStr(LevelofRandomness*-1) + ', ' + IntToStr(LevelofRandomness) + ')';
      for i := 1 to length(PathCount)-1 do
        r := r + ' Point(' + XLocations[i] + RandomString + ', ' + YLocations[i] + RandomString + '),';
      r[1] := '[';
      r[length(r)] := ']';
      PathWithRandomness := r;
    
      // Outputs the paths
      writeln('');
      writeln('With Randomness: R_WalkPath(' + PathWithRandomness + ');');
      writeln('');
      writeln('Without Randomness: R_WalkPath(' + PathWithoutRandomness + ');');
      writeln('');
    
    end;
    
    begin
      SetUpSRL;
      SetupReflection;
      ActivateClient;
      DeclarePlayers;
      LoginPlayer;
      repeat
        repeat
            wait(500);
        until SmartEnabled(SmartCurrentTarget);
        CurrentTab := GetCurrentTab;
        if (CurrentTab = 24) then
        begin
          GetCoords;
          XLocations[pc] := LocationX;
          YLocations[pc] := LocationY;
          SmartSetEnabled(SmartCurrentTarget, false);
          pc := pc + 1;
        end;
      until (not(CurrentTab = 24));
    
      SmartSetEnabled(SmartCurrentTarget, false);
      PathToString;
    
    end.
    Here's a sample output:

    Code:
    With Randomness: R_WalkPath([Point(3288 + RandomRange(-1, 1), 3190 + RandomRange(-1, 1)), Point(3290 + RandomRange(-1, 1), 3185 + RandomRange(-1, 1)), Point(3298 + RandomRange(-1, 1), 3184 + RandomRange(-1, 1))]);
    
    Without Randomness: R_WalkPath([Point(3288, 3190), Point(3290, 3185), Point(3298, 3184)]);
    Last edited by Falorion; 04-09-2015 at 10:36 AM.

  2. #2
    Join Date
    Apr 2015
    Posts
    43
    Mentioned
    0 Post(s)
    Quoted
    19 Post(s)

    Default

    I'll check it out,thanks o/

  3. #3
    Join Date
    Dec 2011
    Posts
    52
    Mentioned
    0 Post(s)
    Quoted
    18 Post(s)

    Default

    Second, gonna try and report back to this thread!

Thread Information

Users Browsing this Thread

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

Posting Permissions

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