Results 1 to 5 of 5

Thread: Help with modding script piece

  1. #1
    Join Date
    Dec 2011
    Location
    P2P :)
    Posts
    561
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default Help with modding script piece

    Simba Code:
    const
      dp_UpToDown = 1;
      dp_Snake = 2;
      dp_Random = 3;

    {*******************************************************************************
    procedure DropPattern(Which: Integer);
    By: Rasta Magician
    Description: Drops all items in inventory according to pattern which.
    *******************************************************************************}

    procedure DropPattern(Which: Integer);
    var
      Col, A, I: Integer;
      {$IFDEF SIMBA}
      Arr: TIntegerArray;
      {$ELSE}
      Arr: TIntArray;
      {$ENDIF}
      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
        DropItem(Arr[i]);
    end;


    Is there any way I can put a 'Wait' time between each inventory slot. I have an idea but I can't really figure this one out lol. So basically I would like to mod this to ~Drop Item~Wait(600)?~Drop Item~Repeat~.
    I wear my scars like the rings on a pimp
    I live life like the captain of a sinking ship
    Always sell your product for ATLEAST mid to ensure that the market doesn't drop.

  2. #2
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    That uses DropArray, so you will need to edit droparray in SRL.

    Original:
    Simba Code:
    procedure DropArray(InvSlots: TIntegerArray);
    var
      I, Len: Integer;
    begin
      Len := Length(InvSlots);
      for I := 1 to Len - 4 do
        Swap(InvSlots[RandomRange(I - 1, I + 4)], InvSlots[RandomRange(I - 1, I + 4)]);
      for I := 0 to Len - 1 do
        DropItem(InvSlots[I]);
    end;

    Modded
    Simba Code:
    procedure DropArray(InvSlots: TIntegerArray);
    var
      I, Len: Integer;
    begin
      Len := Length(InvSlots);
      for I := 1 to Len - 4 do
        Swap(InvSlots[RandomRange(I - 1, I + 4)], InvSlots[RandomRange(I - 1, I + 4)]);
      for I := 0 to Len - 1 do
      Begin
        DropItem(InvSlots[I]);
        Wait(600)//PUT YOUR WAIT HERE BROH!
      End;
    end;

  3. #3
    Join Date
    Dec 2011
    Location
    P2P :)
    Posts
    561
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    I tried that and it still goes at the same set speed. Here is the entire chunk from inventory.simba

    Simba Code:
    {*******************************************************************************
    procedure DropArray(InvSlots: TIntegerArray);
    By: Lorax/EvilChicken!, Tickyy for idea.
    Description: Drops item positioned equivalent to numbers in "InvSlots" array.
    Example: "DropArray([2, 4, 9, 12]);" would drop items in InvSlot 2, 4, 9 and 12.
    *******************************************************************************}

    procedure DropArray(InvSlots: TIntegerArray);
    var
      I, Len: Integer;
    begin
      Len := Length(InvSlots);
      for I := 1 to Len - 4 do
        Swap(InvSlots[RandomRange(I - 1, I + 4)], InvSlots[RandomRange(I - 1, I + 4)]);
      for I := 0 to Len - 1 do
        DropItem(InvSlots[I]);
        //Added the wait and it still continued on at the same pace.
    end;

    const
      dp_UpToDown = 1;
      dp_Snake = 2;
      dp_Random = 3;

    {*******************************************************************************
    procedure DropPattern(Which: Integer);
    By: Rasta Magician
    Description: Drops all items in inventory according to pattern which.
    *******************************************************************************}

    procedure DropPattern(Which: Integer);
    var
      Col, A, I: Integer;
      {$IFDEF SIMBA}
      Arr: TIntegerArray;
      {$ELSE}
      Arr: TIntArray;
      {$ENDIF}
      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
        DropItem(Arr[i]);
    end;

    {*******************************************************************************
    procedure DropAll;
    By: Rasta Magician
    Description: Drops all items in inventory.
    *******************************************************************************}

    procedure DropAll;
    var i: integer;
    begin
      for i:= 0 to 2 do
      begin
        DropPattern(Random(2) + 1);
        if InvCount = 0 then
          break;
      end;
    end;

    DropAll calls on DropPattern which calls on DropArray. Hopefully I am not missing something.
    I wear my scars like the rings on a pimp
    I live life like the captain of a sinking ship
    Always sell your product for ATLEAST mid to ensure that the market doesn't drop.

  4. #4
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

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

    make it

    Simba Code:
    for i:= 0 to 27 do
    Begin
      DropItem(Arr[i]);
      Wait(600);
    End;

  5. #5
    Join Date
    Dec 2011
    Location
    P2P :)
    Posts
    561
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    Thanks but I found out editing the bit below gives the results I want. Thanks again for the help

    Simba Code:
    function DropItem(i: Integer): Boolean;
    begin
      Result := False;
      if ExistsItem(i) then
      begin
        MouseItem(i, False);
        if (WaitOptionEx('Drop', 'action', ClickLeft, 250)) then
        begin
          Result := True;
          Wait(RandomRange(50, 200));//Change this
        end;
      end;
    end;

    If you look at DropArray you can see that at the end it calls upon Dropitem. So I just figured I could edit that wait time and get results. Which it works
    I wear my scars like the rings on a pimp
    I live life like the captain of a sinking ship
    Always sell your product for ATLEAST mid to ensure that the market doesn't drop.

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
  •