找回密码
 立即注册

QQ登录

只需一步,快速开始

手机短信,快捷登录

搜索

DoT Count Framework (DCF)

[复制链接]
 楼主| 发表于 2023-6-11 14:54:01 | 显示全部楼层 |阅读模式
WA仓库
WA名称: DoT Count Framework (DCF)
WA内容: !WA:2!TR13ZTXX9DtrRMzUXZiBLAvNFnznsTezmiOKIKQgnwEgacqrAtsWaakzho0q7D3cCx4HBVU7EeeoS5bM0KmDYdD4Fc8b)uFIp1P9T(qF(gn9VGmtsFU(FG2VF39UdhajKSJDt70koCipS3U73F)573V7I5E8vhCv3RkBD3k3TYDUQ7VPSyuZE9Km1CcESkWpKjAUtNnwFRgIdycPpp8UN5h2JlgqvWhUE0B53pKlynJWpkBCalu1qi4cP3zWSCy6rKErexFzuaDuh2HQUM13nQRYFal9tZfD9zpLawFQZOU9c4CH3PcwFGyDgfXQPG5Ecn03Wo3R2aQF4Q1u4Rc5HSN5gl0VPloKqYC4HUYJzujdxEYR)VGp2wjyH9vEFJwsfvOwn5kjVEYBKC1KVj8))8VHDp)qFP30dFIKf0BBUFOYUwZoDAU5TJfbrFxpLks(GLxEiTpVIpF516q3A7nu3z0Y3(EIdtvU2s2aqFAFRk3SYTV7ZOXkpUivh(pbe6mxM0r4RhO1qFxL3LpUhpu12)tzTcOI(SKxlAZJC6b)CFNBEZQUUekPoVZnKK2rSGaY61j(HeUWLjikoHctWxHpP8yeLG6SVFyFspbDaBixS)rI)WzE(USwm9s8Qjbk9MjK5fXswDGz8odEyfEqansY8o2j7Pt6dokrOYSfviOJeH8nza)5D79zJ(CnHyUAwA96YtLX2Ps5p8ZGn)eyp3qR69Sd0))nRHsE0JBeQagNsKAHje4scvcFwWg4hIYeVNwswVEfshpFjbDeiW)d5kcSRG6iC0qpMGHQbCMoCx2jdIdu(OxTxs5t079wWwNCLw(HrXQKR)0AiPo1OcXxbkJEuyrx6ZQjvSO5bM(2ahmxYTI(7m8iU3YmvEkxbgILPGNhWB09bstnSb4h5IADfYWlrgWJL4h5hKUn4saRe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)BFuYpjz3)R)
WA来源: https://wago.io/HTaNPLt4y
WA封面图:
WA内容图: https://media.wago.io/screenshots/HTaNPLt4y/64471b028c7abf1e34325d29.jpg;https://media.wago.io/screenshots/HTaNPLt4y/644ad75a167789624cf59bf0.png;https://media.wago.io/screenshots/HTaNPLt4y/644ad75e167789624cf59bf4.png;https://media.wago.io/screenshots/HTaNPLt4y/644ad761167789624cf59bf8.png;https://media.wago.io/screenshots/HTaNPLt4y/644ad765167789624cf59bff.png;https://media.wago.io/screenshots/HTaNPLt4y/644ad768167789624cf59c15.png
WA类型: 发展 战斗机制 
WA推荐:
WA包含光环: -
WA版本: 1.0.25
WA更新日志:
WA汉化简介:
WA作者: KoviLovesYou
WA更新时间: 2023-06-02 01:35:42
WA游戏版本: Dragonflight 10.1.0
wa游戏大版本: 巨龙时代
Last Meaningful Update: 4/27/23. Changelog at the bottom of this page.

Description:
Automatically keeps track of the number of DoTs that you've applied to targets on a per-spell basis, and allows access to these numbers from any other weakaura.
For example, setting this to track feral rakes (spell ID 155722), then applying rake to 4 enemies will allow any other weakaura to display "4" by connecting to DCF and then accessing the aura_env.DCF[155722].count variable. When a rake falls off, the number will change to 3, and so on. Effectively, this will allow you to have a central location that handles the dense logic required to track this information without needing to program every weakaura individually. This weakaura doesn't do anything useful by itself, it's simply a tool for other weakauras to use.

An example template weakaura that consumes this data is here.

1.gif


