Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ MUSHclient
➜ Tips and tricks
➜ Spell Recast Alias
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Jeffrey F. Pia
(49 posts) Bio
|
Date
| Sat 24 Aug 2002 04:15 PM (UTC) |
Message
| 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... | Top |
|
Posted by
| Magnum
Canada (580 posts) Bio
|
Date
| Reply #1 on Sat 24 Aug 2002 04:48 PM (UTC) |
Message
| 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
|
Get my plugins here: http://www.magnumsworld.com/muds/
Constantly proving I don't know what I am doing...
Magnum. | Top |
|
Posted by
| Jeffrey F. Pia
(49 posts) Bio
|
Date
| Reply #2 on Sat 24 Aug 2002 05:14 PM (UTC) |
Message
| 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! | Top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
14,581 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top