Reg Exp and capital letters

Posted by Neverwhere on Sat 10 Aug 2002 04:50 PM — 3 posts, 16,036 views.

USA #0
When ever I am fighting the mud that I play on always capitalizes the names of the targets. I thought that the (\w*) would work, but the mud will not accept capital letters.

'Orc feels the true power of the psychic crush.' would send 'cast psychic crush at Orc' since 'Orc' is %1. Is there any way to send back 'cast psychic crush at orc' instead?
Canada #1
I'm afraid you'll have to use scripting for that. In Visual Basic Script, you could do it like this:

Sub_Psychic_Crush (AliasName, AliasLine, arrWildcards)
  World.Send LCase("cast psychic crush at " & arrWildcards(1))
End Sub

Alternatively, if you have a bunch of aliases that require this kind of functionality, you could do something like:

Sub SendLow (AliasName, AliasLine, arrWildcards)
  World.Send LCase(World.Replace(AliasName, "_", " ", True) & arrWildcards(1))
End Sub

You could use that second script for a whole pile of aliases. It takes the label of the alias, and turns it into part of the command to send. For example, in the case we are working with, you would give your psychic crush alias the following label:

cast_psychic_crush_at_

The "SendLow" subroutine takes the label, replaces the underscores with spaces, and then adds the wildcard to the end, all in lowercase.
Australia Forum Administrator #2
This seems to have come up a couple of times now, so version 3.26 has a new trigger option "make wildcards lower-case".

If you check that, then %1 (etc.) will be forced to lower-case, so you can use them immediately without scripting.