Events

yeager

Active Member
Why doesn't the following work with the dance routine in the haunted house?

Code:
Event[EQ2_onIncomingText]:AttachAtom[GetText]

atom GetText(string StepName)
{
Debug:Echo[${StepName}]
}
Also tried EQ2_onIncomingCharText and EQ2_onAnnouncement. The text shows up in the log.

And before I get the obligatory comments about being lazy and all that. I know it is.
I just wanted to do it "just because".
 

Amadeus

The Maestro
Staff member
I would prefer to see the whole script. Or, at least a test script that works as a stand-alone, that would test this.

That way I could eliminate several issues that could be wrong.
 

Kannkor

Ogre
Do you have a Debug object with Echo as a method? I'm guessing you looked in another script and copied it out, my best assumption is you didn't copy/use the debug object.

If you wish, change this line:
Code:
Debug:Echo[${StepName}]
Code:
Echo ${StepName}
Then at least you can eliminate that being wrong.
 

yeager

Active Member
Code:
variable string TestString
variable string DanceStep
variable int count

function main()
{
    count:Set[1]
    echo Dance Started
    Event[EQ2_onIncomingText]:AttachAtom[GetText]

    do
    {
        waitframe
    }
    while 1
}

atom GetText(string StepName)
{
if ${Math.Calc[${count}%2]}==1
{
    Echo ${count} ${StepName}
    if ${StepName.Find["ghoulish dancer"]}
    {
        if ${StepName.Find["Down"]}
        {
            DanceStep:Set["Down"]
        }
        if ${StepName.Find["Back"]}
        {
            DanceStep:Set["Back"]
        }
        if ${StepName.Find["Spin"]}
        {
            DanceStep:Set["Spin"]
        }
        if ${StepName.Find["Sway"]}
        {
            DanceStep:Set["Sway"]
        }
        Echo ${DanceStep}
        EQ2Execute /useabilityonplayer ${Me.Name} "${DanceStep}"
    }
}
count:Set[${Math.Calc[${count}+1]}]
}

function atexit()
{
    echo Dance Ending
}
Sometime between when I first posted and now it started working, however, it fires everything twice which is the reason for the modulus kludge.

I think there was a ISXEQ2 patch slipped in that may have fixed the event thing. Shrug.

Thanks for looking.
 
Last edited:
Top Bottom