дополнение The War Within

Открытый раздел для обсуждений
Mazahaka
Сообщения: 45
Зарегистрирован: 05 ноя 2017, 10:16

Re: дополнение The War Within

Сообщение Mazahaka » 07 окт 2024, 12:28

splintmaster писал(а):
07 окт 2024, 05:50
Тоже на него смотрел, единственное что не понравилось - Это прям Бот. Сам подумываю про aimsharp. Единственно, досадно, нет пробной версии чтоб пощупать.
aimsharp похоже на спам , не форума просто сайт на вордпрессе , это гамно какое то

noname123
Сообщения: 193
Зарегистрирован: 19 мар 2020, 09:15

Re: дополнение The War Within

Сообщение noname123 » 07 окт 2024, 14:38

Балак писал(а):
03 окт 2024, 15:01
res = Hekili_GetRecommendedAbility("Primary", 1)

давайте сообразим как прикрутить?)
возвращаеть spellID)
Хорошая идея, думаю так даже можно будет бота заставить работать на офе пока его не актуализируют.

1. Заходим в папку с аддоном Hekili, находим там и открываем Core.lua
2. Воспользуйтесь поиском по названию и найдите вот такую строчку function Hekili.Update( initial )
3. Выделите всё начиная с этой строчки до самого конца файла.
4. Замените на этот код и сохраните результат.

p.s. Строка кода для актуального на момент написания аддона Hekili-v11.0.2-1.0.20a . Для удобства поиска добавленные мной строки содержат комментарий "-- For BLACK"

Код: Выделить всё

local ManualRecommendations  -- For BLACK

