[Nexus] Simple scripts that you find helpful and that might help others!

Here's a quick one I like for automatically using my damage rage abilities.

Regex Trigger: Total: ([0-9]+)
Execute Script:
//Check rage, use abilities---------------------------------------------------
var rage = args[1];
if(rage >= 36){
    send_command("golem squeeze " + get_variable("tar"));
}else if (rage >= 14){
    send_command("cast windlash at " + get_variable("tar"));
}

I attempted to put this in a code block but it blew up the forums, not sure what's up with that.

Comments

  • edited July 2016
    Here's one for gathering all monsters that should be targetable in a room.  Looks like it refreshes when you enter a room, do a look, or quick look.  This will store all the ID's in ascending variables (tar0, tar1, tar2) for use by other scripts (like Stormhammer, which is what I use it for).  This code goes in the onGMCP Function.

    //Gather targets when entering a room
    if (args.gmcp_method == "Char.Items.List" && args.gmcp_args.location == "room") {
        var roomArray = args.gmcp_args.items;
        var filteredArray = [];
        
        for (index = 0; index < roomArray.length; ++index){
            if(roomArray[index].attrib != null){
                if(roomArray[index].attrib.search('m') != -1  && roomArray[index].attrib.search('x') == -1 && roomArray[index].name != "a crystalline golem"){
                    filteredArray.push(roomArray[index]);
                }
            }
        }
        
        for (index = 0; index < filteredArray.length; ++index) {
            set_variable("tar"+index, filteredArray[index].id);
        }
    }
  • KlendathuKlendathu Eye of the Storm
    Raemond said:
    Here's one for gathering all monsters that should be targetable in a room.  Looks like it refreshes when you enter a room, do a look, or quick look.  This will store all the ID's in ascending variables (tar0, tar1, tar2) for use by other scripts (like Stormhammer, which is what I use it for).  This code goes in the onGMCP Function.

    //Gather targets when entering a room
    if (args.gmcp_method == "Char.Items.List" && args.gmcp_args.location == "room") {
        var roomArray = args.gmcp_args.items;
        var filteredArray = [];
        
        for (index = 0; index < roomArray.length; ++index){
            if(roomArray[index].attrib != null){
                if(roomArray[index].attrib.search('m') != -1  && roomArray[index].attrib.search('x') == -1 && roomArray[index].name != "a crystalline golem"){
                    filteredArray.push(roomArray[index]);
                }
            }
        }
        
        for (index = 0; index < filteredArray.length; ++index) {
            set_variable("tar"+index, filteredArray[index].id);
        }
    }
    You will also want something for the gmcp.Char.Items.Add for when wandering creatures enter, and gmcp.Char.Items.Remove for when creatures leave (either wandering or being killed) to keep your table up to date without having to wait for gmcp.Char.Items.List

    Tharos, the Announcer of Delos shouts, "It's near the end of the egghunt and I still haven't figured out how to pronounce Clean-dat-hoo."
  • Good idea, when that happens now I always just ql.  But it would be nice not to have to do that.
Sign In or Register to comment.