Page 1 of 1

questions reguarding necros and MQ2

Posted: Wed Oct 19, 2016 5:50 pm
by aardil
It me again with still more questions.
This time I have created a necro and want to add it to my group.
my original macro for druid healer is working as intended.
So here goes the questions.
Since my necro and my druid are on separate PC's ( the druid heal macro is running on druid pc) Do I modify the druid heal macro for the necro cast or do I run a different macro on the necro Pc?
The reason I ask is it seems you can only run one macro at a time at least on one pc, not sure since its a different Pc if I can run a different macro or not while the other pc is running the druid heal macro.

Next, what I want to do is have necro assist MT, but not attack (much like my druid macro) end necro pet in to fight and then go through a series of dots., once necro has casted all dots, it needs to do nothing ntill a dot wears off or is resisted.

Any help would be greatly appriceated.

Thanks
Aardil

Re: questions reguarding necros and MQ2

Posted: Wed Oct 19, 2016 8:54 pm
by moguay
All is possible, you can run the same macro to manage all classes (it s my case, for lots of reasons.)
or you can make different macro for each class.

You can create some command/alias to manage each class attack, ex /petatk /necatk /etc... or for global /allatk, /alloff, and for self cmd : /meatk /meoff
Not need to switch toons if you make this cmd type and code a bit in your macro.

So, there is no sense for me to use to assist MT or other assist, if you do some auto assist for intensify farming you can do a /allon and code a global NPC/PC function analysis (ex in HOH farming, if you see what I think).

Re: questions reguarding necros and MQ2

Posted: Sat Oct 22, 2016 2:40 am
by Denizen
"The reason I ask is it seems you can only run one macro at a time at least on one pc" Actually can only run one macro at a time per instance (character) so for example you can have your main character run a macro that triggers a different macro for every other character that you have.... tell cleric to start healing, tell mage to do her spell casting macro, tell your zerker to ummm go berzerk. etc. etc.

Re: questions reguarding necros and MQ2

Posted: Sun Oct 23, 2016 3:45 am
by aardil
well I got it figured out kinda.....
I have developed a new issue, it seems (and it may have been happening all along and I never paid attention)
When I tell my group to attack a target, they all run into melee range.
The druid and the Necro don't attack (melee) as they are doing what they are supposed to BUT, how do I stop them from running into melee range?
Both the druid and the necro should be hanging back and casting spells, not running in where the mob can smack them around.