function Hekili.Update( initial )
    if not Hekili:ScriptsLoaded() then
        Hekili:LoadScripts()
        return
    end

    if not Hekili:IsValidSpec() then
        return
    end

    local profile = Hekili.DB.profile

    local specID = state.spec.id
    if not specID then return end

    local spec = rawget( profile.specs, specID )
    if not spec then return end

    local packName = spec.package
    if not packName then return end

    local pack = rawget( profile.packs, packName )
    if not pack then return end

    local debug = Hekili.ActiveDebug

    Hekili:GetNumTargets( true )

    local snaps

    local dispName = initial or displayRules[ lastDisplay ][ 3 ]
    state.display = dispName

    for round = 1, 5 do
        local rule, fullReset, nextDisplay = unpack( displayRules[ dispName ] )
        local display = rawget( profile.displays, dispName )

        fullReset = fullReset or state.offset > 0

        if debug and lastSnapshot[ dispName ] and GetTime() - lastSnapshot[ dispName ] < 0.5 then
            -- Disable snapshotting to prevent loops with errors.
            Hekili.ActiveDebug = false
            debug = false
        end

        if debug then
            Hekili:SetupDebug( dispName )
            lastSnapshot[ dispName ] = GetTime()
            Hekili:Debug( "*** START OF NEW DISPLAY: %s ***", dispName )
        end

        local UI = ns.UI.Displays[ dispName ]
        local Queue = UI.Recommendations

        UI:SetThreadLocked( true )

        if Queue then
            for k, v in pairs( Queue ) do
                for l, w in pairs( v ) do
                    if type( Queue[ k ][ l ] ) ~= "table" then
                        Queue[ k ][ l ] = nil
                    end
                end
            end
        end

        local checkstr = ""

        if UI.Active and UI.alpha > 0 and rule( profile ) then
            for i = #Stack, 1, -1 do tinsert( StackPool, tremove( Stack, i ) ) end
            for i = #Block, 1, -1 do tinsert( StackPool, tremove( Block, i ) ) end

            state.reset( dispName, fullReset )

            -- Clear the stack in case we interrupted ourselves.
            wipe( InUse )

            state.system.specID   = specID
            state.system.specInfo = spec
            state.system.packName = packName
            state.system.packInfo = pack
            state.system.display  = dispName
            state.system.dispInfo = display

            local actualStartTime = debugprofilestop()

            local numRecs = display.numIcons or 4

            if display.flash.enabled and display.flash.suppress then
                numRecs = 1
            end

            for i = 1, numRecs do
                local chosen_depth = 0

                Queue[ i ] = Queue[ i ] or {}

                local slot = Queue[ i ]
                slot.index = i
                state.index = i

                if debug then Hekili:Debug( 0, "\nRECOMMENDATION #%d ( Offset: %.2f, GCD: %.2f, %s: %.2f ).\n", i, state.offset, state.cooldown.global_cooldown.remains, ( state.buff.casting.v3 == 1 and "Channeling" or "Casting" ), state.buff.casting.remains ) end

                local action, wait, depth

                state.delay = 0
                state.delayMin = 0
                state.delayMax = dispName ~= "Primary" and dispName ~= "AOE" and display.forecastPeriod or 15

                local hadProj = false

                local events = state:GetQueue()
                local event = events[ 1 ]
                local n = 1

                if debug and #events > 0 then
                    Hekili:Debug( 1, "There are %d queued events to review.", #events )
                end

                while( event ) do
                    local eStart

                    if debug then
                        eStart = debugprofilestop()

                        local resources

                        for k in orderedPairs( class.resources ) do
                            resources = ( resources and ( resources .. ", " ) or "" ) .. string.format( "%s[ %.2f / %.2f ]", k, state[ k ].current, state[ k ].max )
                        end
                        Hekili:Debug( 1, "Resources: %s\n", resources )

                        if state.channeling then
                            Hekili:Debug( 1, "Currently channeling ( %s ) until ( %.2f ).\n", state.channel, state.channel_remains )
                        end
                    end

                    ns.callHook( "step" )

                    local t = event.time - state.now - state.offset

                    if t < 0 then
                        state.offset = state.offset - t
                        if debug then Hekili:Debug( 1, "Finishing queued event #%d ( %s of %s ) due at %.2f because the event should've already occurred.\n", n, event.type, event.action, t ) end
                        state:HandleEvent( event )
                        state.offset = state.offset + t
                        event = events[ 1 ]
                    --[[ elseif t < 0.2 then
                        if debug then Hekili:Debug( 1, "Finishing queued event #%d ( %s of %s ) due at %.2f because the event occurs w/in 0.2 seconds.\n", n, event.type, event.action, t ) end
                        state.advance( t )
                        if event == events[ 1 ] then
                            state:HandleEvent( event )
                        end
                        event = events[ 1 ] ]]
                    else
                        --[[
                            Okay, new paradigm.  We're checking whether we should break channeled spells before we worry about casting while casting.
                            Are we channeling?
                                a.  If yes, check whether conditions are met to break the channel.
                                    i.  If yes, allow the channel to be broken by anything but the channeled spell itself.
                                        If we get a condition-pass for the channeled spell, stop seeking recommendations and move on.
                                    ii. If no, move on to checking whether we can cast while casting (old code).
                                b.  If no, move on to checking whether we can cast while casting (old code).
                            ]]

                        local channeling, shouldBreak = state:IsChanneling(), false

                        if channeling then
                            if debug then Hekili:Debug( "We are channeling, checking if we should break the channel..." ) end
                            shouldBreak = Hekili:CheckChannel( nil, 0 )
                            state.channel_breakable = shouldBreak
                        else
                            state.channel_breakable = false
                        end

                        local casting, shouldCheck = state:IsCasting(), false

                        if ( casting or ( channeling and not shouldBreak ) ) and state.spec.can_dual_cast then
                            shouldCheck = false

                            for spell in pairs( state.spec.dual_cast ) do
                                if debug then Hekili:Debug( "CWC: %s | %s | %s | %s | %.2f | %s | %.2f | %.2f", spell, tostring( state:IsKnown( spell ) ), tostring( state:IsUsable( spell ) ), tostring( class.abilities[ spell ].dual_cast ), state:TimeToReady( spell ), tostring( state:TimeToReady( spell ) <= t ), state.offset, state.delay ) end
                                if class.abilities[ spell ].dual_cast and state:IsKnown( spell ) and state:IsUsable( spell ) and state:TimeToReady( spell ) <= t then
                                    shouldCheck = true
                                    break
                                end
                            end
                        end


                        local overrideIndex, overrideAction, overrideType, overrideTime

                        if channeling and ( shouldBreak or shouldCheck ) and event.type == "CHANNEL_TICK" then

                            local eventAbility = class.abilities[ event.action ]
                            if eventAbility and not eventAbility.tick then
                                -- The ability doesn't actually do anything at any tick times, so let's use the time of the next non-channel tick event instead.
                                for i = 1, #events do
                                    local e = events[ i ]

                                    if e.type ~= "CHANNEL_TICK" then
                                        overrideIndex = i
                                        overrideAction = e.action
                                        overrideType = e.type
                                        overrideTime = e.time - state.now - state.offset
                                        if debug then Hekili:Debug( "As %s's channel has no tick function, we will check between now and %s's %s event in %.2f seconds.", event.action, overrideAction, overrideType, overrideTime ) end
                                        break
                                    end
                                end
                            end
                        end

                        if ( casting or channeling ) and not shouldBreak and not shouldCheck then
                            if debug then Hekili:Debug( 1, "Finishing queued event #%d ( %s of %s ) due at %.2f as player is casting and castable spells are not ready.\nCasting: %s, Channeling: %s, Break: %s, Check: %s", n, event.type, event.action, t, casting and "Yes" or "No", channeling and "Yes" or "No", shouldBreak and "Yes" or "No", shouldCheck and "Yes" or "No" ) end
                            if t >= 0 then
                                state.advance( t )

                                local resources

                                for k in orderedPairs( class.resources ) do
                                    resources = ( resources and ( resources .. ", " ) or "" ) .. string.format( "%s[ %.2f / %.2f ]", k, state[ k ].current, state[ k ].max )
                                end
                                Hekili:Debug( 1, "Resources: %s\n", resources )
                            end
                            event = events[ 1 ]
                        else
                            state:SetConstraint( 0, ( overrideTime or t ) - 0.01 )

                            hadProj = true

                            if debug then Hekili:Debug( 1, "Queued event #%d (%s %s) due at %.2f; checking pre-event recommendations.\n", overrideIndex or n, overrideAction or event.action, overrideType or event.type, overrideTime or t ) end

                            if casting or channeling then
                                state:ApplyCastingAuraFromQueue()
                                if debug then Hekili:Debug( 2, "Player is casting for %.2f seconds.  %s.", state.buff.casting.remains, shouldBreak and "We can break the channel" or "Only spells castable while casting will be used" ) end
                            else
                                state.removeBuff( "casting" )
                            end

                            local waitLoop = 0

                            repeat
                                action, wait, depth = Hekili:GetNextPrediction( dispName, packName, slot )

                                if action == "wait" then
                                    if debug then Hekili:Debug( "EXECUTING WAIT ( %.2f ) EVENT AT ( +%.2f ) AND RECHECKING RECOMMENDATIONS...", slot.waitSec, wait ) end
                                    state.advance( wait + slot.waitSec )

                                    slot.action = nil
                                    slot.actionName = nil
                                    slot.actionID = nil

                                    state.delay = 0
                                    state.delayMin = 0
                                    state.delayMax = dispName ~= "Primary" and dispName ~= "AOE" and display.forecastPeriod or 15

                                    action, wait = nil, 10

                                    action, wait, depth = Hekili:GetNextPrediction( dispName, packName, slot )
                                end

                                waitLoop = waitLoop + 1

                                if waitLoop > 2 then
                                    if debug then Hekili:Debug( "BREAKING WAIT LOOP!" ) end
                                    slot.action = nil
                                    slot.actionName = nil
                                    slot.actionID = nil

                                    state.delay = 0
                                    state.delayMin = 0
                                    state.delayMax = dispName ~= "Primary" and dispName ~= "AOE" and display.forecastPeriod or 15

                                    action, wait = nil, 10
                                    break
                                end
                            until action ~= "wait"

                            if action == "wait" then
                                action, wait = nil, 10
                            end

                            if not action then
                                if debug then Hekili:Debug( "Time spent on event #%d PREADVANCE: %.2fms...", n, debugprofilestop() - eStart ) end
                                if debug then Hekili:Debug( 1, "No recommendation found before event #%d (%s %s) at %.2f; triggering event and continuing ( %.2f ).\n", n, event.action or "NO ACTION", event.type or "NO TYPE", t, state.offset + state.delay ) end

                                state.advance( overrideTime or t )
                                if debug then Hekili:Debug( "Time spent on event #%d POSTADVANCE: %.2fms...", n, debugprofilestop() - eStart ) end

                                event = events[ 1 ]
                            else
                                break
                            end
                        end
                    end

                    n = n + 1

                    if n > 10 then
                        if debug then Hekili:Debug( "WARNING:  Attempted to process 10+ events; breaking to avoid CPU wastage." ) end
                        break
                    end

                    Hekili.ThreadStatus = "Processed event #" .. n .. " for " .. dispName .. "."
                end

                if not action then
                    state.delay = 0
                    state.delayMin = 0
                    state.delayMax = dispName ~= "Primary" and dispName ~= "AOE" and display.forecastPeriod or 15

                    if class.file == "DEATHKNIGHT" then
                        state:SetConstraint( 0, min( state.delayMax, max( 0.01 + state.rune.cooldown * 2, 10 ) ) )
                    else
                        state:SetConstraint( 0, min( state.delayMax, 10 ) )
                    end

                    if hadProj and debug then Hekili:Debug( "[ ** ] No recommendation before queued event(s), checking recommendations after %.2f.", state.offset ) end

                    if debug then
                        local resources

                        for k in orderedPairs( class.resources ) do
                            resources = ( resources and ( resources .. ", " ) or "" ) .. string.format( "%s[ %.2f / %.2f ]", k, state[ k ].current, state[ k ].max )
                        end
                        Hekili:Debug( 1, "Resources: %s", resources or "none" )
                        ns.callHook( "step" )

                        if state.channeling then
                            Hekili:Debug( " - Channeling ( %s ) until ( %.2f ).", state.channel, state.channel_remains )
                        end
                    end

                    local waitLoop = 0

                    repeat
                        action, wait, depth = Hekili:GetNextPrediction( dispName, packName, slot )

                        if action == "wait" then
                            if debug then Hekili:Debug( "EXECUTING WAIT ( %.2f ) EVENT AT ( +%.2f ) AND RECHECKING RECOMMENDATIONS...", slot.waitSec, wait ) end
                            state.advance( wait + slot.waitSec )

                            slot.action = nil
                            slot.actionName = nil
                            slot.actionID = nil

                            state.delay = 0
                            state.delayMin = 0
                            state.delayMax = dispName ~= "Primary" and dispName ~= "AOE" and display.forecastPeriod or 15

                            action, wait = nil, 10

                            action, wait, depth = Hekili:GetNextPrediction( dispName, packName, slot )
                        end

                        waitLoop = waitLoop + 1

                        if waitLoop > 2 then
                            if debug then Hekili:Debug( "BREAKING WAIT LOOP!" ) end

                            slot.action = nil
                            slot.actionName = nil
                            slot.actionID = nil

                            state.delay = 0
                            state.delayMin = 0
                            state.delayMax = dispName ~= "Primary" and dispName ~= "AOE" and display.forecastPeriod or 15

                            action, wait = nil, 10

                            break
                        end
                    until action ~= "wait"

                    if action == "wait" then
                        action, wait = nil, 10
                    end
                end

                state.delay = wait

                if debug then
                    Hekili:Debug( "Recommendation #%d is %s at %.2fs (%.2fs).", i, action or "NO ACTION", wait or state.delayMax, state.offset + state.delay )
                end

                if action then
                    slot.time = state.offset + wait
                    slot.exact_time = state.now + state.offset + wait
                    slot.delay = i > 1 and wait or ( state.offset + wait )
                    slot.since = i > 1 and slot.time - Queue[ i - 1 ].time or 0
                    slot.resources = slot.resources or {}
                    slot.depth = chosen_depth

                    state.scriptID = slot.script

                    local ability = class.abilities[ action ]
                    local cast_target = i == 1 and state.cast_target ~= "nobody" and state.cast_target or state.target.unit

                    if slot.indicator == "cycle" then
                        state.SetupCycle( ability )
                        cast_target = cast_target .. "c"
                    end

                    if debug then scripts:ImplantDebugData( slot ) end

                    checkstr = checkstr and ( checkstr .. ':' .. action ) or action

                    slot.keybind, slot.keybindFrom = Hekili:GetBindingForAction( action, display, i )

                    slot.resource_type = state.GetResourceType( action )

                    for k,v in pairs( class.resources ) do
                        slot.resources[ k ] = state[ k ].current
                    end

                    if i < display.numIcons then
                        -- Advance through the wait time.
                        state.this_action = action

                        if state.delay > 0 then state.advance( state.delay ) end

                        local cast = ability.cast or 0

                        if ability.gcd ~= "off" and state.cooldown.global_cooldown.remains == 0 then
                            state.setCooldown( "global_cooldown", state.gcd.execute )
                        end

                        if state.buff.casting.up and not ability.dual_cast then
                            state.stopChanneling( false, action )
                            state.removeBuff( "casting" )
                        end

                        if cast > 0 then
                            if not ability.channeled then
                                if debug then Hekili:Debug( "Queueing %s cast finish at %.2f [+%.2f] on %s.", action, state.query_time + cast, state.offset + cast, cast_target ) end

                                state.applyBuff( "casting", ability.cast, nil, ability.id, nil, false )
                                state:QueueEvent( action, state.query_time, state.query_time + cast, "CAST_FINISH", cast_target )
                            else
                                if ability.charges and ability.charges > 1 and ability.recharge > 0 then
                                    state.spendCharges( action, 1 )

                                elseif action ~= "global_cooldown" and ability.cooldown > 0 then
                                    state.setCooldown( action, ability.cooldown )

                                end

                                if debug then Hekili:Debug( "Queueing %s channel finish at %.2f [%.2f+%.2f].", action, state.query_time + cast, state.offset, cast, cast_target ) end
                                state:QueueEvent( action, state.query_time, state.query_time + cast, "CHANNEL_FINISH", cast_target )

                                -- Queue ticks because we may not have an ability.tick function, but may have resources tied to an aura.
                                if ability.tick_time then
                                    local ticks = floor( cast / ability.tick_time )
                                    for i = 1, ticks do
                                        state:QueueEvent( action, state.query_time, state.query_time + ( i * ability.tick_time ), "CHANNEL_TICK", cast_target )
                                    end
                                    if debug then Hekili:Debug( "Queued %d ticks of channel %s.", ticks, action ) end
                                end

                                if Hekili.Scripts.Channels and Hekili.Scripts.Channels[ packName ] and Hekili.Scripts.Channels[ packName ][ action ] then
                                    state:QueueEvent( action, state.query_time, state.cooldown.global_cooldown.expires, "GCD_FINISH", cast_target )
                                end

                                state:RunHandler( action )
                                ns.spendResources( action )
                            end
                        else
                            -- Instants.
                            if ability.charges and ability.charges > 1 and ability.recharge > 0 then
                                state.spendCharges( action, 1 )

                            elseif action ~= "global_cooldown" and ability.cooldown > 0 then
                                state.setCooldown( action, ability.cooldown )

                            end

                            ns.spendResources( action )
                            state:RunHandler( action )
                        end

                        -- Projectile spells have two handlers, effectively.  A handler (run on cast/channel finish), and then an impact handler.
                        if ability.isProjectile then
                            state:QueueEvent( action, state.query_time + cast, nil, "PROJECTILE_IMPACT", cast_target )
                        end

                        if state.trinket.t1.is[ action ] and state.trinket.t2.has_cooldown then
                            local t2 = state.trinket.t2.cooldown.key
                            local duration = ability.cooldown / 6
                            if state.cooldown[ t2 ].remains < duration then
                                state.setCooldown( t2, duration )
                            end
                        elseif state.trinket.t2.is[ action ] and state.trinket.t1.has_cooldown then
                            local t1 = state.trinket.t1.cooldown.key
                            local duration = ability.cooldown / 6
                            if state.cooldown[ t1 ].remains < duration then
                                state.setCooldown( t1, duration )
                            end
                        end
                    end

                else
                    for s = i, numRecs do
                        action = action or ''
                        checkstr = checkstr and ( checkstr .. ':' .. action ) or action
                        slot[s] = nil
                    end

                    state.delay = 0

                    if debug then
                        local resInfo

                        for k in orderedPairs( class.resources ) do
                            local res = rawget( state, k )

                            if res then
                                local forecast = res.forecast and res.fcount and res.forecast[ res.fcount ]
                                local final = "N/A"

                                if forecast then
                                    final = string.format( "%.2f @ [%d - %s] %.2f", forecast.v, res.fcount, forecast.e or "none", forecast.t - state.now - state.offset )
                                end

                                resInfo = ( resInfo and ( resInfo .. ", " ) or "" ) .. string.format( "%s[ %.2f / %.2f || %s ]", k, res.current, res.max, final )
                            end

                            if resInfo then resInfo = "Resources: " .. resInfo end
                        end

                        if resInfo then
                            Hekili:Debug( resInfo )
                        end
                    else
                        if not hasSnapped and profile.autoSnapshot and InCombatLockdown() and state.level >= 70 and ( dispName == "Primary" or dispName == "AOE" ) then
                            Hekili:Print( "Unable to make recommendation for " .. dispName .. " #" .. i .. "; triggering auto-snapshot..." )
                            hasSnapped = dispName
                            UI:SetThreadLocked( false )
                            return "AutoSnapshot"
                        end
                    end
                    break
                end
            end

            UI.NewRecommendations = true
            UI.RecommendationsStr = checkstr

            UI:SetThreadLocked( false )

            if WeakAuras and WeakAuras.ScanEvents then
                if not UI.EventPayload then
                    UI.EventPayload = {
                        {}, -- [1]
                    }
                    setmetatable( UI.EventPayload, {
                        __index = UI.EventPayload[ 1 ],
                        __mode  = "kv"
                    } )
                end

                for i = 1, numRecs do
                    if UI.EventPayload[ i ] then wipe( UI.EventPayload[ i ] )
                    else UI.EventPayload[ i ] = {} end

                    for k, v in pairs( Queue[ i ] ) do
                        UI.EventPayload[ i ][ k ] = v
                    end
                end

                WeakAuras.ScanEvents( "HEKILI_RECOMMENDATION_UPDATE", dispName, Queue[ 1 ].actionID, Queue[ 1 ].indicator, Queue[ 1 ].empower_to, UI.EventPayload )
				ManualRecommendations = Queue[ 1 ].actionID -- For BLACK
            end

            if debug then
                Hekili:Debug( "Time spent generating recommendations:  %.2fms",  debugprofilestop() - actualStartTime )
                Hekili:Yield( "Yield before saving the snapshot for " .. dispName .. "." )

                if Hekili:SaveDebugSnapshot( dispName ) then
                    if snaps then
                        snaps = snaps .. ", " .. dispName
                    else
                        snaps = dispName
                    end

                    if Hekili.Config then LibStub( "AceConfigDialog-3.0" ):SelectGroup( "Hekili", "snapshots" ) end
                end
            end

            lastDisplay = dispName
            dispName = nextDisplay
            state.display = dispName

            if round < 5 then Hekili:Yield( "Recommendations finished for " .. lastDisplay .. ".", nil, true ) end
        else
            if UI.RecommendationsStr then
                UI.RecommendationsStr = nil
                UI.NewRecommendations = true
            end

            lastDisplay = dispName
            dispName = nextDisplay
            state.display = dispName
        end
    end

    if snaps then
        Hekili:Print( "Snapshots saved:  " .. snaps .. "." )
    end
end
Hekili:ProfileCPU( "ThreadedUpdate", Hekili.Update )

function HekiliRecommendations() -- For BLACK
    return ManualRecommendations
end

function Hekili_GetRecommendedAbility( display, entry )
    entry = entry or 1

    if not rawget( Hekili.DB.profile.displays, display ) then
        return nil, "Display not found."
    end

    if not ns.queue[ display ] then
        return nil, "No queue for that display."
    end

    local slot = ns.queue[ display ][ entry ]

    if not slot or not slot.actionID then
        return nil, "No entry #" .. entry .. " for that display."
    end

    local payload = Hekili.DisplayPool[ display ].EventPayload

    return slot.actionID, slot.empower_to, payload and payload[ entry ]
end

local usedCPU = {}

function Hekili:DumpFrameInfo()
    wipe( usedCPU )
    for k, v in orderedPairs( ns.frameProfile ) do
        local usage, calls = GetFrameCPUUsage( v, true )

        -- calls = self.ECount[ k ] or calls

        if usage and calls > 0 then
            local db = {}

            db.name  = k or v:GetName()
            db.calls = calls
            db.usage = usage
            db.average = usage / calls

            db.peak = v.peakUsage

            table.insert( usedCPU, db )
        end
    end

    table.sort( usedCPU, function( a, b ) return a.usage < b.usage end )

    print( "Frame CPU Usage Data" )
    for i, v in ipairs( usedCPU ) do
        if v.peak and type( v.peak ) == "number" then
            print( format( "%-40s %6.2fms (%6d calls, %6.2fms average, %6.2fms peak)", v.name, v.usage, v.calls, v.average, v.peak ) )
        else
            print( format( "%-40s %6.2fms (%6d calls, %6.2fms average)", v.name, v.usage, v.calls, v.average ) )
            if v.peak then
                for k, info in pairs( v.peak ) do
                    print( " - " .. k .. ": " .. info )
                end
            end
        end
    end
end
После этих действий будет доступен пользовательский код в боте с названием HekiliRecommendations() который будет возвращать ID спелла который в первом квадрате с рекомендациями Hekili. Нужно его будет прировнять к нужной вам IDшке спела и тогда при совпадении условия будет тригериться блок в котором это условие и соответственно будет нажиматься спелл который вы в этот блок поставите.

5. (пример) Создаём блок в боте с условием "Пользовательский код HekiliRecommendations() == константа 204596" и в блок с этим условием уже как обычно добавляем спелл для использования с таким же ID в данном случае 204596.
Изображение

6. Повторить по аналогии с остальными спеллами.

Всё, можно пользоваться.
Последний раз редактировалось noname123 07 окт 2024, 15:41, всего редактировалось 1 раз.

kio57
Сообщения: 269
Зарегистрирован: 14 дек 2017, 13:01

Re: дополнение The War Within

Сообщение kio57 » 07 окт 2024, 15:10

Очень сложно и непонятно) Этот вариант уже работает? через что запускать вообще после этих манипуляций? Скриншотиков бы парочку. был бы очень брагодарен

