Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Plank Sack] inaccurate counter #63

Open
ste-h opened this issue Nov 14, 2021 · 3 comments
Open

[Plank Sack] inaccurate counter #63

ste-h opened this issue Nov 14, 2021 · 3 comments
Labels
bug Something isn't working plank-sack

Comments

@ste-h
Copy link

ste-h commented Nov 14, 2021

This issue is for the external plugin: Plank Sack
When quickly interacting with the plank sack (usually doing multiple actions a tick) the plank sack counter becomes inaccurate

Clip 1: https://streamable.com/r1oa9i
This clip shows that when planks are withdrawn + the plank sack is filled on the same tick, the counter becomes inaccurate
This happens every quick bank when the sack isn't full.

Clip 2: https://streamable.com/rejp18
Here's another example of emptying then quickly filling the sack, which also makes the count 0

Clip 3: https://streamable.com/zyxwfr
When clicking build multiple times on furniture without building it, the counter also becomes inaccurate

Hopefully these clips are helpful to you

@Enriath
Copy link
Owner

Enriath commented Nov 14, 2021

1 and 2 can't reasonably be fixed, due to the nature of how inventory tracking works.

3 is weird, and I can't get it to reproduce at all. It's also part of the nature of tracking this activity; nothing gives nice chat messages. It could maybe be triggered on a GameObjectChanged instead, which I might look into at some point, but if that doesn't work there's not really much that can be done.

@Enriath Enriath added bug Something isn't working plank-sack labels Nov 14, 2021
@fltipotsch
Copy link

fltipotsch commented Jan 17, 2022

Found a way to reproduce 3:
Spamclick the spot while holding the number key (e.g 3) to build -> you also won't build it if you keep clicking
This maybe could be fixed by reducing the counter once the xp drops

@lasselindqvist
Copy link

1 and 2 can't reasonably be fixed, due to the nature of how inventory tracking works.

3 is weird, and I can't get it to reproduce at all. It's also part of the nature of tracking this activity; nothing gives nice chat messages. It could maybe be triggered on a GameObjectChanged instead, which I might look into at some point, but if that doesn't work there's not really much that can be done.

1 should be improvable with ItemContainerChanged event (https://static.runelite.net/api/runelite-api/net/runelite/api/events/ItemContainerChanged.html) since it also triggers for bank. For the bank container, call getItems(), find all plank Items and check their new counts. The different is what was withdrawn to inventory. If need to know how many planks were there before the change, I guess you need to start recording that (unless there is some easy event for that https://static.runelite.net/api/runelite-api/net/runelite/api/events/package-summary.html) like has been done for inventorySnapshot.
(Handle bank change event here:

public void onItemContainerChanged(ItemContainerChanged event)
)

  1. Another easy improvement for some of the bugs is when Fill is clicked and not all planks are put to the sack. The plugin can check the inventory and see that there are planks left and figure out that the sack must be full even if the count was otherwise incorrect.
    (Fill is partly handle here
    if ((event.getId() == ItemID.PLANK_SACK && (event.getMenuOption().equals("Fill") || event.getMenuOption().equals("Empty")))
    Could have a isFill boolean and then in the event check if there are planks still in the inventory and mark the sack as full, if there are)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working plank-sack
Projects
None yet
Development

No branches or pull requests

4 participants