Looping through a list of strings to set actions #136
HeyParkerJ
started this conversation in
Script help
Replies: 2 comments
-
Don't think you're using #replace properly. Try the following:
Assuming you want to set the variable to on, try:
Keep in mind you can't alter the buffs variable table after those actions are set, or the indexing will be incorrect. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Thank you that worked perfectly. Final code below in case anyone finds it useful
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Alternate title: Can you reference variables when setting an action?
So I'm not sure if I'm totally off my rocker when it comes to how I've tried to structure this code and its data, but I'm attempting to create a list of statuses, their "buff applied" message (called "don") and "buff unapplied" messages (referred to as "doff"), and then loop through the table in order to create actions that will update each buff's status as the don and doff messages are read.
It appears that, when declaring a trigger, variables are escaped and taken into the action as a literal string. If I try to create a trigger with the variable from nested table
$buffs[%1][don]}
- the trigger is searching for the message$buffs[%1][don]}
literally. In other words, it seems impossible to programmatically declare triggers with their messages sourced from a list of strings. I understand that I could format this a lot more flat with each string creating its own trigger, but this is to be the basis for a rather large set of scripts I was hoping to create and being able to do something like this would be incredibly useful in terms of maintenance.Thank you for your work maintaining TT++ btw. I love this software :D
Beta Was this translation helpful? Give feedback.
All reactions