Dismiss Notice
Wynncraft, the Minecraft MMORPG. Play it now on your Minecraft client at (IP): play.wynncraft.com. No mods required! Click here for more info...

SPOILER Wynnscript's Workings [UPDATED!]

Discussion in 'Wynncraft' started by Endistic, Mar 12, 2023.

Thread Status:
Not open for further replies.
  1. Krooza

    Krooza Professional dumbass

    Messages:
    463
    Likes Received:
    666
    Trophy Points:
    71
    Guild:
    Minecraft:
    Ew, coding is too complicated for my peanut brain
     
    Stag2001 and TrapinchO like this.
  2. SSurvivor64

    SSurvivor64 Watcher of the Realm

    Messages:
    30
    Likes Received:
    59
    Trophy Points:
    33
    Guild:
    Minecraft:
    i was making a dumb script to grow xb's brain to at least the size of a walnut when i realized a couple things:
    upload_2023-3-26_8-18-11.png
    only double quotes work...
    it doesn't highlight operators for some reason
    this new file is missing some stuff that i think i remember the old one having (but maybe that was sockmower's extension), namely include and wait.
    #using treats anything after it as a string (maybe this is actually being used instead of include now)
    strings are capable of spanning multiple lines
    it correctly highlights curly brackets in a string different, but as soon as i put anything in there, it goes back to string color

    Edit: I also confirmed that second type rule is used for function parameters, but it weirdly seems to work when calling functions too (i.e. Brain.of(User XB_Falcon) highlights User green)
     
    Last edited: Mar 26, 2023
  3. Endistic

    Endistic Acolyte Enjoyer HERO

    Messages:
    724
    Likes Received:
    1,300
    Trophy Points:
    148
    Guild:
    Minecraft:
    Hmmm perhaps. I doubt Wynnscript has tuples though, especially considering functions that take in a location don't take in a tuple. Also, function parameters are much more likely considering we have proof that WynnScript uses functions now.
    I could do this, I've made many-a interpreters and compilers in my life - some good, some bad. I'll only even try to recreate it if I get enough information to do this with enough confidence. Also I'm not sure if I'd even be allowed so I'd get Hams' or CT's permission first (since again, it is their thing, not mine. I'm just a curious fellow.)
    I didn't see a return keyword. Although I wouldn't be surprised if it was handled like Rust where:
    Code:
    fn add_one(mut input: i32) -> i32 {
           input+1
    }
    
    You have to not put a semicolon at the end of the expression to return it.
    ________________________________
    carbon(2).png

    Found this cool way to make pretty source code.
    No way to add Wynnscript Syntax Highlighting to it though, sad.
    ________________________________
    my cool code.png
    nvm i figured it out
     
    Last edited: Mar 26, 2023
    luckeyLuuk and TrapinchO like this.
  4. TrapinchO

    TrapinchO retired observer of the wiki VIP+ Featured Wynncraftian

    Messages:
    4,659
    Likes Received:
    6,581
    Trophy Points:
    217
    Minecraft:
    Oh, yeah, I didn't notice there were two identifiers and then a comma, I am stupid.
     
  5. shtnck eyh ckhhe

    shtnck eyh ckhhe Jesus of Nether-eth

    Messages:
    879
    Likes Received:
    1,888
    Trophy Points:
    148
    Minecraft:
    You can't really "confirm" anything from this. It's all just guesswork and applying conventional patterns. The syntax highlighter doesn't actually check that anything you've written is correct; it just looks for patterns, say, an opening parentheses followed by two identifiers, then makes that green or red or whatever.


    Or, alternatively- functions can't actually return anything. I feel it'd be kind of weird for them to have had function returns before they had addition, so maybe returns were just emulated via mutating a variable from outside of the function scope (or maybe mutating a parameter variable if they're pass by reference and not pass by value).


    Actually, now that I mention passing by reference/value- maybe the `(ident ident` syntax is for that, and not types. This'd also allow function param types to use the colon syntax, which would be more logical as it'd be consistent with variable declaration syntax.
    Code:
    fn foo(ref foo: int, val bar: int) {
        // ...
    }
    
    // makeshift return values?
    fn factorial(val n: int, ref ret: int) {
        if (n == 0) {
            ret = 1;
        } else {
            var res;
            factorial(n - 1, res);
            ret = n * res;
        }
    }
     
    Last edited: Mar 26, 2023
    luckeyLuuk and Endistic like this.
  6. Endistic

    Endistic Acolyte Enjoyer HERO

    Messages:
    724
    Likes Received:
    1,300
    Trophy Points:
    148
    Guild:
    Minecraft:
    I think your val/ref idea could be right.

    I found this in the ANTLR generated parser in bundle.js

    async __function(e, t, r, n) { let i = e.text, u = (await n.getCodeItems(r)).functions.find(x => x.name === i); if (u === void 0) return; let l = u.args.map(x => `${x.name}: ${x.type}`).join(", "), a = ue.mdCode(`fn ${i}(${l})`); return new ue(a, e) }

    And it's saying that types in functions are like "name: type"
     
  7. SSurvivor64

    SSurvivor64 Watcher of the Realm

    Messages:
    30
    Likes Received:
    59
    Trophy Points:
    33
    Guild:
    Minecraft:
    We're looking through bundle.js, here's the beautified version
    [Link removed per request]
    Most of the specific information like types and functions are in files in the repo, and it requires a directory called cStory to run, but it may have some syntactical answers.
     
    Last edited by a moderator: Mar 28, 2023
  8. Endistic

    Endistic Acolyte Enjoyer HERO

    Messages:
    724
    Likes Received:
    1,300
    Trophy Points:
    148
    Guild:
    Minecraft:
    What if we reconstruct the cStory folder from how its used in the bundle.js?
     
  9. Endistic

    Endistic Acolyte Enjoyer HERO

    Messages:
    724
    Likes Received:
    1,300
    Trophy Points:
    148
    Guild:
    Minecraft:
    Hi everyone! Small update.

    We're still working through bundle.js.
    It's an extremely laborious process - we have to go through several THOUSANDS of obfuscated lines of code if we want to figure it all out. When we do though, we should know everything we can possibly know, besides in bundle.web.js but that feels like a waste of time.

    However, a link to the beautified bundle.js posted by Surv was taken down per someone's request. Whose? I'm not sure. So to the mods I inquire, whose request was it and why was the link removed?

    I'm not gonna repost the link in this just to be safe.
     
    luckeyLuuk likes this.
  10. shtnck eyh ckhhe

    shtnck eyh ckhhe Jesus of Nether-eth

    Messages:
    879
    Likes Received:
    1,888
    Trophy Points:
    148
    Minecraft:
    I got the extension to work...

    upload_2023-3-29_21-46-57.png
     
    luckeyLuuk, TrapinchO and Endistic like this.
  11. Endistic

    Endistic Acolyte Enjoyer HERO

    Messages:
    724
    Likes Received:
    1,300
    Trophy Points:
    148
    Guild:
    Minecraft:
    YOOOOOO
    Also I got a rest day from school today so I can help figure things out sooner and not later
     
  12. Endistic

    Endistic Acolyte Enjoyer HERO

    Messages:
    724
    Likes Received:
    1,300
    Trophy Points:
    148
    Guild:
    Minecraft:
    So Thomka's extension 0.7.0 was released.
    No new straight-up syntax leaks but there is new stuff to the parser I'm investigating with StinkEyeCookie.

    Also new cStory needs an 'uwu' field.
    WHduyg32iud23d32kjdhklasdd3ed32d23d3

    Edit: We found one possible solution to the uwu field and we're testing it right now.
    Edit 2: Turns out the extensions broke because of an error in the code unrelated to us.
    Edit 3: Nope, it's us. Looked into it more. `uwu` field is not correct. Back to figuring things out.
    Edit 4: We're got in a bit of a loop but we're recoving. There's this one line that's really tricky.
    Edit 5: Turns out the nonsense string we had decodes to "you better be from the content team if you're looking at this string"
    well A. I have bad news for you Thomka and B. thanks to SSurvivor64 for decoding this message
     
    Last edited: Mar 30, 2023
    luckeyLuuk likes this.
  13. shtnck eyh ckhhe

    shtnck eyh ckhhe Jesus of Nether-eth

    Messages:
    879
    Likes Received:
    1,888
    Trophy Points:
    148
    Minecraft:
    btw if you just replace the `W.uwu !== A1` with just `false` you dont even need the uwu string
     
    luckeyLuuk and Endistic like this.
  14. Thomka

    Thomka QA CMD CHAMPION

    Messages:
    166
    Likes Received:
    921
    Trophy Points:
    75
    Minecraft:
    Maybe it was all just a dream..
     
    shtnck eyh ckhhe likes this.
  15. Endistic

    Endistic Acolyte Enjoyer HERO

    Messages:
    724
    Likes Received:
    1,300
    Trophy Points:
    148
    Guild:
    Minecraft:
    1.0.0 IS OUT
    FHUJIEWhy798f uij3h4jmn34hbfmn34bkjf34nkjf34n3j4hfj34m

    @StinkEyeCookie GET OVER HERJKLE g43ythjdfk34jko;lfr34f34f34f43f34234f
    ________________________________
    WHAT DID YOU DOOOO
    IT WENT FROm 1MB TO LIKE 30KB
    ________________________________
    thomka done change the cStory fr!
    ________________________________
    they moved the parser over to a seperate file in the cStory.
    we do not have the 1.0.0 parser.
    this is so sad can we get 1 like
     
    Last edited: Apr 1, 2023
    luckeyLuuk and Thomka like this.
  16. Thomka

    Thomka QA CMD CHAMPION

    Messages:
    166
    Likes Received:
    921
    Trophy Points:
    75
    Minecraft:
    Glad you asked! Here's a changelog:
    - added features
    - removed bugs
    - prevented future leakage
    - made the bundle weight less (<1 KB!) for blazingly fast performance
     
  17. Endistic

    Endistic Acolyte Enjoyer HERO

    Messages:
    724
    Likes Received:
    1,300
    Trophy Points:
    148
    Guild:
    Minecraft:
    AK VIDAR
    ________________________________
    well, today's a good day to have backups of previous versions
     
    luckeyLuuk likes this.
  18. Jakacraft

    Jakacraft Vibing CHAMPION

    Messages:
    39
    Likes Received:
    23
    Trophy Points:
    51
    Minecraft:
    I always wanted to figure this out. Did all the work for me :)
     
    Endistic likes this.
  19. shtnck eyh ckhhe

    shtnck eyh ckhhe Jesus of Nether-eth

    Messages:
    879
    Likes Received:
    1,888
    Trophy Points:
    148
    Minecraft:
    some evidence supporting this theory

    upload_2023-4-7_20-51-50.png

    upload_2023-4-7_20-52-3.png
     
    Endistic and luckeyLuuk like this.
  20. Endistic

    Endistic Acolyte Enjoyer HERO

    Messages:
    724
    Likes Received:
    1,300
    Trophy Points:
    148
    Guild:
    Minecraft:
    Also, for anyone wondering what's been happening for the past week or so & possible futures of this thread:
    - We're looking even furhter into bundle.js. We suspect we've probably hit our limit of what we can find from it and thread will be updated sometime soon. We're also looking into messages on Wynncord for possible leaks.
    - 1.0.0 of the extension released, so the 0.7.0 bundle.js is the latest we have access to.
    - Me and @Earthbrine are planning a collaboration for a youtube video covering eveyrthing here in much better detail - I'm a lot better at explaining thinmgs with visuals than with text as I think in pictures and not words. We're gonna call about it sometime soon and plan everything out we want.
    - I have this old GM app (btw CT this is not asking for my app to be accepted/rejected - i am just stating information. i'm fine if it takes a while lol, i am busy anyways until summer) and I realize if I get accepted onto CT I'll have the answers but I can't post them here, meaning I wouldn't be allowed to participate. I'm not really sure what I'll do if this does occur, but I'll probably ask some of the CT what I should do since this would be a very strange situation.
    - We have this idea where I attempt to write a basic intepreter for WynnScript although this does have some concerns, namely that I don't want to invade the CT's privacy too much. Based off earlier incidents I fear this would cross some kind of line. I'll probably message CT to see hwta is alright with this & what isn't, but no guarantees or promises this will be made.
     
Thread Status:
Not open for further replies.