Results 1 to 7 of 7

Thread: how do i drop?

  1. #1
    Join Date
    Jan 2012
    Posts
    30
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default how do i drop?

    im just starting this stuff and i read the tutorials on how to start off....i have a script that will chop the trees, however i was curious of how to drop the logs after the inventory was full, is there a tut out there that i missed, or can someone tell me how to do this? it will be greatly appreciated

  2. #2
    Join Date
    Dec 2011
    Location
    Ontario, Canada
    Posts
    1,735
    Mentioned
    5 Post(s)
    Quoted
    89 Post(s)

    Default

    Try using something like this:

    Simba Code:
    {*******************************************************************************                          
    procedure DropItem(i: Integer);
    By: Lorax
    Description: Drops item at given position (1-28)
    *******************************************************************************}

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

    Simba Code:
    {*******************************************************************************
    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;

    {*******************************************************************************
    procedure DropAllExcept(IgnoreInvSlots: TIntegerArray);
    By: Nava2
    Date: Dec 06, 2009
    Description: Drops everything in inventory. Ignores slots specified by
                 DontDrop array.
    *******************************************************************************}

    procedure DropAllExcept(DontDrop: TIntegerArray);
    var
      inv, i, h: Integer;
    begin
      h := high(DontDrop);
      for i := 0 to h do
        { Set the bit associated with the DontDrop Array }
        inv := inv or (1 shl DontDrop[i]);
      for i := 1 to 28 do
        { Check the bit at i, and if its high, then we dont drop. }
        if (((inv shr i) and 1) = 0) then
          DropItem(i);
    end;
    FEEL FREE TO PM ME ABOUT ANYTHING! Will help over Teamviewer...just ask!! "WITH A NEW QUESTION COMES A NEW CHALLENGE"
    Silentcore's AIO Service team !!! Pm me if you want questing done or service done or post on thread ofc

  3. #3
    Join Date
    Jan 2012
    Posts
    30
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ok thanks ill give it a try

  4. #4
    Join Date
    Jan 2012
    Location
    Minneapolis, Mn
    Posts
    185
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I like to use the DropAll or DropAllExcept functions.

  5. #5
    Join Date
    Dec 2011
    Posts
    23
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Simba Code:
    Procedure DropLogs;
     Var
     X, Y, LogDTM, I:Integer;
     SlotBox:TBox;
     LogPattern:TIntegerArray;



     Begin



      LogDTM := DTMFromString('mrAAAAHic42BgYHBhYmBwBGIvIA4CYlcgNgdiEyAOBOInQDW3gfgGEL8E4ndQDBJ/CsQmegJAkgkn5mLADxgJYBgAAPWmCfI=');
      LogPattern :=[1,5,9,13,17,21,25,2,6,10,14,18,22,26,3,7,11,15,19,23,27,4,8,12,16,20,24,28];
     For i:=0 to 27 do
      Begin

           StatsGuise('Dropping Log' + IntToStr(I));
          SlotBox:=InvBox(LogPattern[I]);
           If FindDTM(LogDTM,X,Y,SlotBox.X1,SlotBox.Y1, SlotBox.X2,SlotBox.Y2) Then


           MMouse (X, Y, 5, 5);
            Begin

             MouseItem (LogPattern[I],mouse_Right);
             ChooseOption ('rop' );
             wait (550 + random (50));


             FreeSRLBitmaps;
             MarkTime(TooLong);


           End;

      End;

    End;

    change the DTM with a higher colour tolerance, this was for willows

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

    Default

    Check out this video tutorial on how to make/use DTMs to find items:
    http://villavu.com/forum/showthread.php?t=68018

  7. #7
    Join Date
    Dec 2011
    Location
    East Coast, USA
    Posts
    4,231
    Mentioned
    112 Post(s)
    Quoted
    1869 Post(s)

    Default

    DropAll;
    GitLab projects | Simba 1.4 | Find me on IRC or Discord | ScapeRune scripts | Come play bot ScapeRune!

    <BenLand100> we're just in the transitional phase where society reclassifies guns as Badâ„¢ before everyone gets laser pistols

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
  •