SomeRandomDude
Well-known member
- Joined
- Jan 29, 2023
- RedCents
- 208¢
Hi all. I'd like to propose that the following functionality be added to KissAssist. I've made and tested these changes and they work as I intended and I think other people may appreciate these changes. I'm sorry if there is a different mechanism for proposing KA changes, I'm not aware of what that is.
Purpose of the change: To allow Lua/React scripting to affect KA conditions. The point being that it would be handy to trigger spell casting from Lua/react, however, when there is a cast time involved then it is "dangerous" since KA may somewhat simultaneously decide to move, sit, cast, etc. This mechanism would allow KA to do the spell casting while Lua/react provides the logic for when to allow casting.
[CODE title="Here are the KA changes that I made locally"]#bind ForceCondition /forcecondition
| ----------------------------------------------------------------------------
| SUB: ForceCondition allows external scripting to force KA conditions
| Usage Examples:
| /noparse /forcecondition 1 "${Me.PctHPs} < 75"
| /forcecondition 1 "TRUE"
| ----------------------------------------------------------------------------
Sub Bind_ForceCondition(int condNum, string newValue)
/if (${condNum} < 1 || ${condNum} > ${Cond.Size}) {
/echo Bind_ForceCondition error: condNum ${condNum} is out of the range 1 .. ${Cond.Size}
/return
}
/if (${MacroQuest.Parser}!=2) {
/squelch /engine parser 2 noauto
/while (${MacroQuest.Parser}!=2) {
/delay 5
}
}
/varset Cond[${condNum}] ${Parse[1,${newValue}]}
/return
[/CODE]
Note that I'm a little bit of a noob on the scripting, so there may be a slightly better way to ensure that "Parse" is available, etc. I just copied the above from elsewhere in KA.
My test case to ensure that it worked was as follows:
1. I updated the above function to print all conditions every time I changed any of them.
2. Ran: /noparse /forcecondition 1 "${Me.WIS} > 500"
Note: I did WIS because I tested on an ENC and could easily affect my WIS with KEI (or the like).
3. Saw that the printed output for condition 1 was something like "632 > 500" (good because my WIS was 632 at the time)
4. Cast KEI (or some equivalent)
5. Did /forcecondition on a different condition index (to not affect my value assigned in step 2 above, but to force it to print)
6. Observed that condition 1 had something like "657 > 500"
So clearly the condition text was still storing the ${Me.WIS} since it was tracking with my WIS changes.
Note that this change allows for any sort of string to be applied to the condition, but mostly it makes sense to assign "TRUE" and "FALSE" (at least that's how I intend to use it). My purpose is so that I can easily implement a SK epic clicky rotation. The SK epic duration is shorter than the recast time, so I need to coordinate across multiple SKs to keep the buff on all the time.
Purpose of the change: To allow Lua/React scripting to affect KA conditions. The point being that it would be handy to trigger spell casting from Lua/react, however, when there is a cast time involved then it is "dangerous" since KA may somewhat simultaneously decide to move, sit, cast, etc. This mechanism would allow KA to do the spell casting while Lua/react provides the logic for when to allow casting.
[CODE title="Here are the KA changes that I made locally"]#bind ForceCondition /forcecondition
| ----------------------------------------------------------------------------
| SUB: ForceCondition allows external scripting to force KA conditions
| Usage Examples:
| /noparse /forcecondition 1 "${Me.PctHPs} < 75"
| /forcecondition 1 "TRUE"
| ----------------------------------------------------------------------------
Sub Bind_ForceCondition(int condNum, string newValue)
/if (${condNum} < 1 || ${condNum} > ${Cond.Size}) {
/echo Bind_ForceCondition error: condNum ${condNum} is out of the range 1 .. ${Cond.Size}
/return
}
/if (${MacroQuest.Parser}!=2) {
/squelch /engine parser 2 noauto
/while (${MacroQuest.Parser}!=2) {
/delay 5
}
}
/varset Cond[${condNum}] ${Parse[1,${newValue}]}
/return
[/CODE]
Note that I'm a little bit of a noob on the scripting, so there may be a slightly better way to ensure that "Parse" is available, etc. I just copied the above from elsewhere in KA.
My test case to ensure that it worked was as follows:
1. I updated the above function to print all conditions every time I changed any of them.
2. Ran: /noparse /forcecondition 1 "${Me.WIS} > 500"
Note: I did WIS because I tested on an ENC and could easily affect my WIS with KEI (or the like).
3. Saw that the printed output for condition 1 was something like "632 > 500" (good because my WIS was 632 at the time)
4. Cast KEI (or some equivalent)
5. Did /forcecondition on a different condition index (to not affect my value assigned in step 2 above, but to force it to print)
6. Observed that condition 1 had something like "657 > 500"
So clearly the condition text was still storing the ${Me.WIS} since it was tracking with my WIS changes.
Note that this change allows for any sort of string to be applied to the condition, but mostly it makes sense to assign "TRUE" and "FALSE" (at least that's how I intend to use it). My purpose is so that I can easily implement a SK epic clicky rotation. The SK epic duration is shorter than the recast time, so I need to coordinate across multiple SKs to keep the buff on all the time.