noname123
Сообщения: 193
Зарегистрирован: 19 мар 2020, 09:15

Re: дополнение The War Within

Сообщение noname123 » 07 окт 2024, 15:27

kio57 писал(а):
07 окт 2024, 15:10
Очень сложно и непонятно) Этот вариант уже работает? через что запускать вообще после этих манипуляций? Скриншотиков бы парочку. был бы очень брагодарен
Да в смысле сложно ?!) нужно один код заменить на другой и всё. По поводу через что запускать я бы конечно поинтересовался какие есть варианты, ну да ладно.
По поводу работоспособности на офе затрудняюсь ответить, проверял это всё не там. Но должно работать т.к. всю проверяющую функцию выполняет аддон Hekili который актуализирован под ласт патч.

В боте всё будет выглядеть вот так Изображение

splintmaster
Сообщения: 41
Зарегистрирован: 01 фев 2023, 11:02

Re: дополнение The War Within

Сообщение splintmaster » 07 окт 2024, 17:25

на офе не работает =)
не нажимает скилы.

Mazahaka
Сообщения: 45
Зарегистрирован: 05 ноя 2017, 10:16

Re: дополнение The War Within

Сообщение Mazahaka » 07 окт 2024, 17:29

надо попробовать хотя он не двигается понимаешь ты сам не сможешь так быстро переводить фокус как бот , но я попробую

