I think I've covered this before, but one way to do an "exit room" script is:
1. In your game start script, set a string variable called "prevroom" (or whatever you want) to nothing.
2. Set up an afterturn script for the game
3. Check whether "prevroom" contains the name of the room you want the "exit room" script for.
4. If it does, check whether #quest.currentroom# is different to #prevroom#. If it is, then the player has left that room, so do whatever script you want.
5. Store #quest.currentroom# in the "prevroom" string, ready for the next time the afterturn script runs.
Here's some ASL code to do the above. For QDK, try and work it out from the above instructions or paste this in using a text editor:
In your define game block:
startscript set string <prevroom; >
afterturn {
if ( #prevroom# = ENTER NAME OF THE ROOM PLAYER LEAVES HERE ) then {
if ( #prevroom# <> #quest.currentroom# ) then {
' ENTER SCRIPT TO RUN HERE
}
}
set <prevroom; #quest.currentroom#>
}