I'm looking for a script that will perform a "/msg chanserv why #channel op nickname" upon an op joining the channel.
The why command output should be notice to the channel ops only.
Thanks in advance
Cheersssss!
DasBrain wrote:I wrote this script for you: https://github.com/DasBrain/brain-tools ... why-1.0.tm
Some notes:
- Services need the S flag.
- The script is designed to work with the Atheme service package, in the English language.
- To enable the script on a channel, use .chanset #channel +cswhy on the partyline.
- The script is triggered when the services (someone with the +S flag) gives someone op.
Code: Select all
# Brain-Tools
# Copyrigt DasBrain @ #John @ irc.quakenet.org
# File: cswhy-1.0.tm
# Asks chanserv what access someone has when they get ops from ChanServ.
# Designed for use with Atheme.
# Configs:
package require eggdrop 1.6
package require Tcl 8.5
package provide dasbrain::cswhy 1.0
namespace eval ::dasbrain::cswhy {
}
setudef flag cswhy
bind mode S "% +o" ::dasbrain::cswhy::onmode
bind notc S * ::dasbrain::cswhy::onnotice
proc ::dasbrain::cswhy::onmode {nick uhost hand chan mc target} {
if {[channel get $chan cswhy]} {
puthelp "PRIVMSG ChanServ WHY $chan $target"
}
}
proc ::dasbrain::cswhy::onnotice {nick uhost handle msg target} {
if {[regexp {has flags \002[^\002]+\002 in \002([^\002]+)\002 } $msg - chan]
|| [regexp {has no special access to \002([^\002]+)\002} $msg - chan]} {
if {[channel get $chan cswhy]} {
putnotc @$chan $msg
}
}
}
firebugs wrote:My bad for not mentioning the network I'm on, I'm on dalnet but will give below script a try.
Thanks for your time and I do appreciate it!
Some notes:DasBrain wrote:I wrote this script for you: https://github.com/DasBrain/brain-tools ... why-1.0.tm
Code: Select all
# Brain-Tools
# Copyrigt DasBrain @ #John @ irc.quakenet.org
# File: cswhy-1.0.tm
# Asks chanserv what access someone has when they get ops from ChanServ.
# Designed for use with Atheme.
# Configs:
package require eggdrop 1.6
package require Tcl 8.5
package provide dasbrain::cswhy 1.0
namespace eval ::dasbrain::cswhy {
}
setudef flag cswhy
bind mode - "% +o" ::dasbrain::cswhy::onmode
bind notc - * ::dasbrain::cswhy::onnotice
proc ::dasbrain::cswhy::onmode {nick uhost hand chan mc target} {
if {[channel get $chan cswhy]} {
puthelp "PRIVMSG ChanServ :WHY $chan $target"
}
}
proc ::dasbrain::cswhy::onnotice {nick uhost handle msg target} {
if {[regexp {has flags \002[^\002]+\002 in \002([^\002]+)\002 } $msg - chan]
|| [regexp {has no special access to \002([^\002]+)\002} $msg - chan]} {
if {[channel get $chan cswhy]} {
putserv "NOTICE $chan :$msg"
}
}
} CrazyCat wrote: I'm skeptical about the bind mode S as the "S" is not a known flag, I don't know how it could work. Same for the bind notc.
Uppercase flags can be freely used by scripts.DasBrain wrote:Services need the S flag.
alltools.tcl - comes with eggdrop.CrazyCat wrote: What is putnotc ? A private proc not included in the script ?
Yeah, somebody changed my code without understanding it.CrazyCat wrote: And I think the PRIVMSG lacks ":"
Code: Select all
proc logargs args {putlog $args}
trace add execution ::dasbrain::cswhy::onmode {enter enterstep leave leavestep} logargs
trace add execution ::dasbrain::cswhy::onnotice {enter enterstep leave leavestep} logargs