noname123
Сообщения: 193
Зарегистрирован: 19 мар 2020, 09:15

Re: дополнение The War Within

Сообщение noname123 » 07 окт 2024, 17:39

Для TWW !

Ковыряться мне впадлу если честно с этим, вот рабочий костыль который у меня получился по фасту. Дальше уже сами)

Вверху сборки делаем луа блок и вставляем туда этот код

Код: Выделить всё

IsSpellInRange = C_Spell.IsSpellInRange
IsCurrentSpell = C_Spell.IsCurrentSpell
GetSpellInfo = C_Spell.GetSpellInfo
GetNumSpellTabs = C_SpellBook.GetNumSpellBookSkillLines
GetSpellTabInfo = C_SpellBook.GetSpellBookSkillLineInfo
GetSpellCooldown = C_Spell.GetSpellCooldown
GetSpellBookItemName = C_SpellBook.GetSpellBookItemName
GetSpellTexture = C_Spell.GetSpellTexture
GetSpellCharges = C_Spell.GetSpellCharges
GetSpellDescription = C_Spell.GetSpellDescription
GetSpellCount = C_Spell.GetSpellCastCount
IsUsableSpell = C_Spell.IsSpellUsable
После этого бот по крайней мере начнёт нажимать макросы в которые вы запишите свои спеллы.
Ну и дальше по инструкции для Hekili по моему посту выше. ВАЖНО необходимо наличие аддонa WeakAuras !

