| View previous topic :: View next topic |
| Author |
Message |
Robertus Voice
Joined: 23 Aug 2007 Posts: 11
|
Posted: Sat Feb 21, 2009 2:03 pm Post subject: Write msg from notice |
|
|
hi everybody
i have a little problem, i want a simple tcl that write a message from a notice of a particular user with particular host.
example:
/notice mybot TEST1
on irc:
<mybot> TEST1
thanks in advance to all |
|
| Back to top |
|
 |
tomekk Master

Joined: 28 Nov 2008 Posts: 255 Location: Oswiecim / Poland
|
Posted: Sun Feb 22, 2009 8:44 am Post subject: |
|
|
try:
| Code: | # Author: tomekk
# e-mail: tomekk/@/oswiecim/./eu/./org
# home page: http://tomekk.oswiecim.eu.org/
#
# Version 0.1
#
# This file is Copyrighted under the GNU Public License.
# http://www.gnu.org/copyleft/gpl.html
# output channels
set output_chans {#channel1 #channel2}
# user host:
# *user@*.host.com,
# user@some.host.com
# user@some.*.com
# *@some.host.com
set user_host "user@some.host.com"
#################################################
bind notc - * notc_proc
proc notc_proc { nick uhost hand arg {dest ""}} {
global output_chans user_host
if {[string match $user_host $uhost]} {
foreach nchan [split $output_chans] {
if {$nchan != ""} {
if {[botonchan $nchan]} {
putquick "PRIVMSG $nchan :$arg"
}
}
}
}
}
putlog "simple-notice.tcl ver 0.1 by tomekk loaded"
|
Is this enough for you?  |
|
| Back to top |
|
 |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Sun Feb 22, 2009 2:40 pm Post subject: |
|
|
You don't check if the notice is sent to a channel or the bot. So anyone matching the host will have their notice relayed by the bot even in a channel notice. A channel notice by that user, in another channel will be sent to the output_chans which might not be wanted. You may want to add a check against $dest ( [string index $dest 0] == # ) to detect if it's to a channel or to the bot. _________________ speechles' eggdrop tcl archive |
|
| Back to top |
|
 |
Robertus Voice
Joined: 23 Aug 2007 Posts: 11
|
Posted: Sun Feb 22, 2009 3:18 pm Post subject: |
|
|
nice it works, but i use blowfish and when bot write in channel, it write crypted  |
|
| Back to top |
|
 |
tomekk Master

Joined: 28 Nov 2008 Posts: 255 Location: Oswiecim / Poland
|
Posted: Mon Feb 23, 2009 7:51 am Post subject: |
|
|
@speechles, yeah right
| Code: | # Author: tomekk
# e-mail: tomekk/@/oswiecim/./eu/./org
# home page: http://tomekk.oswiecim.eu.org/
#
# Version 0.1
#
# This file is Copyrighted under the GNU Public License.
# http://www.gnu.org/copyleft/gpl.html
# output channels
set output_chans {#channel1 #channel2}
# user host:
# *user@*.host.com,
# user@some.host.com
# user@some.*.com
# *@some.host.com
set user_host "user@some.host.com"
#################################################
bind notc - * notc_proc
proc notc_proc { nick uhost hand arg {dest ""}} {
global output_chans user_host botnick
if {$dest == ""} {
set dest $botnick
}
if {$dest == $botnick} {
if {[string match $user_host $uhost]} {
foreach nchan [split $output_chans] {
if {$nchan != ""} {
if {[botonchan $nchan]} {
putquick "PRIVMSG $nchan :$arg"
}
}
}
}
}
}
putlog "simple-notice.tcl ver 0.1 by tomekk loaded"
|
@Robertus
You have to decrypt it or something. |
|
| Back to top |
|
 |
|