Repository navigation
feat: Grand Exchange (stockmarket) commands for 647 (0.7.6) - #22
Merged
Merged
Conversation
Eighteen server commands for rs-majula's 647 Grand Exchange, at 2193-2210 after sound_vorbis: - Reads, named as the 647 client names its own clientscript commands 3903-3913 (RuneLite's Opcodes.java, the 2019Scape client): stockmarket_getoffertype, _getofferitem, _getofferprice, _getoffercount, _getoffercompletedcount, _getoffercompletedgold, _isofferempty, _isofferstable, _isofferadding, _isofferfinished. - Not named by any source found (Jagex's leaked RuneScript, the OSRS and NXT clients, RuneLite, openrs2, Void), so named here in the same pattern: stockmarket_buy, _sell, _abort, _guideprice, and _gethistorytype, _gethistoryitem, _gethistorycount, _gethistorygold. Every one but stockmarket_guideprice (the world's price) needs active_player, as the inventory commands do; the dot forms need active_player2. Bumps the version to 0.7.6.
ultraviolet-jordan
approved these changes
Dec 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds 18 server commands for rs-majula's 647 Grand Exchange (rev 647, May 2011). Opcodes run 2193-2210, after
sound_vorbis. The version goes to 0.7.6, so merging this and pushing tagv0.7.6publishes the release that rs-majula's GE PRs need. Until then, rs-majula points at this branch with a[patch.crates-io]line.The commands
stockmarket_buy(int slot, obj, int count, int price)stockmarket_sell(int slot, obj, int count, int price)stockmarket_abort(int slot)stockmarket_getoffertype/getofferitem/getofferprice/getoffercount/getoffercompletedcount/getoffercompletedgold(int slot)stockmarket_isofferempty/isofferstable/isofferadding/isofferfinished(int slot)stockmarket_guideprice(obj)(int)stockmarket_gethistorytype/gethistoryitem/gethistorycount/gethistorygold(int index)Each command also has its dot form, which needs active_player2. The pointer rules follow the inventory commands (
inv_add,inv_del). Buy and sell are placed after the script has taken the coins or items itself. Nothing suspends.Where the names come from
The names were checked against the reference material we have:
Jagex leaks: the leaked RuneScript screenshots, plus the OSRS RuneScript transcriptions.
Clients: the NXT client's file names, RuneLite's
Opcodes.java, the 2019Scape client, openrs2, rs-deob and hdos.Servers: Void (rev 634).
The read commands take the client's own names for the same reads: its clientscript commands 3903-3913. RuneLite's opcode list (
STOCKMARKET_ISOFFERSTABLE = 3911etc.) and the 2019Scape client give the same names. 2019Scape says its names are "based on known leaks". Jagex's NXT source paths (rs2client/logic/stockmarket/,Stockmarket_Op.cpp) confirm "stockmarket" as Jagex's own word for the system.No source names a server-side GE command, so buy, sell, abort, the guide price and the history getters are named here, in the client's pattern. The history getters are for the clerk's History window, which the May 2011 RuneScape Wiki says shows the last five trades.
Tests
tests/server_pointer_test.rsstockmarket_commands_require_the_selected_player_but_not_the_guide_price: buy, abort, a status read and a history read warn withoutactive_player(dot forms without.active_player); the guide price doesn't.cargo test --lib opcodes(names and opcodes unique, constant per name) andcargo clippy --all-targets -D warningspass.main'ssrc/pointer.rs, the new test fails (no warning for the GE commands); with this PR it passes.After merging
Push tag
v0.7.6to publish (release.yml publishes on version tags). rs-majula then swaps its temporary[patch.crates-io]forrs-runec = "0.7.6".