This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

New simple echo script [solved]

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
G
Gordon
Voice
Posts: 35
Joined: Wed Apr 04, 2007 11:45 am

New simple echo script [solved]

Post by Gordon »

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..

:idea:
Last edited by Gordon on Mon Feb 18, 2008 6:45 am, edited 1 time in total.
User avatar
DragnLord
Owner
Posts: 711
Joined: Sat Jan 24, 2004 4:58 pm
Location: C'ville, Virginia, USA

Post by DragnLord »

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: Select all

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
G
Gordon
Voice
Posts: 35
Joined: Wed Apr 04, 2007 11:45 am

Post by Gordon »

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 ? :)
User avatar
DragnLord
Owner
Posts: 711
Joined: Sat Jan 24, 2004 4:58 pm
Location: C'ville, Virginia, USA

Post by DragnLord »

try this one:

Code: Select all

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
User avatar
DragnLord
Owner
Posts: 711
Joined: Sat Jan 24, 2004 4:58 pm
Location: C'ville, Virginia, USA

Post by DragnLord »

last script will automatically set binds based on $wordlist content, do not manually set binds
G
Gordon
Voice
Posts: 35
Joined: Wed Apr 04, 2007 11:45 am

Post by Gordon »

works perfectly!

thanks a much
Post Reply