Results 1 to 3 of 3

Thread: DropPatternExcept

  1. #1
    Join Date
    Oct 2006
    Posts
    500
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default DropPatternExcept

    We have DropAll which uses DropPattern (which I prefer to use patterns over the regular and consistent 1, 2, 3 .. 28 dropping) however there is no method to use a pattern whilst excluding certain inventory spots (which, for example, is useful if a script does not want to drop a certain InvSpot which contains equipment or important items).

    DropPattern can easily be modified to allow this by changing

    Code:
      for i:= 0 to 27 do
        DropItem(Arr[i]);
    to

    Code:
      for i:= 0 to 27 do
        if not InIntArray(DontDrop, Arr[i]) then
          DropItem(Arr[i]);
    Also adding a DontDrop parameter.

    To prevent breaking anything, the include could be modified like so:

    Code:
    {*******************************************************************************
    procedure DropPatternExcept(DontDrop: TIntegerArray; Which: Integer);
    By: Rasta Magician
    Description: Drops all items in inventory according to pattern which, ignoring
                 slots in DontDrop.
    *******************************************************************************}
    procedure DropPatternExcept(DontDrop: TIntegerArray; Which: Integer);
    var
      Col, A, I: Integer;
      Arr: TIntegerArray;
      Turn: Boolean;
    begin
      SetLength(Arr, 28);
      A := 0;
      if (Which = 0) then
        Which := Random(2) + 1; //ignores complete randomness, unless scripter chooses to use it
      srl_warn('DropPattern','Dropping by pattern: ' + IntToStr(Which),warn_Debug);
      case which of
        dp_UpToDown:
          for Col := 1 to 4 do
            if InIntArray([2, 4], Col) then
            begin
              for i := 6 Downto 0 do
              begin
                Arr[a] := Col + i*4;
                Inc(a);
              end;
            end else
              for i := 0 to 6 do
              begin
                Arr[a] := Col + i*4;
                Inc(a);
              end;
        dp_Snake:
          repeat
            if (not Turn) then
            begin
              for i:= 1 to 4 do
                Arr[a + I - 1] := A + I;
              IncEx(a, 4);
              Turn := True;
            end else begin
              for I := 4 Downto 1 do
                Arr[a-i+4] := a + i;
              IncEx(a, 4);
              Turn := false;
            end;
          until (a >= 28);
        dp_Random:
          begin
             DropArray([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
               18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28]);
             Exit;
          end;
      end;
      if Random(2) = 1 then
        InvertTIA(Arr);
      Gametab(tab_inv);
      for i:= 0 to 27 do
        if not InIntArray(DontDrop, Arr[i]) then
          DropItem(Arr[i]);
    end;
    
    {*******************************************************************************
    procedure DropPattern(Which: Integer);
    By: Rasta Magician
    Description: Drops all items in inventory according to pattern which.
    *******************************************************************************}
    procedure DropPattern(Which: Integer);
    begin
      DropPatternExcept([], Which);
    end;
    Comments ? Would you find this useful, or unnecessary ?

  2. #2
    Join Date
    Nov 2009
    Location
    Seattle, WA
    Posts
    589
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Wow this sounds helpful. Indeed this will be useful for those who want a better pattern then ClickAllItemsExcept and don't want to use specific Identifiers. =] Good job my friend.
    Don't Troll, Don't Fight, Just keep the Respect
    Status : Offline

    Feel free to re-make my scripts ;D
    Community Member

  3. #3
    Join Date
    Sep 2007
    Location
    Australia, NSW
    Posts
    934
    Mentioned
    6 Post(s)
    Quoted
    145 Post(s)

    Default

    Good idea. This would be very useful

    INACTIVE
    How-to: Make S.M.A.R.T. less laggy

    Sell me your Maple Shieldbows (u)! Up to 95gp ea!

    My Scripts:
    Ivy Chopper Ultra [RS3] | Fantastic Fletcher [RS3]
    99 x78 | 99 x10 | 99 x2 | 99 x12


    Use the REPORT tags when posting progress reports to make life easier (:
    [REPORT]Put progress report in here![/REPORT]

    Super Savvy Smither V1.06Cool Classy Cooker V1.02 [EoC]

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
  •