Infinitay / essence-pouch-tracker

A RuneLite plugin that tracks both the amount of essence stored in your essence pouches and the amount of essence until decay.
https://runelite.net/plugin-hub/show/essence-pouch-tracking
BSD 2-Clause "Simplified" License
0 stars 1 forks source link

Issue with checking and quickly filling pouches #19

Closed Infinitay closed 1 month ago

Infinitay commented 1 month ago
  1. Check a pouch
  2. Quickly fill the pouch immediately afterwards

The following steps above results in an incorrect state. Since the check chat message comes on the next game time, it will override the stored essence after filling

For example:

  1. Check a pouch that has 0 essence -> Do nothing as we are waiting for the game to return the chat message
  2. Quickly fill a pouch with 12 essence -> Set the stored essence to 12
  3. Chat message is received the next tick -> Set the stored essence to 0 because that's what the game returned

It's a race condition by the game essentially due to the check pouch taking a game tick but pouch actions happen immediately.