Is there any way to change what the again/g command does? Specifically, I’m looking to make it re-run the last valid action the player tried rather than an erroneous one.
I was thinking of doing something like this:
[code]There is a room.
The previous action is an indexed text that varies.
Directly-run is a truth state that varies.
Before reading a command:
now directly-run is true.
First before doing something when directly-run is true:
now the previous action is the player’s command;
now directly-run is false.
After reading a command:
if the player’s command matches “again” and the previous action is not empty:
replace the matched text with “[previous action]”.
Test me with “z / blah / again”[/code]
However I get a runtime error, and then it retries the mistaken command anyway.