Проверку на дальность (больше актуально для миликов) делаем через команду C_Spell.IsSpellInRange, например C_Spell.IsSpellInRange("Раскалывание душ", "target")

В итоге у меня получился вот такой вид у сборки (прожимает всё по рекомендациям очерёдности Hekili)
Изображение

пользовательский код для проверки кд спеллов

Код: Выделить всё

function Cooldown(spell)
    local start, duration, enabled
    local spellCooldownInfo = spell and C_Spell.GetSpellCooldown(spell)
    start = spellCooldownInfo and spellCooldownInfo.startTime
    duration = spellCooldownInfo and spellCooldownInfo.duration
    enabled = spellCooldownInfo and spellCooldownInfo.isEnabled
    if enabled and duration == 0 and start == 0 then
        return 0
    elseif enabled then
        return (duration - (GetTime() - start))
    else
        return 100000
    end
end
Чтобы у вас бот не спамил нонстопом макросы можно прикрутить данную проверку с оставшимся временем восстановления <= 0.35
Лично тут я взял id спелла без кд и поставил эту проверку в основу сборки чтобы на каждый спелл отдельно не записывать её.
Изображение

splintmaster
Сообщения: 41
Зарегистрирован: 01 фев 2023, 11:02

Re: дополнение The War Within

Сообщение splintmaster » 08 окт 2024, 07:39

