elgbar / instant-inventory

Runelite plugin to instantly do inventory actions
https://runelite.net/plugin-hub/show/instant-inventory
BSD 2-Clause "Simplified" License
7 stars 0 forks source link

Missing support for more than one click in one game tick #22

Open Elite-Mercenary-Raven opened 1 month ago

Elite-Mercenary-Raven commented 1 month ago

The plugin (beneficially) supports clicking on the same equipment item more than once in the same tick, but I noticed that the icon doesn't update to match. This has been coming up a lot while fighting Tormented Demons lately, which reward quick and accurate switches. I might click a weapon and quickly click it again to undo that input (say if I anticipated incorrectly), but the icon doesn't update to reflect this. Rather, the icon only reflects the first input on that item for the duration of the value shown in the "Min Changed Millis" box. Hopefully this is a simple fix, where the icon automatically changes based on the last input rather than the first one in the allotted period. The equipment icon not changing to match my inputs has made me do double takes multiple times, and occasionally click again thinking a click didn't register. For reference I've been using all the default settings on a 20ms ping server.

As a related suggestion, I think other people might also enjoy the ability to toggle off the ability to input more than one interaction for an item in the same game tick. Personally I wouldn't use it, but it's more akin to what the vanilla client does so it has the advantage of familiarity.

Thanks a ton! Great plugin.

elgbar commented 1 month ago

Thanks for your report! Glad you like my plugin :)

If I understood correctly you'd like that clicking twice on an equippable item (e.g., a weapon or armour) within a game tick should be the same as not clicking it at all? I think that should be doable

I cannot stop any actual clicks going to the servers, only predict what the server will respond with. Sometimes this prediction is kinda hard to do, cause there are many exceptions to the general rule of when you can equip items (boss stunning comes to mind).

The Min Changed Millis together with Max Unmodified Ticks is used to correct any wrong predictions the plugin makes. Maybe double-clicking these items results in a bad predection. I'll look into it.

If you are able, could you upload a video showing the bug? see #11 for an example video, oh and it must be on the webm format. Or Post a youtube link

Elite-Mercenary-Raven commented 1 month ago

Yeah kind of! I think if you double click, both the first and second click should change the icon. So if I've got a Torva Platebody equipped and click my Masori Top in my inventory, as usual it'll instantly show the platebody in my inventory; but the new behavior would be that if I quickly clicked again, having done so during the delay period, it would still instantly show the Masori top. And so on for more clicks.

It is interesting though that with the plugin on or off the behavior of my clicks is different, if inputs aren't being changed somehow, they're being affected. I experimented for a bit and noticed that spam clicking with the plugin off just changes your equipment once every game tick, flipping between the platebody and top in this case. But spam clicking with the plugin on (with default settings) keeps the same item you have on equipped, if your clicks are consistently fast. It's more consistent the higher the value in Min Unchanged Millis. I actually like this behavior, being able to undo an input in one tick, because it lets me be a bit more predictive with my clicks! But I incorrectly assumed that an odd amount of clicks, usually 3, would produce the same final result as clicking once, and an even amount of clicks would produce the same result as if I hadn't clicked at all. I don't fully understand everything the plugin is doing, but it seems like it's affecting click outputs by changing available inputs. So because the "ghost" equipment icon is given that 300ms delay timer, clicking on that icon any number of times during that duration sends the server the same repeated output: that I want that item equipped again. At least I think that's what's happening!

I think it would be really cool if clicks beyond 2 had the expected behavior! Sometimes my quick clicks would have been benefitted by 3+ rapid inputs, like if I accidentally double click and go back to fix the error. Maybe changing the icon with every subsequent click produces that behavior automatically. If that's not possible then the best behavior would be if the plugin visually represents the maximum number of clicks, I suppose being 2 to undo an input in one game tick, temporarily locking in the icon of the expected final result with that 300ms timer, rather than the opposite result as it is currently.

I can definitely record a video but I think I can explain better what happens in one tick, with a Torva Platebody equipped and a Masori top in my inventory for example. This is all with default settings.

In the attached video I do a single click a few times, a double click a few times, then show different results of triple clicking.

Runelite 2024-07-16 21-45-32-1.webm

elgbar commented 1 month ago

Thanks for the extremely detailed report! I've also noticed the behaviour you've described, while play testing.

The bug is that the plugin behaves differently to the official client.

The definition of fixed should be that when clicking on an item multiple times in a single tick it should not change the item more than once

Elite-Mercenary-Raven commented 1 month ago

I'm glad to help! It's such a cool plugin!

I can't believe the double click functionality isn't intended, because it's so useful! I love that behavior! It is definitely helpful for fast paced content, helping maximize APM. The dream would be if 3+ clicks would be supported too, because then I could instantly fix accidental double clicks manually, and of course still have the freedom to do 2 (intentional) clicks in one tick if needed. I was farming Tormented Demons for maybe 5 hours last night and that triple click feature would have been useful a couple times for sure.

If it's possible I think people would like if both options are available using a toggle--where if someone wants they can opt for behavior that's less advanced like the official client; or they can opt to be able to input more actions in one game tick for tighter decision making.