Usage Guide:
* To get DCF to start tracking a DoT, add its spell name and spell ID into the input at the top of the custom options tab (take special care in finding the Spell ID that your DoT uses. It's not always as simple as inputting the spell ID of the base spell)

* A DoT's total number of active applications can be accessed from other weakauras by listening to the DOT_COUNT_FRAMEWORK_UPDATE event, which has the data attached as the first argument

* On a weakaura that intends to use DCF's data, set up a trigger with the following:

Type: Custom
Event Type: Event
Event(s): DOT_COUNT_FRAMEWORK_UPDATE
Custom Trigger:
function(e, DCF)   
    aura_env.DCF = DCF
    return true
end

Hide: Timed
Duration (s): 1

Next, under "Actions" -> "On Show" -> "Custom", put the following code at the top:
if not aura_env.DCF then WeakAuras.ScanEvents("DOT_COUNT_FRAMEWORK_REQUEST_DATA") end

* Take care if you are changing anything about the trigger above. DOT_COUNT_FRAMEWORK_UPDATE events happen whenever a DoT count changes, whenever a weakaura connects to DCF, and potentially whenever any DCF-connected weakauras want to arbitrarily send the DOT_COUNT_FRAMEWORK_REQUEST_DATA event.

* With the Trigger and On Show set up, your weakaura can reference any DoT that DCF is tracking by referencing aura_env.DCF[<YourSpellIdHere>].count

* Make sure to null-check the value before you use it, as this variable won't be filled out until the DCF connection initializes. e.g. to use it with %c custom text, write the following:
function()
    if aura_env.DCF and aura_env.DCF[<YourSpellIdHere>] then
        return aura_env.DCF[<YourSpellIdHere>].count
    end
end


* You will likely want to utilize custom trigger activation logic after attaching DCF's trigger to your weakaura. You'll at least want to exclude DCF's trigger from your activation criteria, as its "active" state is meaningless

This feature allows you to dynamically choose which combination of triggers needs to be active in order for your weakaura to activate.
You reference the active state of each trigger by using e.g. t[1] for Trigger 1 being active, or t[3] for Trigger 3 being active.
For example, if you want your weakaura to be active when Trigger 1 is active and either Trigger 4 or Trigger 5 are active, you would write something like:
t[1] and (t[4] or t[5])

In order to express this configuration, you would change the following settings at the top of your weakaura's Trigger tab:
Required for Activation: Custom Function
Custom:
function(t)
    return t[1] and (t[4] or t[5])
end


* As far as I can think of, you should only need to use WeakAuras.ScanEvents("DOT_COUNT_FRAMEWORK_REQUEST_DATA") in the "On Show" section for your code to function properly with DCF. In unforeseen circumstances, if you find you need a data update beyond the "On Show" and don't want to wait for DCF to naturally send it to you, you can use WeakAuras.ScanEvents("DOT_COUNT_FRAMEWORK_REQUEST_DATA") at any point in your code to force DCF to send a DOT_COUNT_FRAMEWORK_UPDATE on demand. Keep in mind that every other weakaura that is connected to DCF will also be forced to receive this event, so spamming it may have unintended consequences.

Performance:
This weakaura has very intense optimization and a very low performance cost in most scenarios. Unfortunately, it's not possible to get it all the way down to zero cost because it is forced to listen to a ton of aura-based combat log events from other players, even though it aborts those events as quickly as WeakAuras will let it. It primarily scales with the number of players casting auras/DoTs around you - your own DoT tracking is trivial in comparison. If you get all the way up to a 40-man raid, it will probably become about as intensive as a standard icon-based weakaura. This is still low cost, but relative to the number of useful calculations happening it's way higher than I would prefer. If there was a way to only listen to player-based aura combat log events, 90% of the performance hit would go away and the impact would be effectively zero in all cases. Using watched triggers with a player filter for this task makes it take a lot more CPU time, so it seems we're forced to use this implementation.

Troubleshooting:
I'll be notified within a few hours if you write a comment on Wago. Include an error log/detailed description and I'll try to fix anything that breaks. Make sure you are using the latest version of the weakaura if something isn't working.

Changelog:
    * 6/1/23:
        - Feel free to skip this update
        - Trivial performance update, changed the way that this weakaura references tracked spells, reducing lookups from O(n) to O(1) time, and restructured the logic flow a tiny bit to reduce redundant logic
        - Experimented with filtered watched triggers to solve the non-player aura problem but WA's metrics put the CPU usage at nearly 3x our current solution, so this doesn't seem to be working as well as I'd hoped
    * 5/8/23:
        - No code changes, no need to update. Took the off-screen text "DCF" off of this weakaura. 2 people have reported that it's not getting placed off-screen, even though I can't reproduce this. Might be related to addon configuration or display size. The only purpose was to make it easier to differentiate icon-less weakauras when scrolling through your WA list, but if it's causing any sort of problem it's not worth it.
    * 4/27/23:
        - Added a trigger to listen for DOT_COUNT_FRAMEWORK_REQUEST_DATA and respond with a DOT_COUNT_FRAMEWORK_UPDATE whenever a user feels like it. I've added intended usage notes to the guide above
        - Added a "spell name" key for entry along with the ID, solely for the purpose of helping you remember which entries you've input
    * 4/26/23:
        - Small tweak to garbage collection scheduling. Not much of a performance increase but will be more consistently-spaced.
    * 4/25/23:
        - Changed to only use ScanEvents in order to share data. This is slightly more difficult for other people to use but I wrote up a guide that I think is sufficient to counteract this.
        - Added Option Group to custom options
    * 4/24/23:
        - Initial public version. I've been using my own version of this weakaura for 4 or 5 years, but I've completely gutted and refactored the code to make it optimized and customizable. The codebase is really quite lean at this point, and it's heavily commented. Even so, hopefully I didn't introduce any new bugs.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|魔兽世界玩家社区APP官网 ( 鄂ICP备20007009号-6 )

GMT+8, 2024-5-29 17:27 , Processed in 0.153313 second(s), 17 queries , Redis On.

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表