Question Dropping items via inventory

Discussion in 'Developer Support' started by lollybot, May 4, 2016.

  1. Code (Text):
    1. for (SpriteItem i : Inventory.getItems("Iron ore")) {
    3.             Execution.delay(1000, 1500);
    4.             i.interact("Drop");
    5.         }
    6.         if(Inventory.contains("Iron ore"))
    7.             dropOre();
    I'm making a simple powerminer (Just trying to learn how to make bots), and I'm attempting to drop items from the inventory when full. The above works but it often misses items in the inventory hence why I attempted recursion, is there a better way to do it? Right now it looks clumsy.
  2. Only drop one item per loop, or generally speaking, only do one action (interacting, turning camera, etc) per loop.
    lollybot likes this.

Share This Page