Discussion in 'Scripts' started by lixleon, Oct 19, 2014.

  1. lixleon

    lixleon Member

    Messages:
    85
    Is there any command for count how many mobs engaged on group?
    I checked wiki, but didn't get any lucky.
    I know Ogre can do this for whole cast orders.
    But I want to adjust every single spell in different counting.
    Thanks for help.
  2. lixleon

    lixleon Member

    Messages:
    85
    Ok, I got the answer from CustomActor, Thanks.
  3. lixleon

    lixleon Member

    Messages:
    85
    I did this code, MobNum will return how many mobs engaged within 15 m.
    Code (Text):
    function main()
    {
    variable int MobNum=0
    variable int MobCon=1
        EQ2:CreateCustomActorArray[byDist,15,NPC]
        if ${EQ2.CustomActorArraySize}>=1
        {
            while ${MobCon}<=${EQ2.CustomActorArraySize}
            {
                if ${CustomActor[${MobCon}].InCombatMode}
                MobNum:Inc
                MobCon:Inc
            }
         }
        echo ${MobNum} Mobs engaged.
    }
  4. Kannkor

    Kannkor Ogre

    Messages:
    3,632
    One thing to note: EQ2:CreateCustomActorArray uses internal memory that is global. If you run this script, while a different script is trying to iterate through them, you will change their data.

    Now, in a perfect world, everyone knows this, and no code block that isn't atomic, would use this to prevent the conflict.

    (I'm not implying there is anything wrong with it at all, just pointing out possible conflicts if you start having any issues).
  5. lixleon

    lixleon Member

    Messages:
    85
    Sounds like this code will conflict with Ogre?
    So Is there any mobs data I can use from Ogre? I just want to make a script that enable and disable cast order in Ogre to make sure bots cast correct AoE spell.
  6. lixleon

    lixleon Member

    Messages:
    85
    Yeah it will conflict with OSA, I just noticed.
  7. lixleon

    lixleon Member

    Messages:
    85
    I rewritten like this:

    Code (Text):
    function mobschecker()
    {
        ;;EQ2:CreateCustomActorArray[byDist,20,NPC]
        if ${EQ2.CustomActorArraySize}>=1
        {
            while ${MobCon}<=${EQ2.CustomActorArraySize}
            {
               if ${CustomActor[${MobCon}].Type.Equal[NPC]} || ${CustomActor[${MobCon}].Type.Equal[NamedNPC]}
                {
                if ${CustomActor[${MobCon}].InCombatMode} && ${CustomActor[${MobCon}].Distance}<=20
                MobNum:Inc
                }
               MobCon:Inc
            }
         }
    }
  8. Kannkor

    Kannkor Ogre

    Messages:
    3,632
    If it's affecting OSA, I'll look into fixing that. OSA is pretty old, so it's possible.
    Come to think of it, it's possible all of Ogrebot uses it, but shares it with a global controller... which works great except when others try to use it too apparently... :)
    What you should use is EQ2:GetActors. More information and I think an example can be found in isxeq2 wiki.
  9. user01

    user01 Member

    Messages:
    28
    One thing worth noting, is that if you're in a public area this will include any mobs that are engaged with other players, not just you/your group/your raid. May not matter for your uses.

    If it does matter for you, you can just add a check to see whether ${CustomActor[${MobCon}].Target.Name.Equals[groupmembername]} for everyone in your party
  10. Herculezz

    Herculezz ISX Specialist

    Messages:
    332
    ${CustomActor[${MobCon}].Target.InMyGroup} works well too as it includes pets as well.
  11. Amadeus

    Amadeus The Maestro Staff Member

    Messages:
    8,264

Share This Page