Jump to content

Better method to detect when an item is picked up?


Recommended Posts

Posted

Hi all, currently checking when my player is on the same tile as a loot item to add the item value to my loot counter, however it seems that sometimes loot prices will be added an extra time dependent on if it was picked up first try or not, Current method:

 

if (item.interact("Take")) {
                        script.log(item.getName() + " val: " + script.itemValues.get(item.getName()) + " " + item.getAmount());
                        Sleep.sleepUntil(() -> !script.myPlayer().isMoving(), 1200);
                        if(item.getPosition().equals(script.myPosition()))
                            script.gpLooted+= script.itemValues.get(item.getName()) * item.getAmount();
                    }

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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