Channel capturing

by Fain

Back to Mechanic's Corner.

Fain2005-06-20 17:20:37
I really like channel capturing, but at the moment I can't really get zmud to do it right (some other clients make it very easy) Anyway I got this script off the zmud forums but it doesnt take into account multiple lines, just a single line, so if someone says alot on the channel it will only capture the first line and not the rest. Some assitance with this would be greatly appreciated.

CODE
Trigger: ^~((*)~): (*)
Commands: #win %1 %time(hh:mm)> %2
#gag
Unknown2005-06-20 17:39:13
I'm afraid I don't have any zmud code as an example since I no longer use it, I have code for it in Tinyfugue which I can post if that helps.

I can however explain to you how it works.

Every communciations message starts with "(some string):". After every communication, regardless of how many lines it is, there is a prompt. I have code that sends every group of channels (guild related, city related, etc) to different windows. So I trigger (Magnagora):, gag that line, echo it to another window, then create a trigger that captures -everything- and gags/sends to that other window. I have a persistent prompt trigger that deletes the catch-all trigger.

So when you receive a communication line it get gaged, as well as every line following until you get a prompt.

When I used zmud I think I had a class that contained triggers for every channel, and did something with enabling/disabilng that class. I'm sure the zmud users here could help more.
Soll2005-06-20 17:51:46
Hmm. Total speculation, and there's going to be a much easier way to do it(probably), but try this.
CODE

#trigger {~(Magnagora~)~: %1} {#var magnagorachannelspeak %1;#t+ {Channels|Magnagora}}
#trigger {%1} {
#add magnagorachannelspeak %1
#if (%pos (@magnagorachannelspeak, .") {#t- {Channels|Magnagora}
#win Magnagora {%time(hh:mm)> @magnagorachannelspeak}
#var magnagorachannelspeak {}
} {Channels|Magnagora}


Not a -clue- if that'll work, but it gives you something to fiddle with, and who knows, maybe it'll do the trick.
Fain2005-06-20 17:52:17
Hmm yeah I still don't really understand how to do it. Maybe someone can tweak the script i posted so it would work right.
Soll2005-06-20 17:52:30
One problem I can forsee with that is that if someone puts in quotes that contain ' ." ' before the end of the actual conversation, only some of it will be put through into the Magnagora window
Fain2005-06-20 17:53:50
I'll try that out Soll and see how it works. Thanks!
Unknown2005-06-20 17:54:31
QUOTE(Soll @ Jun 20 2005, 12:52 PM)
One problem I can forsee with that is that if someone puts in quotes that contain ' ." ' before the end of the actual conversation, only some of it will be put through into the Magnagora window
142063



That's why I just flat out gag the entire line (".*" as a regexp), because then it doesn't matter what they say.
Soll2005-06-20 17:56:23
Check the update coming in a second, or you're screwed.



Fain2005-06-20 17:57:27
Yeah that really didnt work Soll.

The script I posted works completely, except for the fact it cant catch multiple lines
Soll2005-06-20 18:00:53
Yeah. Update coming in a second, missed out a few things. Whoops

Fain2005-06-20 18:30:06
I found gregori's old script and i'm trying it out
Soll2005-06-20 18:37:51
Success!



celahir2005-06-24 11:46:04
I dont know if you got the code working but here are 2 ideas of mine:


CODE

TRIGGER: (^~((*)~): (*)) {
#win %1 %time(hh:mm)> %2
#gag
#CLASS extralines 1
}

#CLASS extralines :

TRIGGER : (%dh, %dm,) {
#CLASS extralines 0
#ungag
}  "" {nocr|prompt}

TRIGGER (*) {
#win %2
#gag
}


Only problem I can forsee with this is that the prompts will be sent to or if their missed the whole text will be sent. I wrote this 2 miles from my Zmud so may not work.

Second:
CODE

CLASS channelcapt:

#TRIGGER (^~((*)~): (*)$%dh, %dm,) {
#win %1 %time(hh:mm)> %2
#gag
#class channelcapt 0
}  "" {nocr|prompt}

#TRIGGER (^~((*)~): (*)$(*)$%dh, %dm,) {
#win %1 %time(hh:mm)> %2 %3
#gag
#class channelcapt 0
} "" {nocr|prompt}

#TRIGGER (^~((*)~): (*)$(*)$(*)$%dh, %dm,) {
#win %1 %time(hh:mm)> %2 %3
#gag
#class channelcapt 0
} "" {nocr|prompt}

#TRIGGER (^%dh, %dm,) {#class channelcapt 1}



And just repeat the trigger adding an extra line each time up to about 5 or 6 lines would be best unless you know people are gonna make really long posts on the aetherwares. If you want to be safe go up to about 10 lines. You need to deactivate the class the reactivate it with the prompt line so that with small aether tells it wont overlap the first prompt line and send extra stuff to the window.

