Auto-Battlerage script using Nexus simplified scripting (and a little GMCP)

edited July 21 in Tech Support
Hello! This took me a long time but I've gotten it to a decent place.

First, you will need this GMCP code, which I had to dig through the forums to luckily find! Copy and paste into the "onGMCP" group at the top of your reflexes tab.
if (args.gmcp_method == "Char.Vitals") {
    let rage = parseInt(args.gmcp_args.charstats[1].substring(6));
    set_variable("rage", rage);

This will pull your rage value from the client, which will allow you to make a more streamlined battlerage system. The benefit is that you can turn off battlerage messages! (otherwise, you will have to build the system off of text triggers from the battlerage messages, which totally works! But clutters your screen).

Next, you want to use an "(event) block of text received" reflex. The entire system will be based on this (ignore all my other triggers in this reflex group - they are old and were based off a system designed around text triggers, as described above. There were issues with it...). In short: when I have a target, every time text is received it will get my rage value, and if it does not meet any of these parameters (i.e. less than 14) it will stop. 

  1. The top If reflex (I think - it seems to work at least) stops this reflex if I do not have a target. Otherwise, when you finish killing the creatures in the room, you'll get hundreds of "you do not see that creature anywhere" sort of messages as your reflex goes berserk trying to use all your battlerage abilities on nothing 100+times before your rage runs out.
  2. Next, set up as many If reflexes as you need that will jump to the corresponding label for each of the battlerage abilities you want to be automatic. It is IMPORTANT to arrange them from most costly to least costly (battlerage, that is). Otherwise it will get stuck only trying to use the least costly ability at the top.

Now, for each ability create a label.
  1. The basic thing you expect is the command to use the battlerage ability on your target. However, your battlerage abilities have cooldowns. So you'll get some message saying "you can't use that ability again so soon" over and over and over.
  2. So create a variable that is 0 when on cooldown and 1 when it's not (name it anything).
  3. Place an If reflex at the beginning that stops the script if the cooldown variable is 0. If its not, it will proceed to send the command.
  4. Immediately modify the cooldown variable to 0 then wait for the duration of the ability's cooldown.
  5. After the cooldown's duration, modify the variable again to 1 which will make the whole section permissable again.
  6. Close the script sub-section with stop.

Repeat for each ability. So for your specific class you will need to use your own ability names, cooldown values, etc. 

The only thing I wish I knew how to do, for this AND my auto-attack-on-cooldown script, is to make them stop when there is no longer a creature in the room that fits the target...but oh well! It just means that once I have cleared a room, I get 1 or 2 messages saying "you don't see anything by that name here" or whatever. It's not too cumbersome.

Let me know if you have questions or tips for a better/more streamlined system. I hope this helps people like me who have drudged their way to figuring out Nexus's simplified scripting system without any coding experience.
Sign In or Register to comment.