egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

New simple echo script [solved]

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
Gordon
Voice


Joined: 04 Apr 2007
Posts: 34

PostPosted: Sun Feb 17, 2008 9:56 am    Post subject: New simple echo script [solved] Reply with quote

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
Back to top
View user's profile Send private message
DragnLord
Owner


Joined: 24 Jan 2004
Posts: 711
Location: C'ville, Virginia, USA

PostPosted: Sun Feb 17, 2008 11:57 am    Post subject: Reply with quote

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
View user's profile Send private message
Gordon
Voice


Joined: 04 Apr 2007
Posts: 34

PostPosted: Sun Feb 17, 2008 12:22 pm    Post subject: Reply with quote

thank you very much for your efforts

but there is a problem, it echoes all messages, no matter what binds i set Confused could you look to it once more ? Smile
Back to top
View user's profile Send private message
DragnLord
Owner


Joined: 24 Jan 2004
Posts: 711
Location: C'ville, Virginia, USA

PostPosted: Sun Feb 17, 2008 12:32 pm    Post subject: Reply with quote

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
View user's profile Send private message
DragnLord
Owner


Joined: 24 Jan 2004
Posts: 711
Location: C'ville, Virginia, USA

PostPosted: Sun Feb 17, 2008 12:34 pm    Post subject: Reply with quote

last script will automatically set binds based on $wordlist content, do not manually set binds
Back to top
View user's profile Send private message
Gordon
Voice


Joined: 04 Apr 2007
Posts: 34

PostPosted: Sun Feb 17, 2008 1:11 pm    Post subject: Reply with quote

works perfectly!

thanks a much
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
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


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber