• You've discovered RedGuides, an EverQuest multi-boxing and scripting community 🧙‍♀️⚙️. We want you to play several EQ characters at once, come join us and say hello! 👋

  • A TLP without truebox has thawed (Very Vanilla ready)
    Frostreaver

Guide - Adding Functionality to KissAssist Using the new /mycmd.

Joined
Mar 21, 2014
RedCents
27,491¢
Adding Functionality to KissAssist Using the new /mycmd.

I am sure there are many of you that have just skipped over this new ability, as outlined in the manual:

So I decided to give an example of how this could be used.

In this example I am going to add the ability to position your ranger to use his ranged attack(/autofire).

There is no reason to re-invent the wheel, so lets got grab the code from MuleAssist.

Rich (BB code):
| -------------------------------------------------------------------------------------
| SUB: FindvalidRangeLocation
| -------------------------------------------------------------------------------------
Sub FindvalidRangeLocation(int targetID, string radius)
    /declare i int local 0
    /declare XOff float local 0
    /declare YOff float local 0
    /declare ZOff float local 0
    /declare XMove float local 0
    /declare YMove float local 0
    /declare BaseRadians local
    |we incrememnt by 5 feet around the circle...
    /declare Multiplier local 10

    /declare MyHeading float local ${Math.Calc[${Spawn[${targetID}].Heading.Degrees} - ${Multiplier}]}
    /declare BaseRadian float local ${Math.Calc[360 / 36]}
    /for i 1 to 36
        /varcalc XMove ${Math.Cos[ ${BaseRadian} * ${Float[${i}]} + (${MyHeading}) ]}
        /varcalc YMove ${Math.Sin[ ${BaseRadian} * ${Float[${i}]} + (${MyHeading}) ]}
        /varcalc XOff ${Spawn[${targetID}].X} + ( ${Int[${radius}]} * ${XMove} )
        /varcalc YOff ${Spawn[${targetID}].Y} + ( ${Int[${radius}]} * ${YMove} )
        /varcalc ZOff ${Spawn[${targetID}].Z}
        /if (${Navigation.PathExists[locyxz ${YOff} ${XOff} ${ZOff}]}) {
            /if (${LineOfSight[${YOff},${XOff},${ZOff}:${Spawn[${targetID}].Y},${Spawn[${targetID}].X},${Spawn[${targetID}].Z}]}==TRUE) {
                |/echo ${SpawnCount[pc loc ${XOff} ${YOff} radius 20]}
                /if (${EverQuest.ValidLoc[${XOff} ${YOff} ${ZOff}]}) {
                    /if (${SpawnCount[npc loc ${XOff} ${YOff} radius 50]}<=${Me.XTarget}) {
                        /echo [${i}] We have a valid loc at ${YOff} ${XOff} ${ZOff}
                        /squelch /nav locyxz ${YOff} ${XOff} ${ZOff}
                        /delay 1s ${Navigation.Active}==TRUE
                        /delay 5s ${Navigation.Active}==FALSE
                        /break
                    }
                }
            }
        }
    /next i
/return

Now lets shorten the name of the routine, because this is going to be our new command we have to use when calling this routine.
I would change Sub FindvalidRangeLocation(int targetID, string radius) to Sub fvrl(string p_P1, string p_P2, string p_P3). I also want to add in some additional Target.ID checks. My altered routine now looks like this.

