Bug Clicking

Discussion in 'Developer Support' started by Golden_w00k, Jun 15, 2019.

  1. Golden_w00k

    Joined:
    May 14, 2019
    Messages:
    7
    Likes Received:
    0
    So basicly I am creating a leaf cleaning bot that should be able to clean about 8 per second theoretically, however it takes a few moments before the herbs changes name / type when clicked even though you are able to continue clicking more leafs...


    What happens with my logic is that it continues to click the first leaf in the inventory till it changes type & then clicks the next. I want it to keep going after being clicked. Can anyone give me some help?

    Code (Text):
    1. public class CleanLeaf extends LeafTask {
    2.  
    3.     @Override
    4.     public void execute() {
    5.         // TODO:: Change up patterns, left->right->left->right , -----
    6.         //                                                      | ...||
    7.         //                                                      |    ||
    8.         //                                                      |    ||
    9.         //                                                       -----
    10.         SpriteItem leaf = Inventory.newQuery().names("Grimy irit leaf").results().sortByIndex().first();
    11.  
    12.         if (leaf != null){
    13.             leaf.click();
    14.              boolean crushing = true;
    15.              int prev_counter = Inventory.newQuery().names("Grimy irit leaf").results().size();
    16.              while (crushing){
    17.                  Environment.getBot().getLogger().info("Crushing");
    18.                  Execution.delay(100, 250, 158);
    19.                  int counter = Inventory.newQuery().names("Grimy irit leaf").results().size();
    20.                  // if (counter == prev_counter){
    21.                     //crushing = false;
    22.                  //}
    23.                  prev_counter = counter;
    24.              }
    25.         }
    26.     }
    27. }
    --- Double Post Merged, Jun 15, 2019, Original Post Date: Jun 15, 2019 ---
    I have tried debugging the "leaf" SpriteItem to see if there's any state I could look for but no success.
     

Share This Page

Loading...