MMOMinion

Full Version: Bypassing skill manager
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

I have a few questions in regards to module creation.
I come from a rotation creating background on wow so have a basic understanding of lua from writing rotation profiles for PQR.

I am wanting to create a script that bypasses the bots skill manager, rendering it void for my purposes. The reason for this is so I can put a large number of strict parameters on spell usage. I've been reading through a number of threads involved released modules from both gw2 minion and ffxiv minion in an attempt to gather information on how the code works for this bot and can see that it should be possible to achieve what I want it to achieve. However I need some help to get me past the first hurdle. My first hurdle is creating the coding for the individual spells along with the strict parameters.

My questions are related to scholar class.

1. Currently, is the only way to heal to have a mob or player targeted before spells will trigger?
2. Is there a way to code 'hotkeys' you hold down to pause or to trigger an ability that needs ground targeting (thus pausing the routine while you place the ability)

The primary plan of this project is to create a standalone GUI Module within the bot for 1 class (Scholar) which houses every variable I could possibly need for each spell for the purposes of executing a more advanced routine. FFXIV seems rather basic in what you can do since you have a limited number of healing abilities at this early stage in the game (compared to say WoW) so I'm wanting to take full advantage of that to create an optimized routine.

As examples of what I'm thinking about in regards to a large amount of variables (using example values):

Code:
Adloquium
- 4 target types (Tank, Other party members, Self, All (explained below)
- Critical HP check >10% for 'All' group, this triggers Swiftcast for an instant Adloquium (whether this is optimal or not is irrelevant as its an example)
- Hp check for each target type (to chose the lowest of each type - Basic order would go: Look through tanks first as prio and find lowest health tank, if no tanks are below a hp% threshold then look at party members and find lowest hp of that group with its own hp% threshold etc etc..
- Range check for each player
- LoS Check (if thats possible currently?)
- Check player doesn't currently still have the shield provided by the spell from a previous cast.
- Check if a target currently has aggro from a mob, if so, prioritize if below another hp% threshold due to foreseeable damage intake.

Im sure theres a few more but you get the picture :D this was the sort of coding I did for wow routines and I enjoyed the challenge :)

With regards to the Module, since it will be full customization for Scholar I plan to have it "lock" the current skill manager routine to 'none' while the module activated (again, if that's possible).

If anyone can help me get started with using that example above, much thanks will be given and will save me a lot of time learning how this bot is coded :D

Cheers

p.s I know a number of those checks can already be obtained via the skill manager aswell as it having its own inbuilt priority list (the priority list is something im not sure can be down via a standalone script, will have to see)
The combat code was originally designed so that you could use either static class combat tasks or the skillmanager. If you look at the add_combat cne which is used for grinding and fate grinding, you'll see the following:

Code:
function e_add_combat:execute()
    if ( gSMactive == "1" ) then
        local newTask = ffxiv_task_skillmgrAttack.Create()
        newTask.targetid = ml_task_hub:CurrentTask().targetid
        ml_task_hub:CurrentTask():AddSubTask(newTask)
    else
        local newTask = ml_global_information.CurrentClass.Create()
        newTask.targetid = ml_task_hub:CurrentTask().targetid
        ml_task_hub:CurrentTask():AddSubTask(newTask)
    end
end

If the skillmanager is not enabled, then we will create a task using the current class, which is set in ffxiv.lua whenever we switch classes. You will see all the original class_routines in the class_routines subdirectory. Here's an example from the archer task:

Code:
c_ragingstrikes = inheritsFrom( ml_cause )
e_ragingstrikes = inheritsFrom( ml_effect )
function c_ragingstrikes:evaluate()
    local skill = ActionList:Get(101,1)
    if (skill ~= nil and skill.cd == 0) then
        if (not HasBuff(Player.id, 125)) then
            return true
        end
    end
    
    return false
end

function e_ragingstrikes:execute()
    local skill = ActionList:Get(101,1)
    if (skill ~= nil and skill.cd == 0) then
        skill:Cast() -- THIS NEEDS A TARGET
        ml_task_hub:CurrentTask().prevSkillID = 101
    end
end

function ffxiv_combat_archer:Init()
    --init cnes
    local ke_heavyshot = ml_element:create( "HeavyShot", c_heavyshot, e_heavyshot, 5 )
    self:add( ke_heavyshot, self.process_elements)
    
    local ke_straightshot = ml_element:create( "StraightShot", c_straightshot, e_straightshot, 10 )
    self:add( ke_straightshot, self.process_elements)
    
    local ke_venomousbite = ml_element:create( "VenomousBite", c_venomousbite, e_venomousbite, 11 )
    self:add( ke_venomousbite, self.process_elements)
    
    local ke_miserysend = ml_element:create( "MiserysEnd", c_miserysend, e_miserysend, 15 )
    self:add( ke_miserysend, self.process_elements)
    
    local ke_ragingstrikes = ml_element:create( "RagingStrikes", c_ragingstrikes, e_ragingstrikes, 15 )
    self:add( ke_ragingstrikes, self.process_elements)
    
    self:AddTaskCheckCEs()
end

It's pretty straightforward. Basically, you just create a cne for each spell and then add them to the task cne lists at whatever priority you choose. Unfortunately, nobody has toyed with this idea much since our initial beta testing so everything is horribly out of date. On top of that, much of the newer functionality was written without the option to use the class combat task - it only calls the skillmanager (pvp/duty both ignore the class combat tasks, for instance). You can play with creating a custom combat task and if it works out well for you then we can try to add the functionality for using it back into the rest of the newer code. I don't want to make any radical changes until I see whether it will actually be worthwhile or not.
Oh I see! thank you for the reply :D

Ill definitely play around with this idea and see if I can come up with something worthwhile. Some extremely helpful info there!

GUI is almost finished with the majority of changeable variables I want in it, then just a matter of putting those variables to use >.>
Might have come up with something within the next week one i get my head around the code.

Thanks :)
Everything you're asking for already exists if you use my Enhanced Tools addon, given that you've properly setup skill manager to the conditions you've specified. There's even some related undocumented hotkeys that I use for testing purposes, and it's actually quite easy to weave in ground targetables without holding keys down for the most part, but the bot can also be stopped/started to quickly allow this based on key combinations if that's what you're into.
CTRL+S