Thread: 910 Decompiled ClientScripts

Results 1 to 10 of 10
  1. #1 910 Decompiled ClientScripts 
    Forum Moderator



    Polar's Avatar
    Join Date
    Sep 2015
    Age
    25
    Posts
    389
    Thanks given
    0
    Thanks received
    400
    Discord
    View profile
    Rep Power
    2955
    Walied and I (mainly Walied) have modified RuneStar/cs2 to work with RS3. This has all 14313 scripts decompiled from revision 910.

    https://mega.nz/file/UkxxEZRT#Je0hDb...7t23q9-CjtIfFE

    Example script:
    Code:
    // 8233
    script8233(struct $struct0, inv $inv1, obj $obj2, int $int3)(obj, int)
    if ($int3 = 0) {
    	~script12478("Increment of 0 - would be an infinite loop. Breaking out.");
    	return(null, -1);
    }
    def_int $int4 = 0;
    def_obj $obj5 = null;
    switch_int (oc_param(param_3744, $obj2)) {
    	case 0 :
    		$obj5, $int4 = ~script8234($struct0, $inv1, 4, 11, $int3);
    	case 1, 2, 4, 5, 8 :
    		$obj5, $int4 = ~script8234($struct0, $inv1, 8, 11, $int3);
    		if ($obj5 = null) {
    			$obj5, $int4 = ~script8234($struct0, $inv1, 12, 17, $int3);
    		}
    	case 6 :
    		$obj5, $int4 = ~script8234($struct0, $inv1, 12, 17, $int3);
    	case 3, 7 :
    		$obj5, $int4 = ~script8234($struct0, $inv1, 10, 11, $int3);
    	case 9 :
    		$obj5, $int4 = ~script8234($struct0, $inv1, 13, 17, $int3);
    }
    return($obj5, $int4);
    Last edited by Polar; 04-15-2020 at 12:22 PM. Reason: Updated link with slightly modified output
    Reply With Quote  
     


  2. #2  


    Jigsaw's Avatar
    Join Date
    Jan 2011
    Posts
    451
    Thanks given
    284
    Thanks received
    231
    Discord
    View profile
    Rep Power
    1025
    My man


    Reply With Quote  
     

  3. #3  
    Registered Member
    Ynneh's Avatar
    Join Date
    Mar 2010
    Posts
    2,211
    Thanks given
    156
    Thanks received
    260
    Discord
    View profile
    Rep Power
    229
    Good stuff
    Reply With Quote  
     

  4. #4  
    Donator
    The Stoned's Avatar
    Join Date
    Jan 2013
    Posts
    619
    Thanks given
    56
    Thanks received
    76
    Rep Power
    58
    I am beginning to get into the client side of development, and want to learn more. Can someone explain the significance of the client scripts, and how the client interacts with them?
    Reply With Quote  
     

  5. #5  
    Registered Member
    Melvin's Avatar
    Join Date
    Aug 2011
    Posts
    1,019
    Thanks given
    504
    Thanks received
    336
    Rep Power
    1001
    damn communist ffs


    A creative man is motivated by the desire to achieve, not by the desire to beat others.


    ― Ayn Rand
    Reply With Quote  
     

  6. #6  
    Community Veteran

    Jake_'s Avatar
    Join Date
    Apr 2007
    Age
    28
    Posts
    2,048
    Thanks given
    18
    Thanks received
    80
    Discord
    View profile
    Rep Power
    253
    Quote Originally Posted by The Stoned View Post
    I am beginning to get into the client side of development, and want to learn more. Can someone explain the significance of the client scripts, and how the client interacts with them?
    CS2 is a proprietary Jagex scripting language. Some scripts are called intermittently by the client, some are invoked by the server, some invoked every cycle. Some are used to render UI, some set variables.

    The whole system is a monstrosity but it's pretty versatile all things considered.

    Here's the OSRS CS2: https://github.com/RuneStar/cs2-scripts
    This one for example renders the tooltips in the autocasting interface when you mouse-over the sprites: https://github.com/RuneStar/cs2-scri...tooltip%5D.cs2
    (Sorry for OSRS example, I haven't really looked at RS3 clients in years)

    There's a good explanation of the syntax and control flow semantics here: https://github.com/RuneStar/cs2/blob/master/README.md
    Reply With Quote  
     

  7. Thankful user:


  8. #7  
    Donator
    The Stoned's Avatar
    Join Date
    Jan 2013
    Posts
    619
    Thanks given
    56
    Thanks received
    76
    Rep Power
    58
    With most of the references coming from OSRS, how does CS2 differ between the 2? For example, I am working with a 876 java client and am interested in updating to 910. How would the client scripts be used differently when getting into 900+ level revisions.

    In addition, how involved are client scripts when looking into NXT clients down the road?
    Reply With Quote  
     

  9. #8  
    Community Veteran

    Jake_'s Avatar
    Join Date
    Apr 2007
    Age
    28
    Posts
    2,048
    Thanks given
    18
    Thanks received
    80
    Discord
    View profile
    Rep Power
    253
    Quote Originally Posted by The Stoned View Post
    With most of the references coming from OSRS, how does CS2 differ between the 2? For example, I am working with a 876 java client and am interested in updating to 910. How would the client scripts be used differently when getting into 900+ level revisions.

    In addition, how involved are client scripts when looking into NXT clients down the road?
    CS2 is CS2.

    I assume semantics are the same regardless of which client revision you look at, the difference (if any?) would probably be that the CS2 interpreter in NXT clients might have larger set of instructions but that's just a guess sorry.

    The challenge is that they seem to shuffle (or change?) the CS2 instruction opcodes regularly, so any compiler/decompiler you maintain would need to be updated when you change revision(which is a sincere PITA).
    Reply With Quote  
     

  10. #9  
    Registered Member

    Join Date
    Nov 2014
    Posts
    57
    Thanks given
    22
    Thanks received
    87
    Rep Power
    215
    Quote Originally Posted by The Stoned View Post
    With most of the references coming from OSRS, how does CS2 differ between the 2? For example, I am working with a 876 java client and am interested in updating to 910. How would the client scripts be used differently when getting into 900+ level revisions.

    In addition, how involved are client scripts when looking into NXT clients down the road?
    There's not many differences. The biggest differences:
    - RS3 has three stacks (Int, Long, Object). I think OSRS has two (Int, Object). I don't know much about the OSRS client
    - RS3 CS2 opcodes are scrambled, meaning the opcodes differ between gamepacks and revisions. In OSRS the CS2 opcodes are not scrambled.

    Other than that both RS3 and OSRS have their own instruction sets. A lot of opcodes are shared, but there's also a lot of instructions that are exclusive to either RS3 or OSRS that are added later on.

    Like Jake said, CS2 is CS2 though. It's stack-based on both RS3 and OSRS. If you understand how OSRS handles CS2, you understand how RS3 handles it, and vice-versa.

    As for NXT, NXT uses the same executor as the Java version. Scripts served to the Java client and the NXT client are identical. Except for the opcode scrambling of course.
    Reply With Quote  
     

  11. Thankful user:


  12. #10  
    Registered Member
    Join Date
    Apr 2017
    Posts
    16
    Thanks given
    8
    Thanks received
    6
    Rep Power
    18
    Very nice! I remember when I did that and the main problem was with the all the function names and cache variable types.
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. [592] clientscripts decompiled
    By Teemuzz in forum Requests
    Replies: 2
    Last Post: 01-25-2019, 04:09 AM
  2. [#154/CS2] OSRS Decompiled ClientScripts
    By Vincent in forum Downloads
    Replies: 6
    Last Post: 10-31-2018, 02:48 PM
  3. [667/CS2] Decompiled Clientscripts
    By Vincent in forum Downloads
    Replies: 19
    Last Post: 09-06-2017, 06:23 PM
  4. [592] Clientscripts decompiled
    By Teemuzz in forum Requests
    Replies: 2
    Last Post: 12-03-2016, 04:03 PM
  5. ClientScript 2 Decompiler
    By Velocity in forum Show-off
    Replies: 4
    Last Post: 03-15-2014, 10:32 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •