Results 1 to 11 of 11

Thread: DropAllEx(Skip: TIntegerArray);

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

    Default DropAllEx(Skip: TIntegerArray);

    I wanted to drop all items except a few, and noticed there wasn't a procedure made for that. You can use DropArray but I thought this is quicker.
    It can probably be improved. Would anyone use this?

    Code:
    {*******************************************************************************
    procedure DropAllEx(Skip: TIntegerArray);
    By: r!ch!e
    Description: Drops all items in inventory except values of Skip.
    *******************************************************************************}
    procedure DropAllEx(Skip: TIntegerArray);
    var
      i: Integer;
    begin
      for i := 1 to 28 do
        if not InIntArray(Skip, i) then
          DropItem(i);
    end;
    Last edited by EvilChicken!; 10-03-2009 at 10:44 PM.

  2. #2
    Join Date
    Jan 2008
    Location
    NC, USA.
    Posts
    4,429
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    SCAR Code:
    for i := 0 to 28 do
      if not InIntArray(Skip, i) then
        drop(i);
    Looks cleaner imo
    Anyways
    there was one of these already made
    Quote Originally Posted by irc
    [00:55:29] < Guest3097> I lol at how BenLand100 has become noidea
    [01:07:40] <@BenLand100> i'm not noidea i'm
    [01:07:44] -!- BenLand100 is now known as BenLand42-
    [01:07:46] <@BenLand42-> shit
    [01:07:49] -!- BenLand42- is now known as BenLand420
    [01:07:50] <@BenLand420> YEA

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

    Default

    Yeah, that does look a lot cleaner. Thanks.
    Do you mind pointing out what it is for future reference?

  4. #4
    Join Date
    May 2008
    Posts
    1,345
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    *chuckles* I made one of these a few years (*cough* one *cough*) back :P.

    http://www.villavu.com/forum/showthr...=DropAllExcept

    ~Sandstorm

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

    Default

    Lol, well great minds think alike.
    Guess I'll just use this in my own scripts then

  6. #6
    Join Date
    Jul 2007
    Location
    Norway.
    Posts
    1,938
    Mentioned
    3 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    procedure DropArray(InvSlots:TIntegerArray);


    In Inventory.scar.

  7. #7
    Join Date
    Oct 2006
    Location
    ithurtsithurtsithurtsithurts
    Posts
    2,930
    Mentioned
    7 Post(s)
    Quoted
    135 Post(s)

    Default

    Quote Originally Posted by EvilChicken! View Post
    procedure DropArray(InvSlots: TIntegerArray);


    In Inventory.scar.
    Um, you might wanna re-read the first post.

  8. #8
    Join Date
    Jul 2007
    Location
    Norway.
    Posts
    1,938
    Mentioned
    3 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by senrath View Post
    Um, you might wanna re-read the first post.
    I did.

    The function I posted takes the inverse input of his function. Instead of entering the skiparray, it takes the array of the items to be dropped.

  9. #9
    Join Date
    Oct 2006
    Location
    ithurtsithurtsithurtsithurts
    Posts
    2,930
    Mentioned
    7 Post(s)
    Quoted
    135 Post(s)

    Default

    Quote Originally Posted by EvilChicken! View Post
    I did.

    The function I posted takes the inverse input of his function. Instead of entering the skiparray, it takes the array of the items to be dropped.
    Then re-read it again:
    You can use DropArray but I thought this is quicker.

  10. #10
    Join Date
    Sep 2007
    Location
    British Columbia, Canada
    Posts
    4,047
    Mentioned
    1 Post(s)
    Quoted
    2 Post(s)

    Default

    Dropall isn't working for me.

    EDIT NVM.
    Not bad, but is it safe?
    Last edited by Main; 09-13-2009 at 08:36 AM.
    Oh Hai Dar

  11. #11
    Join Date
    Jul 2007
    Location
    Norway.
    Posts
    1,938
    Mentioned
    3 Post(s)
    Quoted
    0 Post(s)

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
  •