I have tried
/melee stickrange 1
I get the following:
MQ2Melee::stickrange(1) [#] Target in Range? 0=Off
I have tried
/melee stickrage 1 0
I get the following:
MQ2Melee::Unsupported Argument <0>
tried using 1 1, 1 0, 1 y, 1 n, all come up with the unsupported argument
What the heck does it want for the second argument?

Aardil

Re: questions reguarding necros and MQ2

Posted: Sun Oct 23, 2016 9:26 am
by moguay
Decidedly I do not advise you to use this kind of melee plugin.
With hindsight, the reasons list is long enough. The first is the configuration by INI file, is strictly unnecessary and too complex to write than to do your own clean and flexible code.

Its easy to manage melee class with this filter:

Code: Select all

/if (${Select[${Me.Class.ShortName},ROG,BER,BRD,MNK,RNG,WAR,PAL,SHD,BST]})  /call enableMelee

- do a stick, melee/range attack and pet attack for melee toons...
finally to answer the question you asked.
- In the function of caster use the same structure without the sticking part. (but if all caster in melee range, moved manualy by you, the auto attack, for blunt weapon for exemple)
- and do for user an /melee command in EQBC event for set the TargetMeleeID variable for activate the melee function

Probably if you describe your needs, or I can suggest, I can easily make a generic macro.

hope this helps you, a small sample code for melee attack :

in main loop:

Code: Select all

    |** DPS **|
    /if (${Me.Pet.ID})                                                          /call PetAttack
    /if (${Select[${Me.Class.ShortName},ROG,BER,BRD,MNK,RNG,WAR,PAL,SHD,BST]})  /call enableMelee
    /if (${Me.Level} < 70)                                                      /call enableMelee
    /if (${Me.Class.CanCast})                                                   /call enableCaster

The melee function:

Code: Select all

Sub enableMelee
    | Skip if tanking is ON
    /if (${TankTarget.NotEqual[0]} && ${FarmType.Equal[0]}) /return
    | Skip Main User
    /if (${Me.CleanName.Lower.Equal[${strMainTank.Lower}]}) /return
    | Toon State exclude
    /if (${Me.State.NotEqual[STAND]} || ${Me.Stunned} || ${meleehold}) /return
    | Casting exclude
    /if (!${Cast.Ready} || ${Window[CastingWindow].Open} || ${CastStep} || ${Me.Moving} || ${Select[${MoveTo},ON]} || (${Cast.Active} && !${Cast.Status.Find[I]})) /return

    | Manual melee forced
    /if (${TargetMeleeID}==999999 || ${dpsbalance}<100) {
       
        /if (${Spawn[id ${Target.ID}].Type.Equal[PC]} || ${Spawn[id ${Spawn[id ${Target.ID}].Master.ID}].Type.Equal[PC]} || ${Spawn[id ${Target.ID}].CleanName.Equal[The Spirit of Sune]} || ${Spawn[id ${Target.ID}].Type.Equal[Corpse]} || ${Spawn[id ${Target.ID}].Type.Equal[Item]} || ${Spawn[id ${Target.ID}].Distance}>=300 || ${Spawn[id ${Target.ID}].ID}==NULL || ${Spawn[id ${Target.ID}].ID}==0) {
            /if (${Me.Combat} && ${AttackMode.Equal[0]}) /attack off
            /return
        }
       
        /call meleeStart 999999
        /return
    }

    | Auto melee OFF
    /if (${MeleeTarget.Equal[0]}) {
        /varset TargetMeleeID 0
        /if (${Me.Combat} && ${AttackMode.Equal[0]}) /attack off
        /if (${Me.AutoFire}) /autofire
        /return
    }

    | TargetMeleeID
    /if (${TargetMeleeID}==0) /return
   
    | Target Exclude
    /if (${TargetMeleeID}==${Me.ID} || ${Spawn[id ${TargetMeleeID}].Type.Equal[PC]} || ${Spawn[id ${Spawn[id ${TargetMeleeID}].Master.ID}].Type.Equal[PC]} || ${Spawn[id ${TargetMeleeID}].CleanName.Equal[The Spirit of Sune]} || ${TargetMeleeID}==0 || ${Spawn[id ${TargetMeleeID}].Type.Equal[Corpse]} || ${Spawn[id ${TargetMeleeID}].Type.Equal[Item]} || ${Spawn[id ${TargetMeleeID}].Distance}>=300 || ${Spawn[id ${TargetMeleeID}].ID}==NULL || ${Spawn[id ${TargetMeleeID}].ID}==0) {
        /varset MeleeTarget 0
        /varset TargetMeleeID 0
        /varset CombatMoveCheck GO
        /if (${Me.Combat} && ${AttackMode.Equal[0]}) /attack off
        /if (${Me.AutoFire}) /autofire
        /return
    }

    | Target
    /if (${MeleeTarget.Equal[ALL]} || ${Select[${MeleeTarget},${Me.Class.ShortName}]}) {
        /target ID ${TargetMeleeID}
        /call meleeStart
    }

/return

Sub meleeStart

    /if (!${Target.ID}) /return

    /if (${Target.Type.Equal[Corpse]} || ${Target.Type.Equal[Item]} || ${Target.Type.Equal[PC]} || ${Target.ID}==${Me.ID}) /return

    /if (${Message}==1 && !${movehold}) {
        | Auto MeleeRange Adjust
        /if (${Target.MaxRange} <= ${MeleeRange} && ${Target.MaxRange} > 5) /varset MeleeRange ${Math.Calc[${Target.MaxRange}*0.9]}
       
        | Sticking back target
        /if (${CombatStick.NotEqual[OFF]} && (${Me.Class.Name.NotEqual[Ranger]} || (${Me.Class.Name.Equal[Ranger]} && ${Target.Distance} <= 40))) {
            /if ((!${Stick.Status.Equal[ON]} && !${Stick.Status.Equal[PAUSE]}) || !${Stick.Distance} != ${MeleeRange} || ${TargetMeleeID} != ${Stick.StickTarget}) {
                /squelch /stick off
                /squelch /stick hold moveback behind ${MeleeRange} uw
            }
        }
        /varset Message 0
    }
   
    | Auto stick off for NPC near cliff
    /if (${Stick.Status.Equal[ON]}) {
        /if (${Spawn[npc =Valik the First Creation].ID} && ${Target.ID} == ${Spawn[npc =Valik the First Creation].ID} && ${Spawn[npc =Valik the First Creation].Distance} <= ${MeleeRange}) {
            /squelch /stick off
        } else /if (${Spawn[npc =Master Vule].ID} && ${Target.ID} == ${Spawn[npc =Master Vule].ID} && ${Spawn[npc =Master Vule].Distance} <= ${MeleeRange}) {
            /squelch /stick off
        } else /if (${Spawn[npc =Khasva Vei`Ras].ID} && ${Target.ID} == ${Spawn[npc =Khasva Vei`Ras].ID} && ${Spawn[npc =Khasva Vei`Ras].Distance} <= ${MeleeRange}) {
            /squelch /stick off
        }
    }
   
    | ATTACKING MELEE/RANGE MODE [0/1/2] 0=AUTO ATTACK ON/OFF, 1=ATTACK ON ONLY, 2=MANUAL
    /if (!${Me.Combat}) {
        /if (${Cast.Ready} && ${Target.Distance} <= ${MeleeRange} && (${AttackMode.Equal[0]} || ${AttackMode.Equal[1]})) /attack on
    } else {
        /if (${Target.Distance} > ${MeleeRange} && ${AttackMode.Equal[0]}) /attack off
    }

    | Autofire
    /if (${Me.Class.Name.Equal[Ranger]}) {
        /if (${Target.Distance} > 40 && !${Me.AutoFire} && ${AttackMode.NotEqual[2]}) {
            /squelch /stick off
            /squelch /face fast
            /autofire
        }
    }

    | Auto Pet Attack
    /if (${TargetSupID}==999999 && ${Me.Pet.ID} && ${Target.ID} && !${meleehold} && ${PetAttackID}!=${Target.ID}) /varset PetAttackID ${Target.ID}

    | Endurence auto refresh
    /if (${Me.PctEndurance}<=30 && ${Cast.Ready} && ${Me.State.Equal[STAND]}) /call Event_Endurance

    | Common Buff
    /call CommonBuff
    /if (${Macro.Return}) /return TRUE
    | Common Dps Boost
    /call MaxDpsBuff
    /if (${Macro.Return}) /return TRUE

    /if (${Target.LineOfSight}) {

        | Melee Class Ability functions
        /if (${Me.Combat} && ${Target.Distance}<=${Math.Calc[${Int[${MeleeRange}]}*1.1]}) {
            /call ClassCombat
            /if (${Macro.Return}) /return TRUE
        }

        | Common Nuke
        /call CommonNuke
        /if (${Macro.Return}) /return TRUE
    }

/return

The melee ability function, to replace the mq2melee

Code: Select all

Sub ClassCombat

    /if (!${Me.Combat} && ${TargetMeleeID}==999999) /return TRUE

    /if (${Me.Class.Name.Equal[Berserker]} && ${Me.AbilityReady[Frenzy]}) {
        /doability Frenzy
        /if (${broadcast}==1) /${chat} Casting "Frenzy"
        /return TRUE
    }

    /if (${Me.Class.Name.Equal[Monk]} && ${Me.AbilityReady[Flying Kick]}) {
        /doability "Flying Kick"
        /if (${broadcast}==1) /${chat} Casting "Flying Kick"
        /return TRUE
    }

    /if (${Me.Class.Name.Equal[Rogue]} && ${Me.TargetOfTarget.ID}==${Me.ID} && ${Me.AbilityReady[Hide]} && ${Me.AbilityReady[Sneak]}) {
        /attack off
        /delay 20 !${Me.Combat}
        /doability Sneak
        /doability Hide
        /delay 2
        /if (${broadcast}==1) /${chat} Casting "Sneak & Hide"
        /attack on
        /return TRUE
    }

    /if (${Me.Class.Name.Equal[Rogue]} && ${Me.TargetOfTarget.ID}==${Me.ID} && ${Me.PctHPs}<=90 && ${Me.CombatAbilityReady[Escape]}) {
        /alt activate ${AltAbility[Escape].ID}
        /if (${broadcast}==1) /${chat} Casting "Escape"
        /return TRUE
    }

    /if (${Me.Class.Name.Equal[Rogue]} && ${Me.AbilityReady[Hide]} && ${Me.AbilityReady[Sneak]} && (((${Cast.Ready[Cloak of the Deceiver]} || ${Cast.Ready[Fizzlethorp's Cloak of Shadows]} || ${Cast.Ready[Shroud of the Deceiver]}) && ${FizzlethorpsCloakofShadowsTimer}<=0) || (${Me.CombatAbilityReady[${discDeathBringer}]} && ${Me.Endurance} > 1000)) && ${Me.AbilityReady[Backstab]} && (${Window[CombatAbilityWnd].Child[CAW_CombatEffectLabel].Text.Equal[No Effect]} || ${Window[CombatAbilityWnd].Child[CAW_CombatEffectLabel].Text.Equal[${discAssassinsChaos}]})) {
        /attack off
        /delay 20 !${Me.Combat}
        /doability Sneak
        /doability Hide
        /delay 2
        /if (${Cast.Ready[Cloak of the Deceiver]}) {
            /casting "Cloak of the Deceiver" item
            /varset FizzlethorpsCloakofShadowsTimer 40s
        } else /if (${Cast.Ready[Fizzlethorp's Cloak of Shadows]}) {
            /casting "Fizzlethorp's Cloak of Shadows" item
            /varset FizzlethorpsCloakofShadowsTimer 40s
        } else /if (${Cast.Ready[Shroud of the Deceiver]}) {
            /casting "Shroud of the Deceiver" item
            /varset FizzlethorpsCloakofShadowsTimer 40s
        } else {
            /disc ${discDeathBringer}
        }
        /delay 5 !${Window[CombatAbilityWnd].Child[CAW_CombatEffectLabel].Text.Equal[No Effect]}
        /if (${Me.AbilityReady[Backstab]}) {
            /doability Backstab
            /if (${broadcast}==1) /${chat} Casting "Death Bringer: Backstab"
        }
        /attack on
        /return TRUE

    } else /if (${Me.Class.Name.Equal[Rogue]} && !${Me.Casting.ID} && ${Me.AbilityReady[Backstab]}) {
        /doability Backstab
        /if (${broadcast}==1) /${chat} Casting "Backstab"
        /return TRUE
    }

    /if (${Me.Class.Name.Equal[Rogue]} && ${Me.Endurance}>1300 && ${Me.CombatAbilityReady[${discAssassinsChaos}]}) {
        /disc ${discAssassinsChaos}
        /if (${broadcast}==1) /${chat} Casting "${discAssassinsChaos}"
        /delay 5
        /return TRUE
    }

/return FALSE

Re: questions reguarding necros and MQ2

Posted: Sun Oct 23, 2016 2:29 pm
by aardil
WOW!
While I think I follow what you are saying and my basic understanding of code.....
I am afraid even what you suggest is over my head.

first.
You say its easy to manage melee classes with the posted code..
OK, but where do I put that code?
Do I need to create a new macro file for each toon and use that line in it somewhere?
I am so confused.

Re: questions reguarding necros and MQ2

Posted: Sun Oct 23, 2016 3:14 pm
by aardil
Moguay, I sent you a PM