For ideas, look at the post Auto Walker. It describes an auto-walker that automatically goes into different directions depending on what it sees.
This is similar to what you are trying to do. Yours is a bit more complex, because you want to react on what happens if you don't get the word 'gems', but to do this you would make a trigger that matches on everything (eg. '*') and then - if a flag is set - test the returned wildcard for the word 'gems'.
Alternatively, you could look for the key phrase 'There's nothing worth mining here' and then choose another direction. Perhaps a trigger that matched on the 'exits' line would help to know what directions are valid.
If you wanted to get fancy you could save in variables the room descriptions (names) of each room, and the directions you have already gone (the name could be the variable name, and the direction(s) the contents) so you don't walk in the same direction again.
|