|
Somnium Beginner
Joined: 15 Nov 2008 Posts: 10
|
Posted: Wed Dec 31, 2008 1:33 pm
How to capture and replace a single word?! |
Hi. I am still quite a newbie to zmud.
I am playing MUME which has some colour support for ex .enemies.
Problem is I am trying to replace message when enemy starts casting spells.
Message I recive from MUME whenever mob/player/enemy casts spell is : xxx begins some strange incantations...
I have tried to #GAG that line and using #SH to get the new line: starts ^^^ CASTING ^^^.
Problem with show command is that I need to add , &temp starts casting , to get message to work, but it captures entire line and
the colours for say ENEMY (red) turns to zmud standard colour (white) and the time is expanded from when spell is casted if you use the #gag command it is actually to late to escape the spell.
What I need is to capture a single line from a string of messages and replace with another word.
another ex is from this captured MUME line:
*f CW>west
*XXX the Orc* starts ^^^ CASTING ^^^
(here the zmud halts until you press a key)
a
*f CW>
what i am trying to get is
*f CW>west
*XXX the Orc* starts ^^^ CASTING ^^^
*f CW>
anybody help me out with this IŽd be greatful :D
/ Christian |
|
|
|
calesta Apprentice
Joined: 07 Dec 2008 Posts: 102 Location: New Hampshire, USA
|
Posted: Wed Dec 31, 2008 5:19 pm |
It sounds like you need a trigger something like
Code: |
#trigger {^(*) begins some strange incantations...} {#gag;#show %ansi(bold,red)%1 starts ^^^CASTING^^^} |
This doesn't capture the color from the MUD (it can be done I believe, but I've never done that before so not sure how), but instead just outputs the line in whatever color you want.
I have no idea what you meant about time being expanded from when the spell is cast if you use the #gag command. If you add another command to flee from the room at the end of the trigger, it should leave the room immediately:
Code: |
#trigger {^(*) begins some strange incantations...} {#gag;#show %ansi(bold,red)%1 starts ^^^CASTING^^^;flee} |
|
|
|
|
Somnium Beginner
Joined: 15 Nov 2008 Posts: 10
|
Posted: Thu Jan 01, 2009 3:16 pm |
Thanks Calesta.
Works a little better, but I was looking for more of a #cw command (that captures a single word and replace/change the word)
If you know what I mean.
Many thanks
/CHristian |
|
|
|
calesta Apprentice
Joined: 07 Dec 2008 Posts: 102 Location: New Hampshire, USA
|
Posted: Thu Jan 01, 2009 4:45 pm |
I guess I'm still not sure what you are trying to do, but if the goal is to replace some text received from the MUD with some other text, you should probably be looking at the #substitute command.
|
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Thu Jan 01, 2009 6:36 pm |
Mmm, #sub is all you need.
#trig {begins some strange incantations...$} {#sub "begins ^^^CASTING^^^"}
and job done. |
|
|
|
Somnium Beginner
Joined: 15 Nov 2008 Posts: 10
|
Posted: Thu Jan 01, 2009 9:25 pm |
Thanks alot.
Exactly what I was looking for, work perfect! |
|
|
|
Leitia Adept
Joined: 04 May 2007 Posts: 292 Location: Boston
|
Posted: Sun Jan 04, 2009 11:35 pm |
OT
Using the ^^^^^ in MUME is like so many subs showing east flees as >>>>>, or You flee as I fled VVVVV South. The game is so painful (and thrilling) everyone serious seems to rewrite the best mud text ever in favor of ascii hieroglyphs. At one point I looked into creating a special MUME font just for such things to use with MXP, it was just a muse. I didn't think wingdings jived well enough. I never did get to that. I wonder... |
|
|
|
|
|