hi.. im trying to make a script that will forward a channel notice from 1 channel to another on the same network.. i would prefer to do this with 1 bot.. the bot is in both channels.. the notice will always be the same (atleast the first few words) so i tried to set it up as a trigger.. but i dont know how to set the trigger to recognize on notice.. anyone mind giving me some ideas or some snippets?
bind notc - "Entries" workit
proc workit { nick hand arg } {
set chan2 "#cctv"
set backout "$arg"
puthelp "PRIVMSG $chan2 :ATTENTION $nick $backout ."
}
i know that looks bad but this is one of my first attempts at making my own eggdrop script.. maybe someone can fix it up for me? cause its not working now..
the trigger i want it to transfer the notice on is "Entries are now open.."(after this the notice becomes variable).. all i basically want it to do is repeat it into another channel (#cctv).. there are color codes in the notice.. i dont know if this effects the trigger.. thanks in advance..
mh... other question: wouldn't it be easier to just send the message twice? (i mean in both chans at once). so you wouldn't have to trigger and re-send it...
@your code:
1. check the required arguments for a notice bind
2. see about "*"-sign and string matching
bind notc - "Entries" workit
proc workit { nick hand arg } {
set chan2 "#cctv"
set backout "$arg"
puthelp "PRIVMSG $chan2 :ATTENTION $nick $backout ."
}
i know that looks bad but this is one of my first attempts at making my own eggdrop script.. maybe someone can fix it up for me? cause its not working now..
the trigger i want it to transfer the notice on is "Entries are now open.."(after this the notice becomes variable).. all i basically want it to do is repeat it into another channel (#cctv).. there are color codes in the notice.. i dont know if this effects the trigger.. thanks in advance..
Here is a more simpler way. I will add no variables to set, since you know tcl yourself, just replace #chan1 and #chan2 by the channels you want.
and what about the string matching he needs?
he wants to transfer only specific notices.
if you want to correct his code then you should correct everything
Sorry, I might have not read his second post, because he didn't mention about matching a specific text in the first one, then only relaying the notice to the other channel.
#Set the channel to catch notices from
set chan1 "#mychan"
#Set the channel to send notices on
set chan2 "#yourchan"
#Set the matching text to send the notices on
set relaymatch "Entries are now open"
bind notc - "*" relay:notice
proc relay:notice {nick uhost hand text {chan ""}} {
global chan1 chan2 relaymatch
if {([string equal -nocase "*$chan1*" $chan]) && ([string match -nocase "*$relaymatch*" $text])} {
putserv "NOTICE $chan2 :$text"
return 0
}
}
·awyeah·
==================================
Facebook: jawad@idsia.ch (Jay Dee) PS: Guys, I don't accept script helps or requests personally anymore.
==================================
#Set the channel to catch notices from
set chan1 "#mychan"
#Set the channel to send notices on
set chan2 "#yourchan"
#Set the matching text to send the notices on
set relaymatch "Entries are now open"
bind notc - "*" relay:notice
proc relay:notice {nick uhost hand text {chan ""}} {
global chan1 chan2 relaymatch
if {([string equal -nocase $chan1 $chan]) && ([string match -nocase "*$relaymatch*" $text])} {
putserv "NOTICE $chan2 :$text"
return 0
}
}
·awyeah·
==================================
Facebook: jawad@idsia.ch (Jay Dee) PS: Guys, I don't accept script helps or requests personally anymore.
==================================