1. sumoslim

    sumoslim Active Member

    Messages:
    98
    Pygar mentioned an ability to make EQ2BotCommander "CastSpellNow" - meaning interrupt and cast or "CastSpell"meaning cue a spell in eq2bot.

    Right now the useability function is inferior since you have to hit the button when the bot isn't casting for it to work.

    What is the syntax in eq2botcommander to make a button that will:
    1. Interrupt a bot casting and cast a specific spell
    2. Cue up a spell to be cast as soon as the bot stops casting its current spell.

    I know how to make the button (placement, etxt etc) I just need the syntax that would change useability to castspellnow or castspellnext.

    Thanks a ton!
  2. Pygar

    Pygar EQ2Bot Specialist

    Messages:
    907
    So, lavishscript allows sending commands to a scripts commandqueue. Basically letting one script tell another script, hey run this thing next dude!

    Script[EQ2Bot]:QueueCommand[call CastSpellNow ${spellname} 0 ${Target.ID}]

    That might also look like:

    Script[EQ2Bot]:QueueCommand[call CastSpellNow "Cure Curse" 0 ${Actor[pc,MyTankName].ID}]

    EQ2Bot should then process this queued function as soon as it is available. This way your not trying to fight the script to get your ability to cast instead of what the script is currently attempting to cast or queue.

    I'm not 100% sure the format works with the "'s you may have to set a local string var to the spell name, play with it.
  3. sumoslim

    sumoslim Active Member

    Messages:
    98
    That was exactly what i was looking for. Thanks Pygar.

    Pygar how would I send a local string variable?
  4. sumoslim

    sumoslim Active Member

    Messages:
    98
    The script gave me a huge set of errors
    and crashed all the bots


    Code (Text):
    <Button Name='DPSTemp'>
                                    <X>55%</X>
                                    <Y>45</Y>
                                    <Width>90</Width>
                                    <Height>30</Height>
                                    <Text>DPSTemp</Text>
                                    <AutoTooltip>Casts all DPs Temp Buffs</AutoTooltip>
                                    <OnLeftClick>relay all Script[EQ2Bot]:QueueCommand[call CastSpellNow ${Death March} 0 ${Target.ID}]
                                            relay all Script[EQ2Bot]:QueueCommand[call CastSpellNow ${Peace of Mind} 0 ${Target.ID}]
                                            relay all Script[EQ2Bot]:QueueCommand[call CastSpellNow ${Cacophony of Blades II} 0 ${Target.ID}]
                                            relay all Script[EQ2Bot]:QueueCommand[call CastSpellNow ${Stampede of the Herd} 0 ${Target.ID}]
                                            relay all Script[EQ2Bot]:QueueCommand[call CastSpellNow ${Elemental Toxicity} 0 ${Target.ID}]
                                    </OnLeftClick>
                                </Button>
    in eq2botcommander
  5. bob_the_builder

    bob_the_builder Well-Known Member

    Messages:
    675
    I think its just this:


    relay all Script[EQ2Bot]:QueueCommand[call CastSpellNow "Death March" 0 ${Target.ID}]

    So it's not ${Spell Name} but "Spell Name"

    I believe
  6. insanitywiz

    insanitywiz Senior Member

    Messages:
    470
    I'm pretty sure you are going to run into errors trying to have eq2bot queue spells a toon doesn't have. Try relaying to session name rather then doing a relay all.
  7. sumoslim

    sumoslim Active Member

    Messages:
    98
    How do I call a certain session?

    My setup:
    1. SK - Bot 1/Me
    2. Inq - Bot 2
    3. Mystic - Bot 3
    4. Dirge - Bot 4
    5. Necro - Bot 5
    6. Illy - Bot 6
  8. insanitywiz

    insanitywiz Senior Member

    Messages:
    470
    In console type relay, nothing else, just relay, and it will show you all the switches for it.

    Rather then doing an all, you need to do a relay to a session name if it's on the same PC, or an uplink and session names if it's on another PC.
  9. Kannkor

    Kannkor Ogre

    Messages:
    3,632
    A different way, is to make a function (or add to an existing function) the name or class of the toon that should do the function.

    So instead of Death March, you would do: Shadowknight "Death March". Or Kannkor Death march

    That way you can still relay all incase your sessions change from time to time.
  10. sumoslim

    sumoslim Active Member

    Messages:
    98
    So it would look like?

    Code (Text):
    relay Kannkor Script[EQ2Bot]:QueueCommand[call CastSpellNow "Death March" 0 ${Target.ID}]
    or

    Code (Text):
    relay Shadowknight Script[EQ2Bot]:QueueCommand[call CastSpellNow "Death March" 0 ${Target.ID}]
    Is the syntax right?

    What does the 0 at the end mean?

    AND do I need quotes around the script part? like this
    Code (Text):
    relay Shadowknight "Script[EQ2Bot]:QueueCommand[call CastSpellNow "Death March" 0 ${Target.ID}]"
    Like in the reacquire command?
    Last edited: Jul 19, 2010
  11. insanitywiz

    insanitywiz Senior Member

    Messages:
    470
    No, that would simply attempt to relay to the IS session named Shadowknight.

    It takes me awhile to kludge things together so I can't tell you the syntax off the top of my head, but what you want is for your relay to call a function that would do something along the lines of:

    Code (Text):
    Me.Class[Shadowknight]=TRUE Script[EQ2Bot]:QueueCommand[call CastSpellNow "Death March" 0 ${Target.ID}]
    Alternatively, you can have it check to see if the ability exists

    Code (Text):
    Me.Ability[Death March]=EXISTS Script[EQ2Bot]:QueueCommand[call CastSpellNow "Death March" 0 ${Target.ID}]
    I couldn't quickly verify the latter, but I am fairly sure it's possible to simply fire off a check to see if the ability exists.

    I'm sure someone else can clean that up with a few moments work to make it usable, but if not I'll try to take the time to get it done tonight. Gotta get ready for Comic Con though, so no promises.
  12. Kannkor

    Kannkor Ogre

    Messages:
    3,632
    Yea, you can't relay kannkor, you would be trying to relay to the session name..

    My idea is more like this..

    relay all Script[EQ2Bot]:QueueCommand[call CheckClass ShadowKnight "CastSpellNow \"Death March\" 0 ${Target.ID}"]

    Then you would have a function..

    Code (Text):
    function CheckClass(string ClassToCheck, string CastSpellNowCall)
    {
        if ${Me.SubClass.Equal[${ClassToCheck}]}
          Script:QueueCommand[call ${CastSpellNowCall}]
    }
    Can't say that exact code will work, but that's the general idea. You are giving the command to everyone, but each person checks to see if it's a valid command for them. Alternatively, you could see if a spell exists for the class also.
    Last edited: Jul 20, 2010
  13. sumoslim

    sumoslim Active Member

    Messages:
    98
    So my button for eq2botcommander would look like?

    I understand the button size etc portions but what would the code after calling for left click look like exactly. Sorry for my dummy questions - but syntax is so unforgiving I need to know the structure before I can edit it.
  14. Kannkor

    Kannkor Ogre

    Messages:
    3,632
    The relay could be like that yes, but the function would NOT be in the botcommander, that needs to be incorporated into eq2bot (more than likely in a class file or a personal #include, I'm not entirely sure how it all works).
  15. sumoslim

    sumoslim Active Member

    Messages:
    98
    sorry still not getting it to work
    Here is the old button - what would the new one look like?

    And where in the class script can i put that commander where it wont interfere with the whole script?
    Code (Text):
    Button Name='DPSTemp'>
                                    <X>55%</X>
                                    <Y>45</Y>
                                    <Width>90</Width>
                                    <Height>30</Height>
                                    <Text>DPSTemp</Text>
                                    <AutoTooltip>Casts all DPs Temp Buffs</AutoTooltip>
                                    <OnLeftClick>relay all Script[EQ2Bot]:QueueCommand[call CastSpellNow ${Death March} 0 ${Target.ID}]
                                            relay all Script[EQ2Bot]:QueueCommand[call CastSpellNow ${Peace of Mind} 0 ${Target.ID}]
                                            relay all Script[EQ2Bot]:QueueCommand[call CastSpellNow ${Cacophony of Blades II} 0 ${Target.ID}]
                                            relay all Script[EQ2Bot]:QueueCommand[call CastSpellNow ${Stampede of the Herd} 0 ${Target.ID}]
                                            relay all Script[EQ2Bot]:QueueCommand[call CastSpellNow ${Elemental Toxicity} 0 ${Target.ID}]
                                    </OnLeftClick>
                                </Button>
  16. ACiDXiAN

    ACiDXiAN Active Member

    Messages:
    30
    Cueing

    what I did was this (using some similiar systems from Kannkors publicly available scripts to which I say thank you) now this may not be how Kannkor woudl do it or not the most efficient way but it works for me.

    my button in my commander type window
    Code (Text):
    <Button Name='btDPSBurst'>
        <X>4%</X>
        <Y>135</Y>
        <Width>33</Width>
        <Height>20</Height>
        <Text>Burn</Text>
        <OnLeftClick>relay all runscript "\${LavishScript.HomeDirectory}/Scripts/EQ2BotCommander/EQ2CommandControl" DPSBurn</OnLeftClick>
        <Font><Size>12</Size><Color>FF00FF00</Color></Font>
    </Button>
    in CommandControl.iss in the botcommander directory.
    Code (Text):
    function main(string ExecuteCommand)
    {
        call ${ExecuteCommand}
        while ${QueuedCommands}
            ExecuteQueued
    }
    function DPSBurn()
    {
        if (!${Script[EQ2Bot](exists)} || !${Me.InCombat})
            return
           
        if ${Me.SubClass.Equal[mystic]} && ${Script[EQ2Bot](exists)} && ${Me.Ability[Stampede of the Herd](exists)} && ${Me.Ability[Stampede of the Herd].IsReady}
        {
            ;Mystic - Stampede of the Herd AA Mystic Tree Ability
            Script[EQ2Bot]:QueueCommand[call CastSpell "Stampede of the Herd" 0 ${Me.ID}]
            if ${Me.Grouped}
                eq2execute /p "Stampede of the Herd :: Hit it HARD! (24s) ::"

        }
        elseif ${Me.Ability[Stampede of the Herd](exists)} && !${Me.Ability[Stampede of the Herd].IsReady} && ${Actor[pc,${TankName}](exists)}
            eq2execute /tell ${TankName} ${Math.Calc[${Me.Ability[Stampede of the Herd].TimeUntilReady}].Precision[1]}s recast.}
    }

    Definatley not the most efficient way and if any advice acan be given great, I have more than just the mystic one in that, the advantage of this was a twofold, like Kannkor stated it wont spam This ability is not available to every toon, and its a run on needed type script that is called for each seperate toon, therefor you can do a lot more than just what the controlling computer running eq2botcommander can do. Once again thakn to Kannkor for his scripts he put int he public, they have made some great examples of what can be done and how to make things a little better ont he whole (for me at least)
  17. Kannkor

    Kannkor Ogre

    Messages:
    3,632
    :) Welcome.

Share This Page