Jump to content
ospaul

Better method to detect when an item is picked up?

Recommended Posts

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();
                    }

 

Link to post
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.

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...