Wait For Command

Posted by Malur on Tue 21 Apr 2009 08:28 PM — 2 posts, 14,768 views.

#0
I am looking for a wait to capture the name of the character logged into. So I'm not sure if triggers alone could do this, or if I'd have to make the script wait for input.

Initially I get the message "What is your name?" From there I want to grab the command of the user which would be <username>. So what are some ways I can get the <username> variable?
Australia Forum Administrator #1
See:

http://www.gammon.com.au/scripts/function.php?name=GetAlphaOption

If they are using the inbuilt "remember my name" option, then GetAlphaOption for "player" will do it.

If this doesn't work, you could make a plugin and use OnPluginSent to see what is being sent to the MUD. Now with a trigger that matches the first thing *after* being asked your name, and if you remembered the most recent thing sent, then you would have the character name.