Discussion in 'EQ2Bot (Freeware)' started by TheHaydens, Jul 5, 2012.

  1. TheHaydens

    TheHaydens Member

    Messages:
    66
    This is a interesting concept what I am trying to do but out of curiosity,

    Lets say a Mob red texts [You suck billybob your going to die] how do I get the bots to acknowledge and do something lets say !MT {go to 451, -51, 657} if MT{Do nothing}





    Side questions, not related..

    Encounter: Billy (Name), Joe ( Strong Trash), Fred (Weak Trash).... If I wanted my bots to prioritize killing and auto recognize everyone int he encounter and each one already know what to do (Who to target / burn down first, regardless what the MA is doing) Would this work?

    Concept: Kill Joe first, than Fred, than Billy... in that order,

    but I want them to recognize this encounter without "/run Joe's script" every time if the encounter is these 3 in the set (Auto start script).. ((Weird request, just testing something out, and couldn't figure it out, any ideas would be awesome!))

    Code (Text):
       

    do  {
            if ${Actor[Joe](exists)}
            {
                relay all "eq2execute /target Joe"
            }
           
            if !${Actor[Joe](exists)} && ${Actor[Fred](exists)}
            {
                relay all "eq2execute /target Fred"
            }


            if !${Actor[Joe](exists)} && !${Actor[Fred](exists)} && ${Actor[Tel’koran Bloodmaw](exists)}
            {
                relay all "eq2execute /target Billy "
            }
           
        }
     
  2. bjcasey

    bjcasey ISX Specialist

    Messages:
    1,418
    IncomingOnText or something similar. It's on the wiki.

    You could limited it to only scanning for those three named if the zone name is correct. This would prevent it from needlessly scanning for them when not in the right zone. BUT.. this also means that when in the zone it will always be scanning for them.
  3. macker0407

    macker0407 Active Member

    Messages:
    270
    The code is probably better written as:
    Code (Text):
       
    do
    {
        if ${Actor[Joe](exists)}
        {
            relay all "eq2execute /target Joe"
        }
        elseif ${Actor[Fred](exists)}
        {
            relay all "eq2execute /target Fred"
        }
        elseif ${Actor[Billy](exists)}
        {
            relay all "eq2execute /target Billy "
        }
    }
     
    However, if this is for EQ2Bot you'll also need to update KillTarget with the actor id, otherwise your bots will just flipflop between targets.
  4. pr517

    pr517 Active Member

    Messages:
    118
    Go ahead and remove this from your repertoire: relay all eq2execute. I'm tired of cleaning up your mess when you rape a server. Thanks.

    Wow to the if statements. elseif, look it up. No, seriously, stop whatever you keep doing instead of looking things up, and look it up. Okay fine, so you stuck around. Challenge: if you can't figure out why z is commented out, now you have to look it up. This creates a priority of first w, then x, then y, and last z:
    Code (Text):
    if w
    elseif x
    elseif y
    else
       ;z
    If this concept doesn't exist in EQ2Bot, it should. Somewhere in EQ2Bot:
    Code (Text):

    function WhenCombatBeginsGlobally()
    {
       if ${Actor[NamedNPC,Billy](exists)} && ( ${Actor[NamedNPC,Billy].Distance} < 100 ) && !${Script[zonename_billy_target](exists)}
          run zonename_billy_target
    }

    function WhenCombatEndsGlobally()
    {
       if ${Script[zonename_billy_target](exists)}
          endscript zonename_billy_target
    }
     
    zonename_billy_target.iss (derived from name of zone, name of mob, functionality gained by running it):
    Code (Text):

    variable int iTargetID = 0
    variable string SavedMainAssist = ${Script[EQ2Bot].VariableScope.MainAssist}
    variable string IsFighter = "warrior crusader brawler"

    function main()
    {
       echo "zonename_billy_target ON"

       Script[EQ2Bot].VariableScope.MainAssist:Set[${Me.Name}]
       ; Could also have it change in the UI if you're a perfectionist.

       while 1
       {
          if ${IsFighter.Find[${Me.Class}]} && ${Actor[NamedNPC,Billy].ID} && ( ${Actor[NamedNPC,Billy].Target.ID} != ${Me.ID} )
          {
             iTargetID:Set[${Actor[NamedNPC,Billy].ID}]
          }
          elseif ${Actor[NPC,Joe].ID}
          {
             iTargetID:Set[${Actor[NPC,Joe].ID}]
          }
          elseif ${Actor[NPC,Fred].ID}
          {
             iTargetID:Set[${Actor[NPC,Fred].ID}]
          }
          elseif ${Actor[NamedNPC,Billy].ID}
          {
             iTargetID:Set[${Actor[NamedNPC,Billy].ID}]
          }
          else
             iTargetID:Set[0]

          ; NICELY CHANGES TARGET ONLY IF IT IS WRONG
          if ${iTargetID} && ( ${iTargetID} != ${Target.ID} ) && ${Me.InCombat}
          {
             Target ${iTargetID}
             wait 10 ( ${Target.ID} == ${iTargetID} )
          }

          wait 1
       }
    }

    function atexit()
    {
       Script[EQ2Bot].VariableScope.MainAssist:Set[${SavedMainAssist}]

       echo "zonename_billy_target OFF"
    }
     
    While we're at it, let's remove your dick from slapping others in the face that is your sig.
  5. TheHaydens

    TheHaydens Member

    Messages:
    66
    I just add another function I am assuming inside the "Eq2bot.iss" file???

    Also what if the correct spelling was "Bi'lly" would we change the name to:

    Code (Text):
    if ${Actor[NamedNPC,Bi'lly](exists)}
    or

    Code (Text):
    if ${Actor[NamedNPC,Bi\'lly](exists)}

    ^^ Also, if Fred keeps spawning throughout the fight does the above script notice he respawned and auto target him when he spawns and destroys him??


    I changed it couple weeks ago, it was very offensive to the other subscribers and It was kind of rude, but my current one isn't offensive in any way, so not sure what you mean by my signature being offensive...
    Last edited: Jul 7, 2012
  6. pr517

    pr517 Active Member

    Messages:
    118
    At the fundamental level a "bot" does this:
    Code (Text):

    start main loop
       should i be in combat?
          yes, execute a global begin combat
       should i no longer be in combat?
          yes, execute a global end combat
       handle combat as appropriate
       handle buffs
    end main loop
     
    I just summarized EQ2Bot, except that it may or may not have the "should i" parts. Add/modify those.

    Code (Text):

    if ${Actor[NamedNPC,Bi'lly](exists)}
     
    If you care to know why it doesn't matter:

    The Actor ISXEQ2 TLO is smart enough to know that, since the field delimiting character is a comma, you do not need to backslash your single quote. InnerSpace would just interpret the backslash single quote into a single quote before the extension sees it anyway. However, you can use a double quote to encapsulate text and would need to backslash a double quote if it were itself in the text (except that EQ2 does not allow this character in names.) So either is correct, but it is easier to read as the above.

    Yes, the above script pretty much lets you engage, walk away to get a beer, and come back to an exquisite chest on the ground. One thing to note is that sometimes ISXEQ2 sees actors as NamedNPC that one would normally think of as just an NPC. You must recognize these cases by testing with "echo ${Target.Type}" after you target the add in question. Then make sure your script has the correct actor type specified. I claimed Fred and Joe were NPCs, but ISXEQ2 would probably think it they were NamedNPCs because it only has one name and it is capitalized. It was just an example.
    Last edited: Jul 7, 2012

Share This Page