| View previous topic :: View next topic |
| Author |
Message |
jeremie Voice
Joined: 30 Aug 2007 Posts: 9
|
Posted: Sun Sep 09, 2007 4:06 pm Post subject: sending a message to all ops on a channel [Solved] |
|
|
I have been writing a script which warns somebody if they say a banned word on a channel.
It sends a warning to that person and I want it to send a private message to all ops on the channel.
I know how to send it as a notice but the ops would rather have it sent to them as a private message.
I have looked in as many places I can think of and not found any solution.
Will somebody please help me with this?
Last edited by jeremie on Mon Sep 24, 2007 11:10 am; edited 1 time in total |
|
| Back to top |
|
 |
TCL_no_TK Owner

Joined: 25 Aug 2006 Posts: 509 Location: England, Yorkshire
|
Posted: Mon Sep 10, 2007 7:12 am Post subject: Re: sending a message to all ops on a channel |
|
|
Try this
| Code: | foreach target [chanlist $dest] {
if {[isop $target $dest]} {
puthelp "PRIVMSG $target :$warning"
}
} | Please set dest to what the #channel_name is, and warning to the message it will send to the ops. You can also make this into a proc by doing.
| Code: | proc msg_ops {text} {
set dest [lindex [split $text] 0]
set warn [join [lrange [split $text] 1 end]]
foreach target [chanlist $dest] {
if {[isop $target $dest]} {
puthelp "PRIVMSG $target :$warn"
}
}; return 1
} | The use msg_ops "#channel some_warning_message" in your script to send a private warning to all ops on the channel. Hope it helps. _________________ TCL the misunderstood |
|
| Back to top |
|
 |
r0t3n Owner
Joined: 31 May 2005 Posts: 507 Location: UK
|
Posted: Mon Sep 10, 2007 4:27 pm Post subject: |
|
|
You're msg_ops proc is bad, you should check the dest syntax correctly, see if the channel is added etc...
| Code: | proc msg_ops {channel msg} {
if {![validchan $channel]} { return }
if {$msg == ""} { return }
foreach user [chanlist $channel] {
if {$user != "" && [isop $user $channel]} {
puthelp "PRIVMSG $user :[join $msg]"
}
}
return 1
} |
_________________ r0t3n @ #r0t3n @ Quakenet |
|
| Back to top |
|
 |
jeremie Voice
Joined: 30 Aug 2007 Posts: 9
|
Posted: Mon Sep 10, 2007 4:29 pm Post subject: [Solved] sending a message to all ops on channel |
|
|
I tried that and it worked perfectly.
Thank you TCL_no_TK and Tosser^^
 |
|
| Back to top |
|
 |
awyeah Revered One

Joined: 26 Apr 2004 Posts: 1580 Location: Switzerland
|
Posted: Wed Sep 12, 2007 3:29 am Post subject: |
|
|
You will need this if the bot is op, so it doesn't need to message itself, heh.
| Code: |
proc msg_ops {channel msg} {
if {![validchan $channel]} { return }
if {$msg == ""} { return }
foreach user [chanlist $channel] {
if {$user != "" && [isop $user $channel] && ![isbotnick $user]} {
puthelp "PRIVMSG $user :[join $msg]"
}
}
return 1
}
|
_________________ ·awyeah·
==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
================================== |
|
| Back to top |
|
 |
jeremie Voice
Joined: 30 Aug 2007 Posts: 9
|
Posted: Wed Sep 12, 2007 2:42 pm Post subject: |
|
|
I'm not sure how you knew I was trying to work that one out too.
I have added that now and it's even better than before.
Thank you awyeah.
 |
|
| Back to top |
|
 |
|