Anyway tell me if these work.
Raezon2005-06-24 22:07:43
There's actually quite a bit of talk on the zuggsoft forums about this from Achaea. There were multiple solutions but personally the easiest was to transfer everything before the next prompt to another window whether you gag it or not. I got it to work a while back but have since lost that mud file. I'll let you know if I find it on Zuggsoft.
Raezon2005-06-24 22:30:31
#VAR comms {tell|say|gossip|chat|yell|shout|whisper} {tell|say|gossip|chat|yell|shout|whisper} {Windoze}
#TRIGGER {^* {@comms}*: "%*"$} {#CAP 1 Tells} {Windoze} 517
#TRIGGER {^* {@comms}*:$ "%*"$} {#CAP 2 Tells} {Windoze} 517
#TRIGGER {^* {@comms}*:$ "%*$ %*"$} {#CAP 3 Tells} {Windoze} 517
#TRIGGER {^* {@comms}*:$ "%*$ %*$ %*"$} {#CAP 4 Tells} {Windoze} 517
#TRIGGER {^* {@comms}*:$ "%*$ %*$ %*$ %*"$} {#CAP 5 Tells} {Windoze} 517
#TRIGGER {^* {@comms}*:$ "%*$ %*$ %*$ %*$ %*"$} {#CAP 6 Tells} {Windoze} 517

except you're going to have to replace the *"$ part, specifically the " part with a pattern for your prompt. I'll try to do it tonight when I get home. Also, this puts all of the communications in one window. Assuming that the multi-line's aren't ever more than let's say 3 lines, you could stop at the trigger for 3 tells, and specifically replace the @comms with the specific channel. You'll want to have the number of triggers for the most multi-lines you think you'll ever have. The above example goes max 6.
Unknown2005-06-25 00:10:59
Raezon, that didn't work for me. However, this is working:

CODE

#TRIGGER {^~(*~)~: *, ~"*~"$} {#CAP 1 Tells;#GAG 2}
#TRIGGER {^~(*~)~: *, ~"*$*~"$} {#CAP 2 Tells;#GAG 3}
#TRIGGER {^~(*~)~: *, ~"*$*$*~"$} {#CAP 3 Tells;#GAG 4}
--ETC-- (add another *$ in the middle, and another to #CAP and another to#GAG for however many lines you think you will get.)
Daganev2005-06-25 00:12:54
Dyr did you put your prompt in there like Raezon said? tongue.gif
Dias2005-06-25 03:58:34
This is what I use. Just add more conditionals to the trigger to have it capture more lines.

CODE
#TRIGGER "capChannels" {(^~(*~): %w {say|says}, ~"*)} {
 #win Channels %ansi( white)%time( hh:mm)> %ansi( gray)"%1"
 #va channelsEnd {%rightback( "%1", 1)}
 #if (@channelsEnd = %char( 34)) {#state capChannels 0}
 #gag
 }
#COND {(*)} {
 #win Channels %ansi( gray)"       %1"
 #va channelsEnd {%rightback( "%1", 1)}
 #if (@channelsEnd = %char( 34)) {#state capChannels 0}
 #gag
 } {within|param=1}
Gregori2005-06-25 04:22:40
CODE

#CLASS {Communication}
#VAR cap {}
#TRIGGER {^~((*)~):(*)} {#var cap "%1";#class cap 1}
#TRIGGER {^(%w) tells you,} {#T+ cap}
#TRIGGER {^You tell} {#T+ cap}
#CLASS 0
#CLASS {Communication|Cap} {disable}
#TRIGGER {*} {#CAPTURE Channels}
#CLASS 0


Then in your prompt trigger add this line

#CLASS cap 0

This is the script I have been using for years.
Morik2005-06-25 04:27:05
QUOTE(bwbettin @ Jun 21 2005, 01:39 AM)
I'm afraid I don't have any zmud code as an example since I no longer use it, I have code for it in Tinyfugue which I can post if that helps.

I can however explain to you how it works.

Every communciations message starts with "(some string):".  After every communication, regardless of how many lines it is, there is a prompt.  I have code that sends every group of channels (guild related, city related, etc) to different windows.  So I trigger (Magnagora):, gag that line, echo it to another window, then create a trigger that captures -everything- and gags/sends to that other window.  I have a persistent prompt trigger that deletes the catch-all trigger.

So when you receive a communication line it get gaged, as well as every line following until you get a prompt.

When I used zmud I think I had a class that contained triggers for every channel, and did something with enabling/disabilng that class.  I'm sure the zmud users here could help more.
142054



nifty. how do you echo to another window? Is it just a partition in the tinyfugue main window, or have you figured out how to echo it into a second text window somewhere?