ascott18 / TellMeWhen

TellMeWhen is a combat tracking AddOn for World of Warcraft Retail and Classic
https://wow.curseforge.com/projects/tellmewhen
GNU General Public License v3.0
86 stars 11 forks source link

[CF 770] 2H Frost Visual Priority + Soul Reaper Bank - Help Requested #792

Closed tmw-issue-import closed 11 years ago

tmw-issue-import commented 11 years ago

IMPORTANT: If your issue is only occurring with a specific icon, include an export string of the icon in this ticket. Subsequently, if the issue involves an entire group or an entire profile, include the entire export string of the group or profile.

To get an export string, open the icon editor, and click button labeled "Import/Export/Backup". Select the "To string" option for the appropriate export type (icon, group, or profile), and then press CTRL+C to copy it to your clipboard.

FAILURE TO COMPLY WITH THE ABOVE INSTRUCTIONS WILL RESULT IN YOUR TICKET BEING INVALIDATED.

What steps will reproduce the problem?

N/A

What do you expect to happen? What happens instead?

N/A

What version of TellMeWhen are you using? ("The latest" is not a version)

TellMeWhen v6.1.5

Do you have an error log of what happened?

N/A

Please provide any additional information below (including any export strings if applicable; see above.)

I like to use TMW to visually display my priorities for 2H Frost so I can maximize my DPS. Currently, I have the basic rotation (see string below):

^1^T^SPoint^T ^Sy^F5910978167832487 ^f-46^Sx ^F-4503633223744722^f-52 ^t^SOnlyInCombat^B ^SEnabled^B ^SColumns^N11 ^SIcons^T ^N1^T ^SType^Sconditionicon ^SConditions^T ^N1^T ^SType^SSPELLCD ^SOperator^S<= ^SName^SSoul~`Reaper ^SLevel^N0.3 ^t^N2^T ^SType^SHEALTH ^SOperator^S<= ^SUnit^STarget ^SLevel^N36 ^t^Sn^N2 ^t^SCustomTex^SSOul~`Reaper ^SEnabled^B ^t^N2^T ^SType^Sconditionicon ^SConditions^T ^N1^T ^SType^SBUFFDUR ^SChecked^B ^SOperator^S~|= ^SName^SKilling~`Machine ^t^N2^T ^SType^SSPELLCD ^SOperator^S<= ^SName^SObliterate ^SLevel^N0.5 ^t^N3^T ^SType^SDEBUFFDUR ^SChecked^B ^SOperator^S~|= ^SUnit^Starget ^SName^SFrost~`Fever ^t^N4^T ^SType^SDEBUFFDUR ^SChecked^B ^SOperator^S~|= ^SUnit^Starget ^SName^SBlood~`Plague ^t^Sn^N4 ^t^SCustomTex^SObliterate ^SEnabled^B ^t^N3^T ^SType^Sconditionicon ^SConditions^T ^N1^T ^SType^SDEBUFFDUR ^SChecked^B ^SUnit^Starget ^SOperator^S<= ^SName^SBlood~`Plague ^SLevel^N2 ^SPrtsBefore^N1 ^t^N2^T ^SType^SDEBUFFDUR ^SChecked^B ^SPrtsAfter^N1 ^SUnit^Starget ^SOperator^S<= ^SName^SFrost~`Fever ^SLevel^N2 ^SAndOr^SOR ^t^N3^T ^SType^SSPELLCD ^SOperator^S<= ^SName^SOutbreak ^SLevel^N0.5 ^t^Sn^N3 ^t^SCustomTex^SOutbreak ^SEnabled^B ^t^N4^T ^SType^Sconditionicon ^SConditions^T ^N1^T ^SType^SDEBUFFDUR ^SChecked^B ^SOperator^S<= ^SUnit^Starget ^SName^SBlood~`Plague ^SLevel^N2 ^t^N2^T ^SType^SSPELLCD ^SOperator^S<= ^SName^SPlague~`Strike ^SLevel^N0.5 ^t^Sn^N2 ^t^SCustomTex^SPlague~`Strike ^SEnabled^B ^t^N5^T ^SType^Sconditionicon ^SConditions^T ^N1^T ^SType^SDEBUFFDUR ^SChecked^B ^SOperator^S<= ^SUnit^Starget ^SName^SFrost~`Fever ^SLevel^N2 ^t^N2^T ^SType^SSPELLCD ^SOperator^S<= ^SName^SHowling~`Blast ^SLevel^N0.5 ^t^Sn^N2 ^t^SCustomTex^SHowling~`Blast ^SEnabled^B ^t^N6^T ^SType^Sconditionicon ^SConditions^T ^N1^T ^SType^SLUA ^SName^S(GetRuneCount(1)+GetRuneCount(2)==2~`or~`GetRuneCount(3)+GetRuneCount(4)==2~`or~`GetRuneCount(5)+GetRuneCount(6)==2) ^t^Sn^N1 ^t^SCustomTex^SObliterate ^SEnabled^B ^t^N7^T ^SType^Sconditionicon ^SConditions^T ^N1^T ^SType^SRUNIC_POWER ^SOperator^S>= ^SLevel^N76 ^t^Sn^N1 ^t^SCustomTex^SFrost~`Strike ^SEnabled^B ^t^N8^T ^SType^Sconditionicon ^SConditions^T ^N1^T ^SType^SBUFFDUR ^SChecked^B ^SOperator^S~|= ^SName^SFreezing~`Fog ^t^Sn^N1 ^t^SCustomTex^SHowling~`Blast ^SEnabled^B ^t^N9^T ^SType^Sconditionicon ^SConditions^T ^N1^T ^SType^SMANAUSABLE ^SName^SFrost~`Strike ^t^Sn^N1 ^t^SCustomTex^SFrost~`Strike ^SEnabled^B ^t^N10^T ^SType^Sconditionicon ^SConditions^T ^N1^T ^SType^SSPELLCD ^SOperator^S<= ^SName^SObliterate ^SLevel^N0.5 ^t^Sn^N1 ^t^SCustomTex^SObliterate ^SEnabled^B ^t^N11^T ^SType^Sconditionicon ^SConditions^T ^N1^T ^SType^SSPELLCD ^SName^SHorn~`of~`Winter ^t^Sn^N1 ^t^SCustomTex^SHorn~`of~`Winter ^SEnabled^B ^t^t^SSecondarySpec^b ^t^N61501^S~`~| ^Sgroup^N1 ^^

I am looking to add a condition to my rune spending abilities that allows me to bank a Death or Frost rune for Soul Reaper when the target is sub 35% - that is, I want to add a condition that essentially says "if the target is sub 35% and using this ability would leave me without a Frost or Death rune, then do not show this icon". I am having some trouble doing this, and think it may be too difficult to input into TMW. I am somewhat familiar with lua, so have been playing around with the lua conditions; but, as far as I can tell I would need to use an if statement in lua, which the lua conditions do not allow for. Any suggestions?

Also, the lua condition icon says that if I wish to use a condition with more complex functionality I can link to an external lua file. I feel I could program this condition using an external file that uses if, but am not sure how to link to this file. Are there any resources you can link me to so that I can get a better idea of how to accomplish that?


Posted by CurseForge user DKFROSTDPS | Imported from CurseForge issue #770 | Raw

tmw-issue-import commented 11 years ago

This should work for what you want (put it as a Lua condition):

``` ((GetRuneType(1) == 4 and GetRuneCount(1) or 0) + (GetRuneType(2) == 4 and GetRuneCount(2) or 0) + (GetRuneType(3) == 4 and GetRuneCount(3) or 0) + (GetRuneType(4) == 4 and GetRuneCount(4) or 0) + GetRuneCount(5) + GetRuneCount(6)) > 1 ```

As an export string: ^1^T^SType^Sconditionicon ^SConditions^T ^N1^T ^SType^SLUA ^SName^S((GetRuneType(1) ~==~4~and~GetRuneCount(1) ~or~0)~+~(GetRuneType(2) ~==~4~and~GetRuneCount(2) ~or~0)~+~(GetRuneType(3) ~==~4~and~GetRuneCount(3) ~or~0)~+~(GetRuneType(4) ~==~4~and~GetRuneCount(4) ~or~0)~+~GetRuneCount(5) ~+~GetRuneCount(6)) ~&gt;~1 ^t^Sn^N1 ^t ^SCustomTex^S114866 ^SEnabled^B ^t^N62003^S~`~| ^Sicon^^

