Fflam's Silly Mudlet Question Repository
I figure if I can't figure it out, somewhere, someone else won't be able to figure it out - so we'll get it in writing!
Right now, all I'm trying to do so streamline my bashing - remove the wordy attacks and replace them with short and sweet gags, keeping relevant information in front of me.
So far, I have my current stance on my prompt (thanks, forums) and I have managed to get what is ALMOST working triggers for the basic lateral/vertical knifeplay attacks. My problem jumps in when (I think) there are multiple words in a mob's name, OR when there is an apostrophe in the mob's name.
I think there needs to be a way to signify the apostrophe, as I believe (\w+) catches any number of words, but I'm not seeing a fix in documentation as the examples are specific.
Once we've sorted this as solved I'll edit the post with the answer and move on to figuring out how to put multiple things on my prompt without a custom prompt (SPOILER: I think I need multiple prompt triggers)
Right now, all I'm trying to do so streamline my bashing - remove the wordy attacks and replace them with short and sweet gags, keeping relevant information in front of me.
So far, I have my current stance on my prompt (thanks, forums) and I have managed to get what is ALMOST working triggers for the basic lateral/vertical knifeplay attacks. My problem jumps in when (I think) there are multiple words in a mob's name, OR when there is an apostrophe in the mob's name.
^You step in quickly with a slash across (\w+) torso\.$ selectString( line, 1 ) replace("") cecho("<white>ATTACK:<red>LATERAL")
I think there needs to be a way to signify the apostrophe, as I believe (\w+) catches any number of words, but I'm not seeing a fix in documentation as the examples are specific.
Once we've sorted this as solved I'll edit the post with the answer and move on to figuring out how to put multiple things on my prompt without a custom prompt (SPOILER: I think I need multiple prompt triggers)
0
Comments
Wildcard would look like:
( ) denotes the capture group, a-z is any lowercase letter, A-Z any uppercase, ' to match the apostrophe and \s to match the spaces. [] makes it a character set, and the + makes it "1 or more", so any string with 1 or more of those characters is matched.
Alternately, in case any mob has other things in its name, you could do:
That will match anything in that gap.
To delete and replace the line, you can just do:
And to add extra stuff to the prompt you can just have it in multiple echos/an echo in your prompt trigger.
The way I handle this is:
That would just chuck a B: 123 on my prompt for my bleeding, if I call the extraPrompt() function in my prompt trigger. You can get pretty complex with this using if statements and selective echoing, for example:
That would hide myBleeding if it was 0. You can build on this - Adding more complicated things, more information, selective formatting etc. I have an "s" for shield, which is uppercase and cyan if I'm shielded, lowercase and grey if not. The below example assumes if you're shielded, then myShielded is set to true, if not, it's set to false.