Secondly, event handler functions do not fire in a determinable order. To show this, I created the following script:
Code: Select all
Alias pattern: ^rtevent$
Script:
echo( "Raising event: tevent" )
raiseEvent( "tevent" )
Script name: tevent1
Registered event handlers: tevent
Script:
function tevent1( tevent )
echo( "Event 1 fired" .. "\n")
end
Script name: tevent2
Registered event handlers: tevent
Script:
function tevent2( tevent )
echo( "Event 2 fired" .. "\n")
end
Script name: tevent3
Registered event handlers: tevent
Script:
function tevent3( tevent )
echo( "Event 3 fired" .. "\n")
end
Script name: tevent4
Registered event handlers: tevent
Script:
function tevent4( tevent )
echo( "Event 4 fired" .. "\n")
end
2. I entered "rtevent" at the command line, which raised the event "tevent".
3. I saw the text "Raising event: tevent" displayed in the main window as expected, with the matching timestamp of 18:13:00
4. I wait. Nothing happens for 12 seconds, until I send a blank line to the mud by pressing enter at the command line. At this point the following is displayed with a timestamp of 18:13:12
Raising event: teventEvent 4 fired
Event 2 fired
Event 3 fired
Event 1 fired
I underlined the part from the original echo - this is not new, only what follows. As you can see in the screenshots of this, the event handler functions are firing both far too late, and not in the order that they appear in the script editor.