Rich (BB code):
| ----------------------------------------------------------------------------
| Find Ranged Location Sub. Used to position Rangers.
| Shamelessly stolen from MuleAssist Macro(EQMule).
|   p_P1 must be the name of a valid TLO member or declared outer variable.
|      Examples: Target.ID or MyTargetID
|   p_P2 is a static int value. Example: 35
|   p_P3 not use at this time.
| ----------------------------------------------------------------------------
    Sub fvrl(string p_P1, string p_P2, string p_P3)
        /declare targetID int local ${${p_P1}}
        /declare radius int local ${p_P2}
        /if (${Target.ID}) {
            /if (!${targetID} || ${targetID}!=${Target.ID} || ${Bool[${Target.Mezzed.ID}]}) /return 0
            /if (${Target.Distance3D}>30 && ${Target.LineOfSight}) /return 1
        } else {
            /return 0
        }
        | Can't use a ranged item if less than 30 distance.
        /if (${radius}<30) /varset radius 35
        /declare i int local 0
        /declare XOff float local 0
        /declare YOff float local 0
        /declare ZOff float local 0
        /declare XMove float local 0
        /declare YMove float local 0
        /declare BaseRadians local
        |we incrememnt by 5 feet around the circle...
        /declare Multiplier local 10

        /declare MyHeading float local ${Math.Calc[${Spawn[${targetID}].Heading.Degrees} - ${Multiplier}]}
        /declare BaseRadian float local ${Math.Calc[360 / 36]}
        /for i 1 to 36
            /varcalc XMove ${Math.Cos[ ${BaseRadian} * ${Float[${i}]} + (${MyHeading}) ]}
            /varcalc YMove ${Math.Sin[ ${BaseRadian} * ${Float[${i}]} + (${MyHeading}) ]}
            /varcalc XOff ${Spawn[${targetID}].X} + ( ${Int[${radius}]} * ${XMove} )
            /varcalc YOff ${Spawn[${targetID}].Y} + ( ${Int[${radius}]} * ${YMove} )
            /varcalc ZOff ${Spawn[${targetID}].Z}
            /if (${Navigation.PathExists[locyxz ${YOff} ${XOff} ${ZOff}]}) {
                /if (${LineOfSight[${YOff},${XOff},${ZOff}:${Spawn[${targetID}].Y},${Spawn[${targetID}].X},${Spawn[${targetID}].Z}]}==TRUE) {
                    |/echo ${SpawnCount[pc loc ${XOff} ${YOff} radius 20]}
                    /if (${EverQuest.ValidLoc[${XOff} ${YOff} ${ZOff}]}) {
                        /if (${SpawnCount[npc loc ${XOff} ${YOff} radius 50]}<=${Me.XTarget}) {
                            /echo [${i}] We have a valid loc at ${YOff} ${XOff} ${ZOff}
                            /squelch /nav locyxz ${YOff} ${XOff} ${ZOff}
                            /delay 1s ${Navigation.Active}==TRUE
                            /delay 5s ${Navigation.Active}==FALSE
                            /break
                        }
                    }
                }
            }
        /next i
    /return 1

Now I just need to add the code to my kissmycmds.inc file.

Rich (BB code):
|kissmycmds.inc
|
| ----------------------------------------------------------------------------
| Sub mycmds: Include side of commands feature.
| ----------------------------------------------------------------------------
    Sub mycmds(myCMD, p_1, p_2, p_3)
        /declare str_returnStatus string     local
        /if (${SubDefined[${myCMD}]}) {
            /call ${myCMD} "${p_1}" "${p_2}" "${p_3}"
            /varset str_returnStatus ${Macro.Return}
        } else {
            /varset str_returnStatus CMDInvalid_${myCMD}
        }
    /return ${str_returnStatus}
| ----------------------------------------------------------------------------
| Above here is manditory. Do NOT remove.
| ----------------------------------------------------------------------------
| Add additional Subs below here.
| ----------------------------------------------------------------------------

| ----------------------------------------------------------------------------
| Find Ranged Location Sub. Used to position Rangers.
| Shamelessly stolen from MuleAssist Macro(EQMule).
|   p_P1 must be the name of a valid TLO member or declared outer variable.
|      Examples: Target.ID or MyTargetID
|   p_P2 is a static int value. Example: 35
|   p_P3 not use at this time.
| ----------------------------------------------------------------------------
    Sub fvrl(string p_P1, string p_P2, string p_P3)
        /declare targetID int local ${${p_P1}}
        /declare radius int local ${p_P2}
        /if (${Target.ID}) {
            /if (!${targetID} || ${targetID}!=${Target.ID} || ${Bool[${Target.Mezzed.ID}]}) /return 0
            /if (${Target.Distance3D}>30 && ${Target.LineOfSight}) /return 1
        } else {
            /return 0
        }
        | Can't use a ranged item if less than 30 distance.
        /if (${radius}<30) /varset radius 35
        /declare i int local 0
        /declare XOff float local 0
        /declare YOff float local 0
        /declare ZOff float local 0
        /declare XMove float local 0
        /declare YMove float local 0
        /declare BaseRadians local
        |we incrememnt by 5 feet around the circle...
        /declare Multiplier local 10

        /declare MyHeading float local ${Math.Calc[${Spawn[${targetID}].Heading.Degrees} - ${Multiplier}]}
        /declare BaseRadian float local ${Math.Calc[360 / 36]}
        /for i 1 to 36
            /varcalc XMove ${Math.Cos[ ${BaseRadian} * ${Float[${i}]} + (${MyHeading}) ]}
            /varcalc YMove ${Math.Sin[ ${BaseRadian} * ${Float[${i}]} + (${MyHeading}) ]}
            /varcalc XOff ${Spawn[${targetID}].X} + ( ${Int[${radius}]} * ${XMove} )
            /varcalc YOff ${Spawn[${targetID}].Y} + ( ${Int[${radius}]} * ${YMove} )
            /varcalc ZOff ${Spawn[${targetID}].Z}
            /if (${Navigation.PathExists[locyxz ${YOff} ${XOff} ${ZOff}]}) {
                /if (${LineOfSight[${YOff},${XOff},${ZOff}:${Spawn[${targetID}].Y},${Spawn[${targetID}].X},${Spawn[${targetID}].Z}]}==TRUE) {
                    |/echo ${SpawnCount[pc loc ${XOff} ${YOff} radius 20]}
                    /if (${EverQuest.ValidLoc[${XOff} ${YOff} ${ZOff}]}) {
                        /if (${SpawnCount[npc loc ${XOff} ${YOff} radius 50]}<=${Me.XTarget}) {
                            /echo [${i}] We have a valid loc at ${YOff} ${XOff} ${ZOff}
                            /squelch /nav locyxz ${YOff} ${XOff} ${ZOff}
                            /delay 1s ${Navigation.Active}==TRUE
                            /delay 5s ${Navigation.Active}==FALSE
                            /break
                        }
                    }
                }
            }
        /next i
    /return 1

