Jump to content

how should the script know how much items it mined


mousbros

Recommended Posts

1 hour ago, mousbros said:

thank you im gonna try that out

@Gunman

case "MINING":
            final Area MINING_AREA1 = new Area (2982,3233,2990,3242);
            int ItemsMade = 0;
            
            if (!getInventory().isFull()) {
            if(MINING_AREA1.contains(myPosition()) && (getInventory().contains("Bronze pickaxe"))){
                RS2Object ore = getObjects().closest(11362,11363);                
                if (ore != null) {                    
                    log ("Found ore");
                    if (!myPlayer().isAnimating()) {
                        if (!myPlayer().isMoving()) {                                                        
                            ore.interact("Mine");
                            antiban();
                            ItemsMade += 1;
                            log("Made an item");
                        if (ItemsMade == 5) {
                            log("Walking to Draynor");
                            getWalking().webWalk(Banks.DRAYNOR);
                            }
                        }
                    }
                }
            }
        }

I did something like this, knows when the item is made cuz I see the log.

but it doesnt go to the draynor after 5 ''items are made''

 

Edited by mousbros
  • Like 1
Link to comment
Share on other sites

12 minutes ago, Gunman said:

@mousbros Pretty sure you're reseting the counter every time at the start of the case. Log the int at the start of the case and the end and see if it is being reset each time. Also you can do ItemsMade++; instead of ItemsMade +=1;

yea your right, dumb of me. it just goes to 0 when the loop starts again. is there any trick that I can make it remember it how many times it did the loop

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...