Basicly, the trigger reads:
Name:
you type something and it sets it to a variable and also send it to the world... any ideas how I would go about this?
My first thought is to find a general statement on the mud during the login process that displays your name and capture it from there, but from your request, that doesn't seem to be a useful alternative right now.
Here's one way that I've thought of. I've done some minimal testing on it, and it seems to work fine:
Set up a trigger as follows:
Trigger: Name:
Enabled: <Checked>
Label: catch_name
Script: catch_name
Insert into your script file as follows:
Dim thename 'Note: You can put this inside the Sub if you will pull the variable from the MushClient variable each time using world.GetVariable().
Sub catch_name(ByVal strName, ByVal strLine, ByVal astrParam())
thename = InputBox(strLine)
world.Send thename
world.SetVariable("thename", thename)
End Sub
This will pull up an inputbox, where you can type in the information and it will be pushed to the mud(via the .Send) and stored in a MushClient variable(via the .SetVariable)
I tried that but it says cannont use parentheses when calling a sub.
Ahh, my apologies, try the following VBScript instead:
Dim thename 'Note: You can put this inside the Sub if you will pull the variable from the MushClient variable each time using world.GetVariable().
Sub catch_name(ByVal strName, ByVal strLine, ByVal astrParam())
thename = InputBox(strLine)
world.Send thename
world.SetVariable "thename", thename
End Sub
One problem with triggers is that they don't match until a newline. Thus, if the mud is waiting for you to type in a name, like this:
Name:
The trigger won't match (because no newline has been received).
What I would do here, guessing that you want to remember the name you entered automatically, is to enter the name the usual way, but catch when the MUD echoes it.
Please choose a name for your character:
Temyr
Did I get that right, Temyr (Y/N)?
In this case, you enter the name "Temyr" in the usual way, but make a trigger to catch it like this:
Trigger: Did I get that right, * (Y/N)?
Send: %1
Send to: Variable (label is name)
Label: character_name
Of course, the exact trigger text would depend on the MUD in question, but many of them will be similar as they are based on the same code.