How do I create a Boolean function to use in an If Block[?]
freedomtowin opened this issue · 4 comments
This was my initial attempt, but I the variable BoolTest does not show up in the drop down menu for boolean functions. Do I need to create a lua script, and if so where should I put it?
{
["Variables"] = {
["BoolTest"] = {
[1] = "/script if(UnitRace('target')=='Kul Tiran') then return true else return false end;"
}
},
["Actions"] = {
[1] = {
[1] = {
[1] = {
[1] = "/say Variable returned True",
["Type"] = "Action"
}
},
[2] = {
[1] = {
[1] = "/say Variable returned False",
["Type"] = "Action"
}
},
["Type"] = "If",
["Variable"] = "BoolTest"
}
},
["InbuiltVariables"] = {
["Combat"] = false,
["Trinket1"] = false,
["Ring2"] = false,
["Trinket2"] = false,
["Neck"] = false,
["Head"] = false,
["Belt"] = false,
["Ring1"] = false
}
}
Target is not reliable as variables are not able to be evaluated in combat. You exit combat - your macro updates and if you don’t have a target or are targeting a mod not an mod or player your macro will return false.
yes it worked perfectly. also it is as you say, the variable doesnt update until out of combat once combat started.