Thread: Open-Sourced CS2Script editor

Results 1 to 8 of 8
  1. #1 Open-Sourced CS2Script editor 
    *breaks walking*

    Cody_'s Avatar
    Join Date
    Dec 2010
    Posts
    730
    Thanks given
    218
    Thanks received
    203
    Rep Power
    286
    The following will be a progress thread for my open sourced clientscripts editor.

    The aim will be for this editor to be used across revisions, though will be initially built for 727 and expanded upon from there.

    I urge anyone trying to learn how CS2 works to use this project. I will try and keep everything very simple and easy to understand.
    I will begin extensively commenting everything once I am near completion, so everyone can understand the reasoning behind everything.

    Another huge help for me during all of this has been the channel LowLevelJavaScript on Youtube: https://www.youtube.com/channel/UC56...09tlPTVOJiJ8Tw
    And particularly their series on building a VM in javascript: https://www.youtube.com/playlist?lis...CRJsEubS5NrQ9b

    There will be 2 main components to this editor.

    A parser to parse the scripts from plain text
    A decompiler to decompile the scripts to plain text

    Alright, onto the progress:

    Spoiler for parser:


    The language parser. Created in javascript, the parser uses a library called arcsecond to parse the language. The results are then encoded into the data to be packed into the cache and returned.
    Currently, most everything is supported, with only a couple features not yet added because I have decided not to yet. That said, I'm 100% certain there are small things that I have forgotten, and will be added later.

    Variable Creation
    Variable Assignation
    Creation and Assignation on same line
    Basic instructions (send_message, to_string, others to be added, when needed)
    Calling other scripts with parameters
    If statements
    Else if statements
    Multiple statements with ||
    Bracketed expressions with statements
    Multiple statements with &&
    Switch statements




    Spoiler for decompiler:

    The decompiler has been started and can be found at: http://github.com/pyragon/cs2-decompiler
    So far it can print out basic scripts, adding more statements/expressions isn't very hard, so I don't see it taking too long.
    After that it's really all about just making sure each instruction is added.

    TODO:
    Variable creation
    Variable assignation
    if statements (with 'else' statements, no 'else if' statements yet tho)
    while statements
    calc function calls
    Basic function calls
    Return statements (with values)
    Switch Statements
    Else if statements
    Multiple expressions in statement with || or && (|| should work already with how I made statements, but haven't tested so leaving red)
    Hooks

    Cleanup:
    Else if statements on same line
    variable creation/assignation on same line if possible




    Spoiler for Cross-Revision:

    An end goal of this project is to allow multiple revisions to use it.

    Unfortunately, the opcodes for instructions change every revision. It's quite a tedious task to find each one for a revision, almost like identifying every packet, except theres a lot more of them.
    As far as I know, there is no easy way to identify these, but if anyone knows how, I would love to learn so we can try and make this available to everyone.

    Once I am finished though, I will slowly try and identify some instructions for other revisions, and will at least get them started so others can continue to identify them for the revision that they would like.


    Spoiler for Media:

    Attached image
    Attached image


    Reply With Quote  
     

  2. Thankful users:


  3. #2  
    Registered Member
    Stugger's Avatar
    Join Date
    Apr 2016
    Posts
    208
    Thanks given
    119
    Thanks received
    294
    Rep Power
    358
    neat as far as locating instructions go, I would recommend doing something like this which allows testing any opcode on the fly with immediate results. I don't know how other revisions handle their client scripts but I would have to assume the system is generally the same.
    Reply With Quote  
     

  4. #3  
    Registered Member

    Join Date
    Jul 2013
    Posts
    119
    Thanks given
    12
    Thanks received
    50
    Rep Power
    83
    Opcodes will always be an issue, and trying to support them all would most likely delay release or require constant maintenance.

    When developing my tool, I found it was a lot easier to allow clients to specify a plugin for their specific read values. That way the opcodes for reading could be updated by a third party, rather than you (or the client). The plugin would specify the proper read values (and write values, if needed).

    Your app could have in-app support for opcodes which are supported by common revisions, so average users won't have to worry about defining their own read values for common revisions. You could define the common read values as your own plugin, which comes bundled with the app.
    Reply With Quote  
     

  5. #4  
    Registered Member
    Tamatea's Avatar
    Join Date
    Aug 2010
    Posts
    1,317
    Thanks given
    396
    Thanks received
    354
    Rep Power
    2457
    Good luck with this, I'm sure This could be a massive help
    Spoiler for sig too large:


    Attached image
    Attached image
    Reply With Quote  
     

  6. #5  
    *breaks walking*

    Cody_'s Avatar
    Join Date
    Dec 2010
    Posts
    730
    Thanks given
    218
    Thanks received
    203
    Rep Power
    286
    Decompiler has been started. Thread has been updated.
    Reply With Quote  
     

  7. #6  
    Registered Member

    Join Date
    May 2015
    Posts
    164
    Thanks given
    96
    Thanks received
    44
    Rep Power
    107
    Good luck. Maybe it could support 414 one day? Looks good so far. - Snow. =)
    Reply With Quote  
     

  8. #7  
    Blurite

    Corey's Avatar
    Join Date
    Feb 2012
    Age
    26
    Posts
    1,484
    Thanks given
    1,222
    Thanks received
    1,719
    Rep Power
    5000
    Quote Originally Posted by SnowEssence View Post
    Good luck. Maybe it could support 414 one day? Looks good so far. - Snow. =)
    Shouldn't be too difficult if you supply mapped instructions for 414.
    Attached image
    Reply With Quote  
     

  9. #8  
    *breaks walking*

    Cody_'s Avatar
    Join Date
    Dec 2010
    Posts
    730
    Thanks given
    218
    Thanks received
    203
    Rep Power
    286
    Bump.

    Now that we're working on clans and citadels on Darkan, we've been needing these a lot more, so i've fixed quite a few things with the decompiler. The parser will need to be updated to work again with the changes I've made to the decompiler, so I'll be doing that at some point soon.

    There are still some bugs to work out, and some cleanup to do, but almost everything is done now.
    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. Interface Editor (Open-source)
    By Greg in forum Projects
    Replies: 64
    Last Post: 11-01-2018, 11:18 PM
  2. Map Viewer / or / Editor Open source
    By Lmctruck30 in forum Requests
    Replies: 2
    Last Post: 12-30-2013, 04:23 AM
  3. Open Source Interface Editor
    By peterbjornx in forum Projects
    Replies: 10
    Last Post: 12-22-2008, 11:02 AM
  4. Replies: 3
    Last Post: 09-10-2007, 07:07 AM
  5. need open source web-client
    By disturbed 1 in forum Downloads
    Replies: 9
    Last Post: 07-05-2007, 07:33 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
  •