Now from within KissAssist I can use my new fvrl routine using the /mycmd command. /mycmd fvrl Target.ID 35. I could even add it into the DSP section and use it.
Example:
DPS1=Command:/mycmd fvrl Target.ID 35|100|ambush|cond1
...
DPS5=Command:/mycmd fvrl Target.ID 35|99|cond1

Cond1=${Target.ID} && (${Target.Distance3D} < 30 || !${Target.LineOfSight})

The DPS5 entry is added in case the mob gets to close to you, and you need to reposition.
 

Attachments

Last edited by a moderator:
This functionality looks awesome.

Ok, I am not really competent with code at all, so I will throw out this idea. If anyone that’s more aware of mq2 / KA limitations could chime in that would be awesome.

I am imagining building the perfect group warrior ini for KA12. Ideally, I’d love for the macro to be able to handle multiple adds as a warrior. I’ve been thinking of a few different techniques I could try.

1. Work out some kind of VIP protection function. For example, you set your cleric as your group VIP, but your VIP could be your CC or anyone else.
-the warrior would detect when the VIP is in trouble. Like if you pull a clump of mobs to camp and a few get stuck on the healer before they’re mezzed
-you could have the war defect the VIPs hp dropping, then they would nav to the VIP and hit AE taunt or the Blades line.
-I would love to use dannet to somehow detect if each mob was mezzed, and if they were aggro’d on someone else, then hit them individually with an aggro ability. I imagine this is beyond mq2 capability but who knows.

2. Have the warrior pull a clump of mobs, then have the cleric cast a single target heal right as the mobs arrive in camp.
-this would set off the expanse ability (which would always be running.
-so maybe the cleric would cast a single target heal IF tank is at 100% health && there are mobs on xtarget && mobs are within a certain distance from camp.
-hopefully this would work to keep mobs glued to the tank better.


Can anyone chime in to the feasibility of these half baked ideas?
 
can "/mycmd" be used to create a call to another mac like: "/call deleteitem "small chunk of Velium"" ?
Sometimes at long sessions I would like to delete those chunks without the need to interrupt kissassist.
I am too dumb, to configure mq2autoforage to delete those chunks on inc.
 
@Dragonslayer You would just need to add the deleteitem Sub routine into the kissmycmds.inc file and then set it up to use the /mycmd deleteitem "small chunk of Velium"
 
It's a very nice add for sure. I've been manually adding includes to KA for a long time, whenever I get a new version, this simplifies it so I can just put those includes into one file and don't have to add it each time anymore.
 
As much as I try, I simply cannot understand how to convert the stuff I that I am interested in into the template. Additionally, I am pretty sure that I'll have to modify whatever it is I want to include as I drive with my CWTN WAR or SHD so they'd be calling the command FOR the rest of my group running KA.

It would be great if there were a subdirectory in the KA INI resources for mycmd inc files. I need more examples to look at before I understand. I have lots of ideas of neat stuff that would make great mycmds but I struggle to figure out how it should work. I've read the ranger example dozens of times and I am not getting it yet.

Example, Kaen's portgroup.mac. that would be awesome to include if i could figure out what p1, p2, and p3 needs to be. from my driver i could /dex my wizard or druid the command, they'd respond in /dgt with the menu of ports, i would /dex back the trigger and off we go. The /evac sub from MA would be great too. That one is also confusing because again, there's really not a parameter, you send the /evac command to the group and if WIZ or DRU, fire the memmed evac spell. What do you use for p1, p2, and p3 in those examples?
 
This thread is still relevant today and should be stickied in the KA forum!

Additionally, I looked at the RG wiki to find the instructions since I had never seen them in the current wiki... doesn't look like it made it into the current version of the wiki!

Mods... don't blast me for necro posting!!!
 
Guide - Adding Functionality to KissAssist Using the new /mycmd.

Users who are viewing this thread

Back
Top
Cart