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.
0
Answers
https://github.com/jhuiAchaea/Nexsys
(Hi Jhui)
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.
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
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?
Enough about that, now about triggers. The way nexus works is when you connect, it runs a script of all your stuff - settings, plugins, etc - which sets up the webpage in your browser that is the nexus client accordingly. This means all your triggers and aliases and whatnots, are loaded by javascript, so you can make (or delete them) as you wish with the same javascript. All the code for it is in the client already which you can get by saving the webpage (file>save-page-as or ctrl+s) and cracking open the js files.
Bonus: adding a trigger with script, just adds a trigger... to the webpage you have loaded. It won't be there the next time you load nexus, unless you force a save settings to send that updated plugin info to the achaea settings server. There is a simple function for this actually built already into nexus already, but i can't remember if it's in the client page code or the settings page code (probably the settings page).
Currently available: Abs, Cnote, Keepalive, Lootpet, Mapmod
Unfortunately, I had built my entire plugin to work around the CORS issue (which it did) and then they made the game server secure, which tanked the plugin. Now you wouldn't need any of the long-winded workarounds I had to fuddle with - it would be much easier.
Currently available: Abs, Cnote, Keepalive, Lootpet, Mapmod