| View previous topic :: View next topic |
| Author |
Message |
Gordon Voice
Joined: 04 Apr 2007 Posts: 34
|
Posted: Sun Feb 17, 2008 9:56 am Post subject: New simple echo script [solved] |
|
|
Yes, i was looking in tcl archive, no echo script there can do what i want, yet i think it should not be any problem for script coders to implement this feature so im writting here again..
i pretty much described what i need in this thread http://forum.egghelp.org/viewtopic.php?t=14123
Simply script that would echo (from channel to channel) only lines with specified words in them..

Last edited by Gordon on Mon Feb 18, 2008 6:45 am; edited 1 time in total |
|
| Back to top |
|
 |
DragnLord Owner

Joined: 24 Jan 2004 Posts: 711 Location: C'ville, Virginia, USA
|
Posted: Sun Feb 17, 2008 11:57 am Post subject: |
|
|
here is an easy implementaion of what you want
this script is set to relay all public messages with "word1" or "word2" shown in #channel1 to #channel2
| Code: | set chan1 "#channel1"
set chan2 "#channel2"
bind pubm - *word1* my:echo
bind pubm - *word2* my:echo
proc my:echo {n u h c t} {
global chan1 chan2
set chan1 [string tolower $chan1]
set c [string tolower $c]
if {$c == $chan1} {
puthelp "PRIVMSG $chan2 :\<$n@$c\> $t"
}
} |
you can add as many binds as you need to the same proc |
|
| Back to top |
|
 |
Gordon Voice
Joined: 04 Apr 2007 Posts: 34
|
Posted: Sun Feb 17, 2008 12:22 pm Post subject: |
|
|
thank you very much for your efforts
but there is a problem, it echoes all messages, no matter what binds i set could you look to it once more ?  |
|
| Back to top |
|
 |
DragnLord Owner

Joined: 24 Jan 2004 Posts: 711 Location: C'ville, Virginia, USA
|
Posted: Sun Feb 17, 2008 12:32 pm Post subject: |
|
|
try this one:
| Code: | set chan1 "#channel1"
set chan2 "#channel2"
set wordlist "*word1* *word2*"
foreach word $wordlist {
bind pubm - "% $word" my:echo
}
proc my:echo {n u h c t} {
global chan1 chan2
set chan1 [string tolower $chan1]
set c [string tolower $c]
if {$c == $chan1} {
puthelp "PRIVMSG $chan2 :\<$n@$c\> $t"
}
} |
if you have "bind pubm - * my:echo" it will relay everything, post the script as you have it if it does not work correctly |
|
| Back to top |
|
 |
DragnLord Owner

Joined: 24 Jan 2004 Posts: 711 Location: C'ville, Virginia, USA
|
Posted: Sun Feb 17, 2008 12:34 pm Post subject: |
|
|
| last script will automatically set binds based on $wordlist content, do not manually set binds |
|
| Back to top |
|
 |
Gordon Voice
Joined: 04 Apr 2007 Posts: 34
|
Posted: Sun Feb 17, 2008 1:11 pm Post subject: |
|
|
works perfectly!
thanks a much |
|
| Back to top |
|
 |
|