У кого-то получилось пользоваться этими "костылями " на ритейле? У меня глухо. Пару раз все переделывал, но все равно бот не работает.
По поводу aimsharp: оплатил 1 неделю. Что скажу, работает на пикселях, источником ротации явkяется Hekili, так что вы прям как в воду глядели прикручивая Hekili. Есть нюансы, но думаю это поправимо (почти нет сэйвов в ротации). Пользоваться им вряд ли буду, дорого и совсем не то что BDPS, а еще подлагивает (там целая строка пикселей, наверное на пол экрана гдет), плюс иногда "горячие клавиши" делают на экране пстц например в самый горячий момент сворачивает игру и т.д..

noname123
Сообщения: 193
Зарегистрирован: 19 мар 2020, 09:15

Re: дополнение The War Within

Сообщение noname123 » 08 окт 2024, 07:54

splintmaster писал(а):
08 окт 2024, 07:39
У кого-то получилось пользоваться этими "костылями " на ритейле? У меня глухо. Пару раз все переделывал, но все равно бот не работает.
Окей, тогда нужно попытаться определить на каком этапе не работает.

С созданием луа блока в самом верху сборки думаю проблем не должно возникнуть. Тогда к следующему шагу перейдём, после луа блока поставь макрос и запиши в него команду на любой спелл /cast твой_спелл и посмотри будет ли в игре бот спамить этот макрос. Никаких блоков дополнительных с условиями не надо делать. Только луа блок и ниже макрос для проверки.

Этот момент у тебя работает ? В идеале бы скрин чтобы наглядно понимать где проблема.
Последний раз редактировалось noname123 08 окт 2024, 07:58, всего редактировалось 1 раз.

splintmaster
Сообщения: 41
Зарегистрирован: 01 фев 2023, 11:02

Re: дополнение The War Within

Сообщение splintmaster » 08 окт 2024, 07:58

мне в нижней части окошка BDPS пишет длинное число и все, ничего не нажимает.

Ответить

Кто сейчас на конференции

Сейчас этот форум просматривают: нет зарегистрированных пользователей и 1 гость