You could always make it a bit (err... a lot) more advanced.
Just keep in mind that, as Pertex pointed out, there's no way to check if an object is a room right now, so you might get thrown into an object.
In the command, switch the script to code view and paste this into it:
game.resolvedaliasesforobjects = null
objects = NewStringList()
alts = NewObjectDictionary()
foreach (obj, AllObjects()) {
if (obj.alias = null or obj.alias = "") {
if (GetKeywordsMatchStrength (text, obj.name) > 0) {
list add (objects, obj.name)
}
}
else {
if (not obj.alt = null) {
foreach (alt, obj.alt) {
if (GetKeywordsMatchStrength (text, alt) > 0) {
list add (objects, alt)
dictionary add (alts, alt, obj)
firstalt = alt
}
}
}
if (GetKeywordsMatchStrength (text, obj.alias) > 0) {
list add (objects, obj.alias)
dictionary add (alts, obj.alias, obj)
firstalt = obj.alias
}
}
}
game.resolvedaliasesforobjects = alts
if (ListCount(objects) > 0) {
if (ListCount(objects) > 1) {
ShowMenu ("Which object did you mean?", objects, true) {
foreach (alt, game.resolvedaliasesforobjects) {
if (alt = result) {
result = game.resolvedaliasesforobjects[alt]
result = result.name
}
}
MoveObject (game.pov, GetObject(result))
}
}
else {
if (ListCount(alts) = 1) {
object = alts[firstalt]
}
else {
object = objects[0]
object = GetObject(object)
}
MoveObject (game.pov, object)
}
}
else {
msg ("I don't know where that is.")
}
Basically what this does is:
[list=a][*]Checks for every object, then checks for their aliases and anything in their 'alt' list[/*:m]
[*]If the player typed something close to any of the names/aliases/alts, then it adds that object to a list[/*:m]
[*]If there's only one object in the list at the end, the player is sent to that object. If there are multiple objects in the list, a menu is displayed[/*:m][/list:o]
P.S. Also keep in mind that if any objects have the same alias or alt as another object, the search will fail. There's probably a way around that, but I couldn't find it. Sorry!