Spell Recast Alias

Posted by Jeffrey F. Pia on Sat 24 Aug 2002 04:15 PM — 3 posts, 17,964 views.

#0
K, I need a little advice here:
I have a collection of trigs that catch the lines sent from the MUD upon spells' failure and send a line to recast the spells. This has gotten to be a bit awkward as if a spell fails during combat, while I'm sleeping, or when I'm AFK, the recast will automatically fail as well, thus making me manually scroll up to see which spell failed and recast when I'm free again. What I would like to do is send recast lines to a variable which I can then call from an alias at my leisure. The only problem is, in order to send the line to a variable, I have to name the trig the same as the variable, thus rendering my collection of trigs useless. Is there any way around this? I would like to use VBScript to send the line in the Send: box of my trigs to a variable and not to the world. Or would I pretty much have to delete all my recast trigs in lieu of a scripted Select Case Statement? I'd like to avoid the latter if at all possible, but if that's my only option, so be it...
Canada #1
Vaguely similar routine:

Sub Auto_Command (TriggerName, TriggerLine, arrWildcards)
	Dim StringPos
	Dim NewCommand
	StringPos = InStr(1, TriggerName, "PUSHCMD_", vbTextCompare)
	If StringPos > 0 Then
		NewCommand = World.Replace(TriggerName, "PUSHCMD_", "", True)
		NewCommand = "do " & World.Replace(NewCommand, "_", " ", True)
		SetCommandLine(NewCommand)
	End If
End Sub

On the mud I play, there are many rooms that require a "special" exit, for example "enter camp".

In such cases, I build a trigger on the room name, then call the subroutine above. The label of the trigger will contain the mud text I want to send.

I actually have all labels in this case start with "PUSHCMD_" (so that I can find them easily in my trigger list), then I strip off that string if it exists, in the script above.

Next, I convert all underscores to spaces, and in my case, I send the text to the command box, so that all I have to do is press [Enter] to send the text (or [DEL] then up arrow to regain what was in the command box before).

I'm sure you could borrow from this idea, and store the line in a variable instead...

Oh, just in case anyone wants to copy that routine more closely, it makes a call to this subroutine:

Sub SetCommandLine (CommandString)
	World.PushCommand
	World.SetCommand CommandString
	World.SelectCommand
End Sub
#2
Nice idea Magunm!! :D One last obstacle I have to cross is how to include a double quote in the string sent to the variable... not a big deal though. :) I'll probably use some obscure string of characters and use the replace method. Thanks for the help!