Add Item Link plugin
Item Link Plugin
Link items in chat like WoW - Shift+right-click items to share them with detailed tooltips showing GE price, HA value, equipment stats, and more.
Features
- Share items by Shift+right-clicking and selecting "Link Item"
- Hover over item links to see detailed tooltips with:
- Grand Exchange price
- High Alchemy value
- Equipment stats (for equippable items)
- Item weight
- WoW-style rarity colors based on item value
- Works in all chat types including friends chat, clan chat, and private messages
- Live formatting while typing (shows colored item name instead of raw tokens)
- Formats item links in overhead text (speech bubbles)
Repository
https://github.com/NorbsCode/item-link
New plugin item-link: https://github.com/NorbsCode/item-link/tree/9e5d265eec8ec9a716bd4eba7eeae5d34cdc6dd7
This would be considered auto typing
Internal use only: Reviewer details Maintainer details
This would be considered auto typing
It just links an item in chat, it does not auto type the whole sentence and you cannot abuse it in any way. It's a plugin that is much needed in the Runelite community as people would love to be able to link items in chat like in other popular MMO's
You are programmatically setting the chatbox input text here - that is autotyping. Plugins are not allowed to modify the content of the chat input buffer whatsoever. The only way in which characters can make it into the input buffer is from users manually typing.
What would be allowed instead, if you wanted to accomplish this, is if you instead supported some sort of shorthand that the user typed in, that your plugin then expanded client-side only (again, you cannot modify outgoing messages as that is autotyping).
So something like the user entering foo bar baz !i500, and then if you receive a chat message with that macro pattern, you could expand it client side into foo bar baz [whatever item name] and add your tooltip.
If you are otherwise unwilling to modify your submission to comply with 3rd-party client guidelines then we'll need to close this PR.
You are programmatically setting the chatbox input text here - that is autotyping. Plugins are not allowed to modify the content of the chat input buffer whatsoever. The only way in which characters can make it into the input buffer is from users manually typing.
What would be allowed instead, if you wanted to accomplish this, is if you instead supported some sort of shorthand that the user typed in, that your plugin then expanded client-side only (again, you cannot modify outgoing messages as that is autotyping).
So something like the user entering
foo bar baz !i500, and then if you receive a chat message with that macro pattern, you could expand it client side intofoo bar baz [whatever item name]and add your tooltip.If you are otherwise unwilling to modify your submission to comply with 3rd-party client guidelines then we'll need to close this PR.
Okay, thanks. Let me think of another way and I'll resubmit.
You are welcome to leave this pull request open and just update the commit hash.
@riktenx Found a better way. I removed the automatic insert of text into the chatbox. The item will be highlighted automatically when the user sends a message, for example. Hey, I just got an Abyssal Whip!
The tooltip will automatically appear in the message (as before) just without breaking the auto typing rule, everything is manual now. Hope this is better! Thanks again.
this startup bulk read from cache may cause you some performance issues but there's not really a better way to do it that i'm aware of so i'm gonna merge this for now
this startup bulk read from cache may cause you some performance issues but there's not really a better way to do it that i'm aware of so i'm gonna merge this for now
Would this be the cause of enabling the plugin and typing something in the chat to make it take effect making my game sit at a constant 60 fps to drop down to 7-8 fps even persisting after restarting RuneLite? Disabling the plugin restored my fps
I found the issue and now can confirm there is zero FPS drops.
The Root Cause was:
The overlay's render() method was running expensive operations every frame (60+ FPS):
- Scanning 90+ chat widgets with regex matching on each
- Rebuilding tooltip strings every frame
- No caching of results
Fixes Applied
- Overlay Optimization (ItemLinkOverlay.java)
- Added mouse position caching - only re-scan widgets when mouse moves >2px
- Check widget bounds FIRST, run regex only on the widget under the mouse
- Cache tooltip text and reuse when nothing changes
- String Matching Optimization (ItemLinkPlugin.java)
- Replaced O(N×M) character-by-character scanning with word-boundary HashSet lookups
- Single-word items: O(1) lookup
- Multi-word items: prefix map indexed by first word
- Chunked Item Loading
- Load 30,000 items in chunks of 2,000 to prevent login freeze
Additional Update
- Changed from ScriptCallbackEvent to ChatMessage event
- Now only highlights player messages (public, private, clan, friends chat)
- Skips system messages, examine text, NPC dialogue, etc.
The plugin is a lot more polished and there are no more FPS drops at all, not even when loading into the game. Pushing the plugin for review again.
this startup bulk read from cache may cause you some performance issues but there's not really a better way to do it that i'm aware of so i'm gonna merge this for now
Would this be the cause of enabling the plugin and typing something in the chat to make it take effect making my game sit at a constant 60 fps to drop down to 7-8 fps even persisting after restarting RuneLite? Disabling the plugin restored my fps
Fixed :)