Script Writers: 'Choice' window interaction added

Amadeus

The Maestro
Staff member
Those annoying LORE and NO TRADE windows can now be properly handled. Just make an atom to handle this new event and then you an choose Yes (choice1) or No (choice2) based upon the text that's in the window :)

Code:
July 6, 2007 -- By Amadeus
[ISXEQ2-20070628.0137]
* Added new EVENT:
  1. EQ2_onChoiceWindowAppeared()
     ~ This event fires every time that a choice window (ie, Yes/No window) appears.
* Added new TLO:  "ChoiceWindow"   (returns a 'choicewindow' datatype object)
  ~ Syntax: ChoiceWindow     [returns the last 'choicewindow' that appeared]
* Added new DATATYPE: 'choicewindow'
* Added new MEMBERS to the 'choicewindow' datatype:
  1.  ToEQ2UIPage       (eq2uipage type)
  2.  Text              (string type)
  3.  Choice1           (string type)
  4.  Choice2           (string type)
* Added new METHODS to the 'choicewindow' datatype:
  1.  DoChoice1
  2.  DoChoice2
 

cybertf2k4

Active Member
Amadeus, I can't figure out for the life of me, what i'm doing wrong with this event. here is the very simple code ia m using as a test..
the atom never gets executed even when i force the choicewindow open by destroying something or attempting to train a racial ability. I know the event itself is firing because i can echo ${ChoiceWindow.Text} in the console and get output that matches the window. But the atom never executes in the script.
Code:
atom(script) EQ2_onChoiceWindowAppeared()
{
        echo a choice window appeared containing the following text
        echo ${ChoiceWindow.Text}
}
 
function main()
{
 
        if !${ISXEQ2.IsReady}
                return
 
        echo Choice script running...
                
        Event[EQ2_onChoiceWindowAppeared]:AttachAtom[EQ2_onChoiceWindowAppeared]
 
        do 
        {
                ExecuteQueued
                waitframe
        }
        while ${ISXEQ2(exists)}
 
        Event[EQ2_onChoiceWindowAppeared]:DetachAtom[EQ2_onChoiceWindowAppeared]
}
Oh. I've also tried without (script) scope and still nothing. I even tried registering the event in the script on the off chance the event didn't exist while i was trying to attach but that didn't seem to make any difference. I'm not blind but I can't see why it fails to executre the atom. any ideas?
 

Pygar

EQ2Bot Specialist
BTW, its not working for me either...

My example is more complicated than this one, but I don't see why the code above doesn't work.
 
Top Bottom