[PQR]LF DR tracker Script menu

User Tag List

Results 1 to 7 of 7
  1. #1
    Numba1stunna1's Avatar Active Member
    Reputation
    70
    Join Date
    Dec 2013
    Posts
    182
    Thanks G/R
    1/34
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [PQR]LF DR tracker Script

    Hello,

    I am relatively new to scripting. I have been making a 4.3.4 Rogue PvP profile. I took some scipting ideas from Vitelic, Cokx, and Blinded and combined them with some of my own ideas to make one profile.

    • Vitelic provided a nice event logger script to cast spells instantly (such as gouge disengage and shadowstep kick spells)
    • Cokx provided a DR tracker
    • Blinded provided a Subtlety PvE rotation


    You guys did an awesome job in scripting some profiles. I learned a lot from you guys.

    However, I have been looking for a better DR tracker that tracks the stuns, disorients, and fear (for blind) DR's. I have no idea how to script these DR's for full, half, quarter, and immune CC duration. Cokx DR tracker seems to work, but only tracks the DR's of the target (which is not good if one were to swap targets)

    Are there any ideas for scripting a DR check on the target? Preferably, it would be nice if the event logger tracked all players in the log for diminishing returns and then check the DR of the target or focus target before casting a CC. Something like:

    'if DRcount("focus", "fears") < 1 --no DR on fear
    then CastSpellByID("2094", "focus") end -- Blind'

    I have been looking at the DR Data file below (4.3.4) and I have no idea how to track specific diminishing returns so I may apply them in my PvP rotation.

    If you could give me some tips or tricks in how to script DR's, then I would greatly appreciate it. Perhaps add or modify the data below and provide a global function in the data below so I may apply it in my rotation, like

    'function DRcount(target, DRcatagory)'


    Below is the LUA script from DRData-1.0.lua
    local major = "DRData-1.0"
    local minor = 1009
    assert(LibStub, string.format("%s requires LibStub.", major))

    local Data = LibStub:NewLibrary(major, minor)
    if( not Data ) then return end

    local L = {
    ["Banish"] = "Banish",
    ["Controlled stuns"] = "Controlled stuns",
    ["Cyclone"] = "Cyclone",
    ["Disarms"] = "Disarms",
    ["Disorients"] = "Disorients",
    ["Entrapment"] = "Entrapment",
    ["Fears"] = "Fears",
    ["Horrors"] = "Horrors",
    ["Mind Control"] = "Mind Control",
    ["Random roots"] = "Random roots",
    ["Random stuns"] = "Random stuns",
    ["Controlled roots"] = "Controlled roots",
    ["Scatter Shot"] = "Scatter Shot",
    ["Dragon's Breath"] = "Dragon's Breath",
    ["Silences"] = "Silences",
    ["Taunts"] = "Taunts",
    }

    if GetLocale() == "frFR" then
    L["Banish"] = "Bannissement"
    L["Controlled stuns"] = "Etourdissements contrôlés"
    L["Cyclone"] = "Cyclone"
    L["Disarms"] = "Désarmements"
    L["Disorients"] = "Désorientations"
    L["Entrapment"] = "Piège"
    L["Fears"] = "Peurs"
    L["Horrors"] = "Horreurs"
    L["Mind Control"] = "Contrôle mental"
    L["Random roots"] = "Immobilisations aléatoires"
    L["Random stuns"] = "Etourdissemensts aléatoires"
    L["Controlled roots"] = "Immobilisations contrôlées"
    L["Scatter Shot"] = "Flèche de dispersion"
    L["Dragon's Breath"] = "Souffle du dragon"
    L["Silences"] = "Silences"
    L["Taunts"] = "Provocations"
    end

    -- How long before DR resets
    -- While everyone will tell you it's 15 seconds, it's actually 16 - 20 seconds with 18 being a decent enough average
    Data.RESET_TIME = 18

    -- List of spellID -> DR category
    Data.spells = {
    --[[ TAUNT ]]--
    [ 355] = "taunt", -- Taunt (Warrior)
    [53477] = "taunt", -- Taunt (Hunter tenacity pet)
    [ 6795] = "taunt", -- Growl (Druid)
    [56222] = "taunt", -- Dark Command
    [62124] = "taunt", -- Hand of Reckoning
    [31790] = "taunt", -- Righteous Defense
    [20736] = "taunt", -- Distracting Shot
    [ 1161] = "taunt", -- Challenging Shout
    [ 5209] = "taunt", -- Challenging Roar
    [57603] = "taunt", -- Death Grip
    [36213] = "taunt", -- Angered Earth -- FIXME: NPC ability ?
    [17735] = "taunt", -- Suffering (Voidwalker)
    [58857] = "taunt", -- Twin Howl (Spirit wolves)

    --[[ DISORIENTS ]]--
    [49203] = "disorient", -- Hungering Cold
    [ 6770] = "disorient", -- Sap
    [ 1776] = "disorient", -- Gouge
    [51514] = "disorient", -- Hex
    [ 9484] = "disorient", -- Shackle Undead
    [ 118] = "disorient", -- Polymorph
    [28272] = "disorient", -- Polymorph (pig)
    [28271] = "disorient", -- Polymorph (turtle)
    [61305] = "disorient", -- Polymorph (black cat)
    [61025] = "disorient", -- Polymorph (serpent) -- FIXME: gone ?
    [61721] = "disorient", -- Polymorph (rabbit)
    [61780] = "disorient", -- Polymorph (turkey)
    [ 3355] = "disorient", -- Freezing Trap
    [19386] = "disorient", -- Wyvern Sting
    [20066] = "disorient", -- Repentance
    [90337] = "disorient", -- Bad Manner (Monkey) -- FIXME: to check
    [ 2637] = "disorient", -- Hibernate
    [82676] = "disorient", -- Ring of Frost

    --[[ SILENCES ]]--
    [50479] = "silence", -- Nether Shock (Nether ray)
    [ 1330] = "silence", -- Garrote
    [25046] = "silence", -- Arcane Torrent (Energy version)
    [28730] = "silence", -- Arcane Torrent (Mana version)
    [50613] = "silence", -- Arcane Torrent (Runic power version)
    [69179] = "silence", -- Arcane Torrent (Rage version)
    [80483] = "silence", -- Arcane Torrent (Focus version)
    [15487] = "silence", -- Silence
    [34490] = "silence", -- Silencing Shot
    [18425] = "silence", -- Improved Kick (rank 1)
    [86759] = "silence", -- Improved Kick (rank 2)
    [18469] = "silence", -- Improved Counterspell (rank 1)
    [55021] = "silence", -- Improved Counterspell (rank 2)
    [24259] = "silence", -- Spell Lock (Felhunter)
    [47476] = "silence", -- Strangulate
    [18498] = "silence", -- Gag Order (Warrior talent)
    [81261] = "silence", -- Solar Beam
    [31935] = "silence", -- Avenger's Shield

    --[[ DISARMS ]]--
    [91644] = "disarm", -- Snatch (Bird of Prey)
    [51722] = "disarm", -- Dismantle
    [ 676] = "disarm", -- Disarm
    [64058] = "disarm", -- Psychic Horror (Disarm effect)
    [50541] = "disarm", -- Clench (Scorpid)

    --[[ FEARS ]]--
    [ 2094] = "fear", -- Blind
    [ 5782] = "fear", -- Fear (Warlock)
    [ 6358] = "fear", -- Seduction (Succubus)
    [ 5484] = "fear", -- Howl of Terror
    [ 8122] = "fear", -- Psychic Scream
    [65545] = "fear", -- Psychic Horror
    [ 1513] = "fear", -- Scare Beast
    [10326] = "fear", -- Turn Evil
    [ 5246] = "fear", -- Intimidating Shout (main target)
    [20511] = "fear", -- Intimidating Shout (secondary targets)

    --[[ CONTROL STUNS ]]--
    [89766] = "ctrlstun", -- Axe Toss (Felguard)
    [50519] = "ctrlstun", -- Sonic Blast (Bat)
    [12809] = "ctrlstun", -- Concussion Blow
    [46968] = "ctrlstun", -- Shockwave
    [ 853] = "ctrlstun", -- Hammer of Justice
    [ 5211] = "ctrlstun", -- Bash
    [24394] = "ctrlstun", -- Intimidation
    [22570] = "ctrlstun", -- Maim
    [ 408] = "ctrlstun", -- Kidney Shot
    [20549] = "ctrlstun", -- War Stomp
    [20252] = "ctrlstun", -- Intercept
    [20253] = "ctrlstun", -- Intercept
    [44572] = "ctrlstun", -- Deep Freeze
    [30283] = "ctrlstun", -- Shadowfury
    [ 2812] = "ctrlstun", -- Holy Wrath
    [22703] = "ctrlstun", -- Inferno Effect
    [54785] = "ctrlstun", -- Demon Leap (Warlock)
    [47481] = "ctrlstun", -- Gnaw (Ghoul)
    [93433] = "ctrlstun", -- Burrow Attack (Worm)
    [56626] = "ctrlstun", -- Sting (Wasp)
    [85388] = "ctrlstun", -- Throwdown
    [ 1833] = "ctrlstun", -- Cheap Shot
    [ 9005] = "ctrlstun", -- Pounce
    [88625] = "ctrlstun", -- Holy Word: Chastise
    [ 7922] = "ctrlstun", -- Charge

    --[[ RANDOM STUNS ]]--
    [64343] = "rndstun", -- Impact
    [39796] = "rndstun", -- Stoneclaw Stun
    [11210] = "rndstun", -- Improved Polymorph (rank 1)
    [12592] = "rndstun", -- Improved Polymorph (rank 2)

    --[[ CYCLONE ]]--
    [33786] = "cyclone", -- Cyclone

    --[[ ROOTS ]]--
    [33395] = "ctrlroot", -- Freeze (Water Elemental)
    [50245] = "ctrlroot", -- Pin (Crab)
    [ 122] = "ctrlroot", -- Frost Nova
    [ 339] = "ctrlroot", -- Entangling Roots
    [19975] = "ctrlroot", -- Nature's Grasp (Uses different spellIDs than Entangling Roots for the same spell)
    [64695] = "ctrlroot", -- Earthgrab (Storm, Earth and Fire talent)
    [ 4167] = "ctrlroot", -- Web (Spider)
    [54706] = "ctrlroot", -- Venom Web Spray (Silithid)
    [19306] = "ctrlroot", -- Counterattack
    [90327] = "ctrlroot", -- Lock Jaw (Dog)
    [11190] = "ctrlroot", -- Improved Cone of Cold (rank 1)
    [12489] = "ctrlroot", -- Improved Cone of Cold (rank 2)

    --[[ RANDOM ROOTS ]]--
    [23694] = "rndroot", -- Improved Hamstring -- FIXME: to check
    [44745] = "rndroot", -- Shattered Barrier (rank 1)
    [54787] = "rndroot", -- Shattered Barrier (rank 2)

    --[[ HORROR ]]--
    [ 6789] = "horror", -- Death Coil
    [64044] = "horror", -- Psychic Horror
    [87099] = "horror", -- Sin and Punishment (rank 1)
    [87100] = "horror", -- Sin and Punishment (rank 2)

    --[[ MISC ]]--
    [19503] = "scatters", -- Scatter Shot
    [31661] = "dragons", -- Dragon's Breath
    [ 605] = "mc", -- Mind Control
    [ 710] = "banish", -- Banish
    [19185] = "entrapment", -- Entrapment
    }

    -- DR Category names
    Data.categoryNames = {
    ["banish"] = L["Banish"],
    ["ctrlstun"] = L["Controlled stuns"],
    ["cyclone"] = L["Cyclone"],
    ["disarm"] = L["Disarms"],
    ["disorient"] = L["Disorients"],
    ["entrapment"] = L["Entrapment"],
    ["fear"] = L["Fears"],
    ["horror"] = L["Horrors"],
    ["mc"] = L["Mind Control"],
    ["rndroot"] = L["Random roots"],
    ["rndstun"] = L["Random stuns"],
    ["ctrlroot"] = L["Controlled roots"],
    ["scatters"] = L["Scatter Shot"],
    ["dragons"] = L["Dragon's Breath"],
    ["silence"] = L["Silences"],
    ["taunt"] = L["Taunts"],
    }

    -- Categories that have DR in PvE as well as PvP
    Data.pveDR = {
    ["ctrlstun"] = true,
    ["rndstun"] = true,
    ["taunt"] = true,
    ["cyclone"] = true,
    }

    -- Public APIs
    -- Category name in something usable
    function Data:GetCategoryName(cat)
    return cat and Data.categoryNames[cat] or nil
    end

    -- Spell list
    function Data:GetSpells()
    return Data.spells
    end

    -- Seconds before DR resets
    function Data:GetResetTime()
    return Data.RESET_TIME
    end

    -- Get the category of the spellID
    function Data:GetSpellCategory(spellID)
    return spellID and Data.spells[spellID] or nil
    end

    -- Does this category DR in PvE?
    function Data:IsPVE(cat)
    return cat and Data.pveDR[cat] or nil
    end

    -- List of categories
    function Data:GetCategories()
    return Data.categoryNames
    end

    -- Next DR, if it's 1.0, next is 0.50, if it's 0.[50] = "ctrlroot",next is 0.[25] = "ctrlroot",and such
    function Data:NextDR(diminished)
    if( diminished == 1 ) then
    return 0.50
    elseif( diminished == 0.50 ) then
    return 0.25
    end

    return 0
    end

    --[[ EXAMPLES ]]--
    -- This is how you would track DR easily, you're welcome to do whatever you want with the below functions

    --[[
    local trackedPlayers = {}
    local function debuffGained(spellID, destName, destGUID, isEnemy, isPlayer)
    -- Not a player, and this category isn't diminished in PVE, as well as make sure we want to track NPCs
    local drCat = DRData:GetSpellCategory(spellID)
    if( not isPlayer and not DRData:IsPVE(drCat) ) then
    return
    end

    if( not trackedPlayers[destGUID] ) then
    trackedPlayers[destGUID] = {}
    end

    -- See if we should reset it back to undiminished
    local tracked = trackedPlayers[destGUID][drCat]
    if( tracked and tracked.reset <= GetTime() ) then
    tracked.diminished = 1.0
    end
    end

    local function debuffFaded(spellID, destName, destGUID, isEnemy, isPlayer)
    local drCat = DRData:GetSpellCategory(spellID)
    if( not isPlayer and not DRData:IsPVE(drCat) ) then
    return
    end

    if( not trackedPlayers[destGUID] ) then
    trackedPlayers[destGUID] = {}
    end

    if( not trackedPlayers[destGUID][drCat] ) then
    trackedPlayers[destGUID][drCat] = { reset = 0, diminished = 1.0 }
    end

    local time = GetTime()
    local tracked = trackedPlayers[destGUID][drCat]

    tracked.reset = time + DRData:GetResetTime()
    tracked.diminished = DRData:NextDR(tracked.diminished)

    -- Diminishing returns changed, now you can do an update
    end

    local function resetDR(destGUID)
    -- Reset the tracked DRs for this person
    if( trackedPlayers[destGUID] ) then
    for cat in pairs(trackedPlayers[destGUID]) do
    trackedPlayers[destGUID][cat].reset = 0
    trackedPlayers[destGUID][cat].diminished = 1.0
    end
    end
    end

    local COMBATLOG_OBJECT_TYPE_PLAYER = COMBATLOG_OBJECT_TYPE_PLAYER
    local COMBATLOG_OBJECT_REACTION_HOSTILE = COMBATLOG_OBJECT_REACTION_HOSTILE
    local COMBATLOG_OBJECT_CONTROL_PLAYER = COMBATLOG_OBJECT_CONTROL_PLAYER

    local eventRegistered = {["SPELL_AURA_APPLIED"] = true, ["SPELL_AURA_REFRESH"] = true, ["SPELL_AURA_REMOVED"] = true, ["PARTY_KILL"] = true, ["UNIT_DIED"] = true}
    local function COMBAT_LOG_EVENT_UNFILTERED(self, event, timestamp, eventType, sourceGUID, sourceName, sourceFlags, destGUID, destName, destFlags, spellID, spellName, spellSchool, auraType)
    if( not eventRegistered[eventType] ) then
    return
    end

    -- Enemy gained a debuff
    if( eventType == "SPELL_AURA_APPLIED" ) then
    if( auraType == "DEBUFF" and DRData:GetSpellCategory(spellID) ) then
    local isPlayer = ( bit.band(destFlags, COMBATLOG_OBJECT_TYPE_PLAYER) ==
    LOG_OBJECT_TYPE_PLAYER or bit.band(destFlags, COMBATLOG_OBJECT_CONTROL_PLAYER) == COMBATLOG_OBJECT_CONTROL_PLAYER )
    debuffGained(spellID, destName, destGUID, (bit.band(destFlags, COMBATLOG_OBJECT_REACTION_HOSTILE) == COMBATLOG_OBJECT_REACTION_HOSTILE), isPlayer)
    end

    -- Enemy had a debuff refreshed before it faded, so fade + gain it quickly
    elseif( eventType == "SPELL_AURA_REFRESH" ) then
    if( auraType == "DEBUFF" and DRData:GetSpellCategory(spellID) ) then
    local isPlayer = ( bit.band(destFlags, COMBATLOG_OBJECT_TYPE_PLAYER) == COMBATLOG_OBJECT_TYPE_PLAYER or bit.band(destFlags, COMBATLOG_OBJECT_CONTROL_PLAYER) == COMBATLOG_OBJECT_CONTROL_PLAYER )
    local isHostile = (bit.band(destFlags, COMBATLOG_OBJECT_REACTION_HOSTILE) == COMBATLOG_OBJECT_REACTION_HOSTILE)
    debuffFaded(spellID, destName, destGUID, isHostile, isPlayer)
    debuffGained(spellID, destName, destGUID, isHostile, isPlayer)
    end

    -- Buff or debuff faded from an enemy
    elseif( eventType == "SPELL_AURA_REMOVED" ) then
    if( auraType == "DEBUFF" and DRData:GetSpellCategory(spellID) ) then
    local isPlayer = ( bit.band(destFlags, COMBATLOG_OBJECT_TYPE_PLAYER) == COMBATLOG_OBJECT_TYPE_PLAYER or bit.band(destFlags, COMBATLOG_OBJECT_CONTROL_PLAYER) == COMBATLOG_OBJECT_CONTROL_PLAYER )
    debuffFaded(spellID, destName, destGUID, (bit.band(destFlags, COMBATLOG_OBJECT_REACTION_HOSTILE) == COMBATLOG_OBJECT_REACTION_HOSTILE), isPlayer)
    end

    -- Don't use UNIT_DIED inside arenas due to accuracy issues, outside of arenas we don't care too much
    elseif( ( eventType == "UNIT_DIED" and select(2, IsInInstance()) ~= "arena" ) or eventType == "PARTY_KILL" ) then
    resetDR(destGUID)
    end
    end]]

    [PQR]LF DR tracker Script
  2. #2
    Numba1stunna1's Avatar Active Member
    Reputation
    70
    Join Date
    Dec 2013
    Posts
    182
    Thanks G/R
    1/34
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nevermind, I figured how to make my own. Thanks.

  3. #3
    xxspokiixx's Avatar Active Member
    Reputation
    28
    Join Date
    Jan 2014
    Posts
    133
    Thanks G/R
    26/12
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    can you share your profile when you finish it?, I have already the Vitalic, Cokx and Blind and till now my favorite is from Vitalic :P.

  4. #4
    Numba1stunna1's Avatar Active Member
    Reputation
    70
    Join Date
    Dec 2013
    Posts
    182
    Thanks G/R
    1/34
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah sure, I will post it on the Bots forum once I am done tirelessly testing it. This is my first week working on it and it's almost done.

  5. #5
    Numba1stunna1's Avatar Active Member
    Reputation
    70
    Join Date
    Dec 2013
    Posts
    182
    Thanks G/R
    1/34
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I need someone who knows Event logger scripts to show me how to clear the logs after a certain time. The event logger on my DR tracker starts to drop FPS after 10-20 minutes after reloading.

  6. #6
    G0tha's Avatar Member
    Reputation
    9
    Join Date
    Jul 2013
    Posts
    76
    Thanks G/R
    4/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    for i=1,#DRtable do
    local timestamp=DRtable[i].timestamp
    if GetTime()>timestamp+15 then
    tremove(DRtable,i)
    end
    end
    Not sure how your function looks like, but i can't imagine this may cause any FPS drops in the game.
    Last edited by G0tha; 10-22-2014 at 08:34 AM.

  7. #7
    Numba1stunna1's Avatar Active Member
    Reputation
    70
    Join Date
    Dec 2013
    Posts
    182
    Thanks G/R
    1/34
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey Gotha, sorry for foregetting about this post. I figured out how to clear the table. Thanks for your help, anyways.

Similar Threads

  1. Simple PQR Script Request , Path of Frost
    By sharkyx1x in forum WoW Bots Questions & Requests
    Replies: 5
    Last Post: 09-20-2018, 08:29 AM
  2. PQR and Dr trackers
    By Poper21 in forum WoW Bot Maps And Profiles
    Replies: 3
    Last Post: 10-26-2016, 12:33 AM
  3. Convert PQR Profile into LUA script ?
    By leinadz in forum WoW Bots Questions & Requests
    Replies: 6
    Last Post: 03-06-2014, 01:38 AM
  4. PQR auto follow tank script?
    By markbro in forum WoW Bots Questions & Requests
    Replies: 2
    Last Post: 12-05-2013, 12:13 AM
  5. [PQR] Ret Paladin (simple) "cleanse" script
    By tomblk in forum WoW Bot Maps And Profiles
    Replies: 0
    Last Post: 02-05-2013, 05:09 AM
All times are GMT -5. The time now is 02:28 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search