SpellCast.cast = function(/*optional*/ target) { matches = new MatchList(); var success = matches.matchRe( "You sweep your right hand across the spell pattern|" + // energy bolt "You gesture\\.|" + // regular cast "(You steeple your fingers together|Using your (left|right) hand, you channel)"); // whole displacement var failure = matches.matchRe( "I could not find what you were referring to\\.|" + // bad target "You must cast this spell on a constellation\\.|" + // bad target - starlight sphere "Your secondary spell pattern|" + // dead target - TM "on yourself!|" + // not a self cast spell "You don't have a spell"); // no spell prepped if (target) { var matched = Utils.matchPut("cast " + target, matches); } else { var matched = Utils.matchPut("cast", matches); } if (matched == success) { return true; } else if (matched == failure) { return false; } } Output: R>[1test]: cast ...wait 1 seconds. R>[1test]: cast ...wait 1 seconds. Then it hangs.