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

Creating triggers on the fly in Nexus?

TsuujinTsuujin Posts: 11Member
I'm looking to build myself a player name highlighter that isn't wildly inefficient, and I can't seem to find any documentation on creating a new trigger and deleting existing ones via scripting. Is there documentation somewhere for this, or is it even possible via the official API? 

I can always just monkey patch the client object and try to replicate the existing reflex patterns there, but I'd rather not do that if there are official means available.


  • JhuiJhui Posts: 1,958Member @@ - Legendary Achaean
    I haven't touched this in a while.. had good intentions when I started but this system might save you a lot of work if you want to pull from it and use anything from it.. lacks a few structural things that you are probably better than me at because I was relatively new to JavaScript and was using this as a learning tool

  • TsuujinTsuujin Posts: 11Member
    @Jhui Thanks for the reference. Can you point out where in there you're creating new triggers on the fly?
  • JhuiJhui Posts: 1,958Member @@ - Legendary Achaean
    I think in the highlighting stuff. If it's not included I might have to log in to my actual profile and figure out where I did it 
  • AustereAustere TennesseePosts: 2,185Member @@ - Legendary Achaean
    Jhui said:
    I think in the highlighting stuff. If it's not included I might have to log in to my actual profile and figure out where I did it 
    Someone should report this.  Pretty sure @Jhui doesn't login this late.  Obviously hacked account.

    (Hi Jhui) 
  • LockiLocki Posts: 9Member
    I realize I'm necro-ing this post, although there have been a few new ways to tackle this problem. By this problem I mean, highlighting adventurer names in larger blocks of text. 

    With the addition of Nexus Event triggers, you can use the onGMCP message or trigger line gained when a person enters the room, adding them to an array of names. Using a similar "Event trigger" for blocks of text, you can create a condition that allows for any names that are in a given array to be highlighted and rewritten within that blob on the main console. Although you will need to learn how to first separate blobs/strings of text into arrays of single words, and then cross reference them with your saved name list. 

    var words = 'never forget to empty your vacuum bags',
        wordArray = words.split(' ');
    console.log(wordArray); // ["never", "forget", "to", "empty", "your", "vacuum", "bags"] 

    The other simpler option would be to create a script in onGMCP, that allows for targets who are dictated by in-room data; to be listed in a notice similar or at the end of our prompt. {Room.Players, Room.AddPlayer, Room.RemovePlayer} should be the correct incoming objects with all adventurer names.

    The benefit to doing it this way, is you can also filter your allies before showing the notice, allowing you to only see target-able enemies. Since you have the array of names at the ready, you can also make a keybind; that allows for the setting of each target in order; similar to the nexus' in-built "space+Tab to set adventurer target". Or you are able to simply re-target the next person when the first dies. Also having the names in the form of an array will allow you to shuffle, add to, or remove from, the kill order as you please. (Array functions are godly, splice, shift, unshift, push, etc.) https://www.w3schools.com/js/js_array_methods.asp

    • Example From Manual: Room.Players [{ "name": "Tecton", "fullname": "Tecton the Terraformer" }, {"name": "Cardan", "fullname": "Cardan, the Curious" }]

    Using this you will be able to have a list of target-able names, and if you are keen enough, the ability to target them by macro or using hyperlinks.
    I believe something like:
    • Room.Players.name = [namearray]; 
    • ((Manipulate how ever you want or not at all)); 
    • client.set_variable("inroom-enemy-name-array", namearray); 
    • client.print(namearray);
    Is the most simple method. 

    Regarding making triggers on the fly, I don't think it's possible to add/delete a trigger using in-built nexus functions. At best you can make triggers that have varied purposes and have them activate and deactivate as needed.

    This Nexsys system seems very well put together, although given how often the client updates; I don't know how difficult it is trying to keep active with a third party system. Is this system still working?
Sign In to Comment.