Quest doesn't have a built-in variable for the last room but it is easy to make one. Quest does have a built-in variable called
quest.currentroom. For more built-in variables, see
http://www.axeuk.com/quest/developer/asl/script-strings.htmHere's an example that saves the current room in a variable called
quest.lastroom before each turn. For feedback, it displays the last room after each turn but you can remove that after testing.
beforeturn set string <quest.lastroom; #quest.currentroom#>
afterturn msg <Last Room was #quest.lastroom#.>
In QDK,
beforeturn and
afterturn are set in the Game Properties window. See
http://www.axeuk.com/quest/developer/asl/qdk-game.htm for more on Game Properties.