Results 1 to 21 of 21

Thread: How to drop a specific item from the inventory?

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

    Default How to drop a specific item from the inventory?

    It can be based on spot number of the item?
    And also is there a simple resting function?
    Thanks in advance!

  2. #2
    Join Date
    Dec 2011
    Location
    -bash
    Posts
    515
    Mentioned
    0 Post(s)
    Quoted
    27 Post(s)

    Default

    You can get a DTM of the item and then use the following function:



    Simba Code:
    ItemName := DTMFromString('enter the DTM here');
    If FindDTM(ItemName, pX,pY,MiX1,MiY1,MiX2,MiY2) then
      begin
        HumanMMouse(pX, pY, 7, 7);
        ClickMouse2(False);
        MarkTime(T);
        Repeat
          Wait(25+Random(10));
        Until(ChooseOption('rop')Or(TimeFromMark(T)>2000));
    end;

    Or you can use this function found on SPS that will enable you to drop an item if you enter the slot the item is located in

    Simba Code:
    (*
    DropItem
    ~~~~~~~~

    .. code-block:: pascal

        procedure DropItem(i: Integer);

    Drops item at given position (1-28)

    .. note::

        by Lorax

    Example:

    .. code-block:: pascal

        DropItem(3);

    *)

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

    All you have to do is call the function with the item slot number like this
    Simba Code:
    Dropitem(22);

    Also anther option for if you are trying to drop all items in your invent maybe for a powerchopper or something

    Simba Code:
    (*
    DropAll
    ~~~~~~~

    .. code-block:: pascal

        procedure DropAll;

    Drops all items in inventory.

    .. note::

        by Rasta Magician

    Example:

    .. code-block:: pascal

        DropAll;

    *)

    procedure DropAll;
    var i: integer;
    begin
      for i:= 0 to 2 do
      begin
        DropPattern(Random(2) + 1);
        if InvCount = 0 then
          break;
      end;
    end;
    Last edited by Recursive; 05-21-2012 at 07:08 PM.

  3. #3
    Join Date
    Jan 2012
    Posts
    713
    Mentioned
    3 Post(s)
    Quoted
    9 Post(s)

    Default

    Quote Originally Posted by Ilya View Post
    It can be based on spot number of the item?
    And also is there a simple resting function?
    Thanks in advance!
    Is the resting for energy?

    And a simple drop spot in inventory I use is.

    Simba Code:
    InvMouse(RandomRange(1,28),3); // This will move a mouse from slot 1-28
    ClickMouse2(False);
    WaitOption('Drop');
    // the 1,28 are the slots so it can range from 1-28

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

  5. #5
    Join Date
    Jan 2012
    Posts
    160
    Mentioned
    0 Post(s)
    Quoted
    19 Post(s)

    Default

    Quote Originally Posted by GOOGLE View Post
    Is the resting for energy?

    And a simple drop spot in inventory I use is.

    Simba Code:
    InvMouse(RandomRange(1,28),3); // This will move a mouse from slot 1-28
    ClickMouse2(False);
    WaitOption('Drop');
    // the 1,28 are the slots so it can range from 1-28
    Exactly what I was looking for, Thanks!
    so 28,28 would drop the last item right?

    and resting is for energy.

  6. #6
    Join Date
    Jan 2012
    Posts
    713
    Mentioned
    3 Post(s)
    Quoted
    9 Post(s)

    Default

    Quote Originally Posted by Ilya View Post
    Exactly what I was looking for, Thanks!
    so 28,28 would drop the last item right?
    Yep

  7. #7
    Join Date
    Jan 2012
    Posts
    160
    Mentioned
    0 Post(s)
    Quoted
    19 Post(s)

    Default

    Quote Originally Posted by YoHoJo View Post
    I haven't gotten that far. Most of the script i'm working on comes simply from coordinates.

    So does a short resting function exist?
    Last edited by Ilya; 05-21-2012 at 07:03 PM.

  8. #8
    Join Date
    Feb 2012
    Location
    Somewhere, over the rainbow...
    Posts
    2,272
    Mentioned
    3 Post(s)
    Quoted
    45 Post(s)

    Default

    To rest, you just do:
    Simba Code:
    if RunEnergy(ALowNumber) then
      RestUntil(AHighNumber);

  9. #9
    Join Date
    Jul 2011
    Location
    /home/litoris
    Posts
    2,226
    Mentioned
    0 Post(s)
    Quoted
    159 Post(s)

    Default

    Quote Originally Posted by Ilya View Post
    I haven't gotten that far. Most of the script i'm working on comes simply from coordinates.
    It takes 10 minutes to learn DTMs, and it's definitely worth it.
    Miner & Urn Crafter & 07 Chicken Killer
    SPS BlindWalk Tutorial

    Working on: Nothing

    teacher in every art, brought the fire that hath proved to mortals a means to mighty ends

  10. #10
    Join Date
    Jan 2012
    Posts
    160
    Mentioned
    0 Post(s)
    Quoted
    19 Post(s)

    Default

    Quote Originally Posted by GOOGLE View Post
    Is the resting for energy?

    And a simple drop spot in inventory I use is.

    Simba Code:
    InvMouse(RandomRange(1,28),3); // This will move a mouse from slot 1-28
    ClickMouse2(False);
    WaitOption('Drop');
    // the 1,28 are the slots so it can range from 1-28
    its giving me an invalin number of parameters in the "waitoption drop" line.
    here is what i have.


    procedure DropShit;
    begin
    InvMouse(RandomRange(23,23),3);
    ClickMouse2(False);
    WaitOption('Drop');<--------------------HERE!
    InvMouse(RandomRange(24,24),3);
    ClickMouse2(False);
    WaitOption('Drop');
    InvMouse(RandomRange(27,27),3);
    ClickMouse2(False);
    WaitOption('Drop');
    end;

  11. #11
    Join Date
    Feb 2012
    Location
    Somewhere, over the rainbow...
    Posts
    2,272
    Mentioned
    3 Post(s)
    Quoted
    45 Post(s)

    Default

    In WaitOption - after drop put a comma followed by the maximum time you want to wait before dropping. So:
    Simba Code:
    WaitOption('rop', 3000);
    // removed the 'D' because it's a capital letter. 3000ms = 3seconds

  12. #12
    Join Date
    Jan 2012
    Posts
    160
    Mentioned
    0 Post(s)
    Quoted
    19 Post(s)

    Default

    Working like a charm.
    It's so great to have such a supportive and knowledgeable community.



    Is there a way at the bankscreen to deposit for example items 1-27 and keep 28?

    OR to repeat an action a set amount of times?
    for example Repeat..............
    Until (4) or something of that nature.
    Last edited by Ilya; 05-21-2012 at 08:29 PM.

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

    Default

    Check out Bank.Simba
    Simba Code:
    Procedure Deposit(SlotFrom, SlotTo: Integer; vType: Variant);

     Deposits from Slot to ToSlot.
      vType True = Deposit All. vType False = Deposit one by one.
      Any integer is deposit with Deposit X. (except for 5 and 10)

    .. note::

        Author: WT-Fakawi/PPLSUQBAWLZ/Stupid3ooo/Town
        Last Modified: Unknown

    Example:

    .. code-block:: pascal

        Deposit(1, 28, True);
    *)
    procedure Deposit(SlotFrom, SlotTo: Integer; vType: Variant);

  14. #14
    Join Date
    Jan 2012
    Posts
    160
    Mentioned
    0 Post(s)
    Quoted
    19 Post(s)

    Default

    Quote Originally Posted by YoHoJo View Post
    Check out Bank.Simba
    Simba Code:
    Procedure Deposit(SlotFrom, SlotTo: Integer; vType: Variant);

     Deposits from Slot to ToSlot.
      vType True = Deposit All. vType False = Deposit one by one.
      Any integer is deposit with Deposit X. (except for 5 and 10)

    .. note::

        Author: WT-Fakawi/PPLSUQBAWLZ/Stupid3ooo/Town
        Last Modified: Unknown

    Example:

    .. code-block:: pascal

        Deposit(1, 28, True);
    *)
    procedure Deposit(SlotFrom, SlotTo: Integer; vType: Variant);
    So for example would this deposit items 1-27 and keep 28 out?

    procedure Deposit;
    begin
    Deposit(1, 27, False);
    wait (2000);



    Edit:that didnt work.
    end;
    Last edited by Ilya; 05-22-2012 at 05:37 AM.

  15. #15
    Join Date
    Mar 2012
    Posts
    24
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Ilya View Post
    Working like a charm.
    It's so great to have such a supportive and knowledgeable community.



    Is there a way at the bankscreen to deposit for example items 1-27 and keep 28?

    OR to repeat an action a set amount of times?
    for example Repeat..............
    Until (4) or something of that nature.
    As for the first question, I still have not approached banking. But for the second question, you use a for loop:
    for example:

    Simba Code:
    var
      i, j: Integer;
    begin
      for i := 0 to j do
      begin
        //Do whatever you want to be repeated (j-i) times here
        //When this finishes, it will check if integer i is equal to j, and if it is
        //it breaks from the for loop and continues, if it isnt, it will add one unit
        //to i, and repeat whatever is in here until i is equal to j
      end;
    end;

    I hope you got that =D
    Projects Directory: http://subliment.co.cc/
    Latest News: Working on ZChopper
    ZChopper: The chopper that will chop, bank (or drop), and chop, forever (or till a random pops out)

  16. #16
    Join Date
    Jan 2012
    Posts
    160
    Mentioned
    0 Post(s)
    Quoted
    19 Post(s)

    Default

    Quote Originally Posted by Subliment View Post
    As for the first question, I still have not approached banking. But for the second question, you use a for loop:
    for example:

    Simba Code:
    var
      i, j: Integer;
    begin
      for i := 0 to j do
      begin
        //Do whatever you want to be repeated (j-i) times here
        //When this finishes, it will check if integer i is equal to j, and if it is
        //it breaks from the for loop and continues, if it isnt, it will add one unit
        //to i, and repeat whatever is in here until i is equal to j
      end;
    end;

    I hope you got that =D
    So would i have to specify what j equals to?
    for example to repeat 4 times would i have to do J=4 under constants?

  17. #17
    Join Date
    Mar 2012
    Posts
    24
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Ilya View Post
    So would i have to specify what j equals to?
    for example to repeat 4 times would i have to do J=4 under constants?
    It doesn't have to be a constant, but it can.

    You can have it be an integer straight out instead such as:
    Simba Code:
    ...
    for i := 0 to 3 do
    ...

    and to repeat 4 times you would have to make j equal to 3, because the zero counts as one time too. So to eliminate confusion, have it be like this ( with i being one):

    Simba Code:
    ...
    for i := 1 to 4 do
    ...

    So now, you can have the 4 without subtracting one unit from it.

    ~Subliment
    Projects Directory: http://subliment.co.cc/
    Latest News: Working on ZChopper
    ZChopper: The chopper that will chop, bank (or drop), and chop, forever (or till a random pops out)

  18. #18
    Join Date
    Jan 2012
    Posts
    160
    Mentioned
    0 Post(s)
    Quoted
    19 Post(s)

    Default

    Trying it now.
    Still looking for a way to deposit items 1-27 while bankscreen open.

  19. #19
    Join Date
    Jan 2012
    Posts
    468
    Mentioned
    3 Post(s)
    Quoted
    200 Post(s)

    Default

    just add a bank all option!
    then add a withdraw item!

  20. #20
    Join Date
    Aug 2007
    Posts
    429
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    Quote Originally Posted by Ilya View Post
    Trying it now.
    Still looking for a way to deposit items 1-27 while bankscreen open.
    SCAR Code:
    Deposit(1, 27, True);

  21. #21
    Join Date
    Feb 2012
    Location
    Denver, CO
    Posts
    863
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I've had some success with DTMs, which means a lot considering I know so little about scripting.

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
  •