Question Best way to dropping?

Discussion in 'Developer Support' started by LucasSousa, Mar 9, 2017.

  1. LucasSousa

    Joined:
    Jan 25, 2015
    Messages:
    120
    Likes Received:
    18
    ForEach is better way to Dropping items?

    Actually I'm using a code like this below and the bot stills undropping some items.

    Code (Text):
    1.  
    2. for (SpriteItem x : Inventory.getItems()){
    3.  
    4.     if (x != null){
    5.  
    6.         if (x.interact("Drop")){
    7.  
    8.             Execution.delayUntil(() -> !x.isValid(), 1200);
    9.         }
    10.     }
    11. }
    12.  
    Has another way more efficiently to drop items or could this iteration wrong?
     
  2. Savior

    Savior Java Warlord

    Joined:
    Nov 17, 2014
    Messages:
    4,909
    Likes Received:
    2,752
    Dont use loops to interact with the game. Drop one item at once per loop.
     

Share This Page

Loading...