Welcome to the Achaea Forums! Please be sure to read the Forum Rules.

Script To Client Command

GloriniferGlorinifer Member Posts: 22
How do I send a command to the game via a Java Script script in the nexus client settings?

Comments

  • ChubbsChubbs Member Posts: 111 ✭✭✭ - Distinguished
    send_command('Kick Thiev");
    Tysandr
  • GloriniferGlorinifer Member Posts: 22
    Chubbs said:
    send_command('Kick Thiev");
    thx, xD and that is for JS right?
  • TysandrTysandr Member Posts: 492 ✭✭✭✭ - Eminent
    Chubbs said:
    send_command('Kick Thiev");
    wow Chubbs, didn't even match your apostrophes. :tongue:
    "All we have to decide is what to do with the time that is given to us."

    Atalkez
  • ChubbsChubbs Member Posts: 111 ✭✭✭ - Distinguished
    Holy shit. I didn't notice. I'm a scrub.
  • GloriniferGlorinifer Member Posts: 22
    so i found a good resource ( https://nexus.ironrealms.com/Functions ) and it's showing stuff for things scripts already do, some useful like the interacting with the actual client. Do I have to use these funny ways of declaring variables and incrementing/decrementing stuff?
  • ChubbsChubbs Member Posts: 111 ✭✭✭ - Distinguished
    You don't have to use any of the variable functions, no. Only really need to set/get them if you want to save the state of something between play sessions. Don't have to use the rest of the mathematical operation ones at all.
  • GloriniferGlorinifer Member Posts: 22
    Ok thanks, setting up some defence reflexes and stuff to force me to run. I tend to lose sight of my health and die. This way I will move away and be like: WTF?! than realize my health is low lol
  • GloriniferGlorinifer Member Posts: 22
    //Enter the function here
    send_command('say It feels good to be back!');

    let toBeLoaded = [
        {'syntax': 'conjure cloak', 'cooldown': 3500},
        {'syntax': 'hide', 'cooldown': 4000},
        {'syntax': 'scales', 'cooldown': 3000},
        {'syntax': 'conjure ghost', 'cooldown': 3500}
    ];

    function loader(item){
        send_command(toBeLoaded[item].syntax);
        if (item >= toBeLoaded.length){
            return;
        } else {
            setTimeout(function(){loader(item++)}, toBeLoaded[item].cooldown);
        }
    }

    loader(0);


    this keeps looping the cloak part, I've adjusted stuff to try to get it but it ain't working very well xD
  • CooperCooper Member Posts: 5,673 @@ - Legendary Achaean
    I can't help with coding, but just wanted you to know that there is an in game curing system that can also be set up to handle defences. Have you tried looking into that? 

  • GloriniferGlorinifer Member Posts: 22
    edited August 23
    yes, I understand there is a in system curing thing but this is far more fun to setup


    edit: I found my issue, it seems to be resetting the item variable each time it is called, it should not be doing that though
  • AntoniusAntonius Member Posts: 5,040 @@ - Legendary Achaean
    I can help with coding. You need to understand what item++ is actually doing, because it isn't just incrementing the value of item by 1. It returns a value before the increment happens, so item++ will return 0 (which gets passed to the loader function when the timeout fires), and then uselessly increments its value by 1, storing that in the item variable.

    Just use item + 1 if you want the current value plus one.
    Tysandr
  • GloriniferGlorinifer Member Posts: 22
    ah thank you lol, the small things always mess me up and I spend hours scanning the my code. Some of them small things are quite painful to find
  • GloriniferGlorinifer Member Posts: 22
    edited August 26
    Yep, that worked. It seems to be running out of sync with the server maybe, because they all work fine except the one that apparently has a longer cooldown than on the website? Or that's a milisecond difference

    edit: NVM, seems to only happen if my wifi glitches. Might have to get a bit more complicated and go based on the ping
Sign In to Comment.