every time you exit a room, you're entering another room, lol. As you can't exist not within a room, lol.
so the global 'on entering room', would apply for both entering and exiting a room, as they're the same thing.
------
another way is scripting when the built-in 'parent' Object Attribute changes, via the special 'changed' Script:
create/add a Script Attribute on your 'player' Player Object and name it:
changedYOUR_ATTRIBUTE_NAME
so, for the 'parent' Object Attribute, the Script would be named:
changedparent
for a stupid example:
<object name="player">
<attr name="parent" type="object">room</attr>
<attr name="changedparent" type="script">
msg ("You exited a room and entered a new room")
</attr>
</object>
and then for adding its scripts, they're what occurs when the 'parent' Object Attribute changes (which occurs when you move from room to room)
------
another way is using a global Turnscript:
(this also requires using a second Attribute to store the old location)
<game name="blah">
</game>
<object name="room">
</object>
<object name="player">
<attr name="parent" type="object">room</attr>
<attr name="old_parent" type="object">room</attr>
</object>
<turnscript name="blah">
<enabled />
<script>
if (not player.parent = player.old_parent) {
player.old_parent = player.parent
msg ("You exited a room and entered a new room")
}
</script>
</turnscript>