external-plugins icon indicating copy to clipboard operation
external-plugins copied to clipboard

[Plank Sack] inaccurate counter

Open ste-h opened this issue 3 years ago • 3 comments

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

ste-h avatar Nov 14 '21 09:11 ste-h

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 avatar Nov 14 '21 13:11 Enriath

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

fltipotsch avatar Jan 17 '22 11:01 fltipotsch

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: https://github.com/Enriath/external-plugins/blob/264dc01439897b207adcae40fe4029685a9c7162/src/main/java/io/hydrox/planksack/PlankSackPlugin.java#L165)

  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 https://github.com/Enriath/external-plugins/blob/264dc01439897b207adcae40fe4029685a9c7162/src/main/java/io/hydrox/planksack/PlankSackPlugin.java#L200 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)

lasselindqvist avatar Nov 03 '23 11:11 lasselindqvist