|
BloodyThorn Newbie
Joined: 31 Jan 2009 Posts: 5 Location: Austin, Texas
|
Posted: Sun Feb 01, 2009 3:33 pm
Capture And Strip! |
Hey guys, this one is probably really easy, but I've been away from scripting and muds for a few years now. I just bought CMUD, and I am loving it so far. It's like a neat and tidy zMud. But I am trying to do something I can't seem to figure out.
I'm currently playing Aardwolf, and I am trying to setup a simple chat window. At first I was using the initial parts of the chats for the triggers, IE
BloodyThorn gossips 'Hey guys how's it going?'
and my trigger would look like this - #trigger {^(%w) gossips (*)} {#cap Chat;#gag}
And that seemed to work fine, with the exception of the odd NPC that would use a say or a tell.
I've since learned more about the MUD, I'm really new to it. I've learned that you can turn on tagging for certain parts of the mud, and I can have it to where it proceeds any chat with a tag denoting which chat channel it comes out in...so the line suddenly looks like this now.
{chan ch=gossip}BloodyThorn gossips 'Hey guys how's it going?'
My trigger doesn't change much, it just becomes more solid by using #trigger {^~{chan ch=gossip~}} {#cap Chat;#gag}
Only thing is, I can't figure out how to strip the tag '{chan ch=gossip}' out of the text when it hits the chat window to clean it up a bit for the end output. It'd be nice if I never saw the tag in the end output, only used as a way to trigger more reliably but transparent to the output.
I've looked where I could, and I can't seem to find an answer. Any help would be appreciated. |
|
|
|
BloodyThorn Newbie
Joined: 31 Jan 2009 Posts: 5 Location: Austin, Texas
|
Posted: Sun Feb 01, 2009 4:53 pm |
Okay, I figured out how to strip out the tag with the #sub command...but now I seem to have another issue...it's stripped out the ansi colours.
I added this command to my chat window
#trigger {~{chan ch=gossip~}(*)} {#sub {%1}}
And it's stripped the tag, Yay, but it's also stripped all the ansi colours. And idea around this? |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Sun Feb 01, 2009 5:10 pm |
Keep your current trigger doing what it's doing, the #trigger {^~{chan ch=gossip~}} {#cap Chat;#gag} one. Then create another trigger in your Chat window that does:
#trig {^~{chan ch=gossip~}} {#sub ""}
and that should remove that part while leaving the rest of the line intact. You might want to make it more generic, like:
#trig {^~{chan ch=%w~}} {#sub ""}
or even
#trig {^~{*~}} {#sub ""}
to remove tags that aren't from the gossip channel, too. |
|
|
|
charneus Wizard
Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: Sun Feb 01, 2009 6:30 pm |
Actually, easier way to do this. I use this for any channel that I capture/log.
Code: |
#TRIGGER {^(~{chan ch=%w~})(*)$} {#PSUB {} %x1;#CAP Chat;#GAGSPACE} |
What that does is takes:
{chan ch=gossip}You gossip 'Hey guys!'
and gags it from main output, puts it into the chat output as:
You gossip 'Hey guys!'
It retains color and all. Hope this helps you out.
Charneus |
|
|
|
BloodyThorn Newbie
Joined: 31 Jan 2009 Posts: 5 Location: Austin, Texas
|
Posted: Mon Feb 02, 2009 1:33 am |
Thank you both for the reply, I tried both and they both work eloquently. I ended up going with Charneus' for simplicity sake.
These tags are great, the old mud I played didn't have them, so I was never able to do some of the stuff I am able to do with this mud.
Next I will be working on a seperate static map window, and anything else I can to move important informationt that the mud has tags for to a static window.
Thanks again, both of you. |
|
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|