5 and 6 correspond to your frost runes. 1 and 2 are blood, 3 and 4 are unholy. Switch 5 and 6 with another number pair if you need this for a spec other than frost. GetRuneType(1) == 4 checks if that slot is a death rune. Let me know if you need explanations for anything else.


Edited Mar 26, 2013

> Posted by CurseForge user Cybeloras
tmw-issue-import commented 11 years ago

Thanks for your response!

I have one clarifying question about the 4 conditions checking Death Runes. I know a bit about Lua, but am not well versed by any means. I am interested in it though, so would love to know a bit more about this particular statement if you have the time to explain. What does (GetRuneType(1)==4 and GetRuneCount(1) or 0) evaluate to under different conditions? GetRuneType()==x will evaluate to a logical, while GetRuneCount() or 0 are both integers. If I use a statement like the one above, does that essentially say "if the logical is true, use GetRuneCount(), otherwise use 0"?

Thanks again for your response - I appreciate it.


Edited Mar 26, 2013

> Posted by CurseForge user DKFROSTDPS
tmw-issue-import commented 11 years ago

Your explanation is spot-on.

if GetRuneType(1) == 4 evaluates to true, the return value of GetRuneCount(1) (which is either 1 or 0, indicating if the rune is ready or not) will be used for that whole statement. Execution will never reach the or 0 part of the code because both of the first evaluation in the statement ({GetRuneType(1) == 4 and GetRuneCount(1)) evaluated to a non-nil, non-false value.

if GetRuneType(1) == 4 evaluates to false, Lua's last-value short-circuit evaluation (http://en.wikipedia.org/wiki/Short-circuit_evaluation) causes the call to GetRuneCount(1) to be skipped entirely and the evaluation of the statement jumps directly to the or 0 part. Since false or 0 evaluates to 0, 0 will be used as the result of that statement.

In Lua, only false and nil are considered to be false in conditional evaluation. Some languages treat 0 that way too, but Lua treats it as true.


Edited Mar 26, 2013

> Posted by CurseForge user Cybeloras