|
This post is more a brain dump but I wanted to document how I reverse engineered the Sliding Puzzle interface in OSRS (rev 181). This tutorial will assume you are using RSMod but the concepts should be generic enough for any OSRS base.
I have written this tutorial in the same way that I discovered and solved each task required to get the puzzle properly drawing, you will notice that step 1 is left incomplete because step 6 comes full circle to complete it.
The Result
https://i.gyazo.com/cf2312cbd1584ab0...e2bd9632d6.mp4
Step 0 - Finding the interfaceId
Spoiler for Step 0:
Step 1 - Sending pieces to the client
Spoiler for Step 1:
Step 2 - Understanding the CS2 script
Spoiler for Step 2:
Step 3 - More CS2 Deciphering & Varp
Spoiler for Step 3:
Step 4 - CS2 Enums
Spoiler for Step 4:
Step 5 - Actually configuring the interface
Spoiler for Step 5:
Step 6 - Filling with Pieces
Spoiler for Step 6:
I hope someone can find parts of this tutorial useful! Let me know if there are any errors or inconsistencies as I have only spent a day on this stuff.
ah Taylor, the only bronzie thats not a brainlet![]()
Haven't seen a good tutorial in a long time, haha nice one![]()
This is super informative & useful. Thanks for this.
Decent, happy to see more people actually logically approaching these problems.
A few tips I can give on how to make this process easier would be regarding this:
You just did a string search on the CS2s to locate it, however there is a more logical approach to this. Just about all interfaces have some sort of an "on-load script" that is executed client-side when you open an interface. These scripts are what set all these "if_setonxtransmit" hooks and what effectively makes your client automatically listen to stuff like varps and container changes.
You can find out what scripts are linked to specific interface components through the definitions, there's a load of different Object arrays in there. Each of those is a static way to link specific CS2s with that component/interface.
You can find the same obfuscated code within your client, however this is the order in which these listeners are decoded within these component definitions.
This lets you extract the scripts that are linked to interfaces, I personally do it in a json format like this:
You can see that the on_load script in my extraction here has an id of 688 and that matches the id of the trail_slidepuzzle_init script in the repository.Code:{ "interfaceId": 306, "components": [ { "componentId": 0, "format": "New", "type": "Layer", "scripts": { "Load": { "scriptId": 688, "parameters": [ "306 << 16 | 4; 20054020", "306 << 16 | 2; 20054018", "306 << 16 | 3; 20054019" ] } } }, { "componentId": 1, "format": "New", "type": "Model" }, { "componentId": 2, "format": "New", "type": "Model" }, { "componentId": 3, "format": "New", "type": "Model" }, { "componentId": 4, "format": "New", "type": "Layer" }, { "componentId": 5, "format": "New", "type": "Graphic", "actions": [ "Close" ], "scripts": { "Op": { "scriptId": 29 }, "Mouse over": { "scriptId": 44, "parameters": [ "Param -> Bitpacked source component", 540 ] }, "Mouse leave": { "scriptId": 44, "parameters": [ "Param -> Bitpacked source component", 539 ] } } } ] },
kris is very right on this one, and if you feel uncomfortable going through obfuscated code / figuring out how an interface works, i strongly recommend using Admiraal Slee's interface editor. the editor allows you to load up an interface and instantly see how and which cs2 scripts are linked to a certain interface
Thanks Kris for the information that is really helpful to learn! Exactly the type of feedback I was looking for.
This is what i like, a good quality tutorial. Quality non-trash replies.
For a second i think rune-server has some hope left for the future.
Thank for this.
I was actually wondering the other day on how these worked and now i know!
Good work bro, well explained, thanks.
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |