Closed oberstlynild closed 5 years ago
Also tried this: $if('"$msg" == "fc" || "$msg" == "FC"', 'Nice FC tæller er på $count', '$dummy')
Also does not seem to be working :(.
I also tried with only one |. Don't know why tho..
And now i tried this: $if('("$msg" == "fc") | ("$msg" == "FC")', 'Nice FC tæller er på $count', '$dummy')
And that is working WTF hahaha. Sorry for the issues. Hope it could help someone tho.
UPDATE - fixed (I hope) the suggested expression below; I typed it incorrectly initially
Hello! It looks like you've found a workable solution, but to provide a little more context: the expression given to $if is interpreted by Python and must follow Python's rules for operator usage (and expressions in general). So || combines conditions (as you found in your final working version), not values (as in your original version).
That said, since what you're trying to do is a case-insensitive comparison, you might want to just convert $msg to lowercase and compare the result against "fc'. With only two letters, it is possible to use || and go through all possible matching values, but for anything longer it would start to be a real hassle.
'"$msg".lower() == "fc"'
Thanks for your interest in the $if script, and best of luck.
Hi.
I cannot make the "or" operator work. Is it possible? Here my command: $if('"$msg" == "fc" || "FC" || "Fc" || "fC"', 'Nice FC count is $count', '$dummy')
This command is working, but only if i do not use capitol letters: $if('"$msg" == "fc"', 'Nice FC count is $count', '$dummy')
Best regards Oberstlynild