Aion_onQuestionWindow (Event Usage)

Amadeus

The Maestro
Staff member
Here is a VERY simple script that illustrates how the Aion_onQuestionWindow event could be used. This example script runs in the background as long as isxAion is loaded and then automatically clicks button1 (the affirmative button) anytime you have the loot-untradeable confirmation window or the agree-to-pay-for-teleport window.

The script could be easily adjusted to cancel/close the question window on any condition by using Button2 instead of Button1. (If you're not sure which button might be the correct one, you can always check ${QuestionWindow.Button1.Text})

Please keep in mind that you cannot do things within the event atom itself. The window will not be properly opened and ready for interaction at that point. So, that's why this script sets a variable and then does the interaction in another function.

Otherwise, after looking over this short script and the isxAion patch notes, it should be pretty obvious the usefulness of this event.

Code:
variable(script) bool bProcessQuestionWindow

atom(script) Aion_onQuestionWindow()
{
    ;echo "Aion_onQuestionWindow EVENT"
    bProcessQuestionWindow:Set[TRUE]
}

function ProcessQuestionWindow()
{
    if (${QuestionWindow.Text.Raw.Find["Are you sure you want to acquire it?"]} > 0)
    {
        wait 3
        QuestionWindow.Button1:LeftClick
    }
    elseif (${QuestionWindow.Text.Raw.Find["to travel to"]} > 0)
    {
      wait 3
        QuestionWindow.Button1:LeftClick
    }    
    
    bProcessQuestionWindow:Set[FALSE]
}

function main()
{
  ; If isxAion isn't loaded, then no reason to run this script.
  if (!${isxAion(exists)})
      return
      
    Event[Aion_onQuestionWindow]:AttachAtom[Aion_onQuestionWindow]
    echo "Aion Utility Script:: Initialized"

    do 
    {
        if (${bProcessQuestionWindow})
        {
            do
            {
                waitframe
            }
            while !${QuestionWindow.IsOpen}
            call ProcessQuestionWindow
        }
        waitframe
    }
    while ${isxAion(exists)}

    Event[Aion_onQuestionWindow]:DetachAtom[Aion_onQuestionWindow]
    echo "Aion Utility Script:: Ended"
}
 
Top Bottom