| View previous topic :: View next topic |
| Author |
Message |
firebugs Voice

Joined: 30 Jun 2021 Posts: 3 Location: Penang
|
Posted: Sun Jul 11, 2021 11:15 pm Post subject: Check ops status on join a channel with Chanserv |
|
|
I'm new and i'm glad to be here
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! |
|
| Back to top |
|
 |
DasBrain Voice
Joined: 08 Apr 2021 Posts: 12
|
Posted: Mon Jul 12, 2021 8:21 am Post subject: |
|
|
I wrote this script for you: https://github.com/DasBrain/brain-tools/blob/master/dasbrain/cswhy-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.
|
|
| Back to top |
|
 |
firebugs Voice

Joined: 30 Jun 2021 Posts: 3 Location: Penang
|
Posted: Wed Jul 14, 2021 2:43 am Post subject: |
|
|
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!
| DasBrain wrote: | I wrote this script for you: https://github.com/DasBrain/brain-tools/blob/master/dasbrain/cswhy-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.
|
|
|
| Back to top |
|
 |
firebugs Voice

Joined: 30 Jun 2021 Posts: 3 Location: Penang
|
Posted: Sun Jul 18, 2021 9:59 am Post subject: |
|
|
Below is the script, looks like it's not working, as I try to change it to puthelp "PRIVMSG ChanServ WHY $chan $target"
| Code: |
# 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:- 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.
|
|
| Back to top |
|
 |
CrazyCat Revered One

Joined: 13 Jan 2002 Posts: 1032 Location: France
|
Posted: Sun Jul 18, 2021 10:49 am Post subject: |
|
|
First, use code tags when putting script here, it's better for reading.
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.
What is putnotc ? A private proc not included in the script ?
And I think the PRIVMSG lacks ":":
| Code: | # 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"
}
}
} |
_________________ https://www.eggdrop.fr - French IRC network
Offer me a coffee - Do not ask me help in PM, we are a community. |
|
| Back to top |
|
 |
DasBrain Voice
Joined: 08 Apr 2021 Posts: 12
|
Posted: Sun Jul 18, 2021 6:32 pm Post subject: |
|
|
| 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.
|
| DasBrain wrote: | | Services need the S flag. |
Uppercase flags can be freely used by scripts.
| CrazyCat wrote: |
What is putnotc ? A private proc not included in the script ?
|
alltools.tcl - comes with eggdrop.
| CrazyCat wrote: |
And I think the PRIVMSG lacks ":"
|
Yeah, somebody changed my code without understanding it. |
|
| Back to top |
|
 |
CrazyCat Revered One

Joined: 13 Jan 2002 Posts: 1032 Location: France
|
Posted: Mon Jul 19, 2021 1:10 am Post subject: |
|
|
Oh yes, I didn't read your initial post and I'm not used to use alltools features
@firebugs: how did you set the +S to your services ? can you show us the user record for them ? _________________ https://www.eggdrop.fr - French IRC network
Offer me a coffee - Do not ask me help in PM, we are a community. |
|
| Back to top |
|
 |
DasBrain Voice
Joined: 08 Apr 2021 Posts: 12
|
Posted: Mon Jul 19, 2021 1:32 am Post subject: |
|
|
My script has been written for Atheme, and works fine on libera.chat.
I suspect that DALnet uses a different response to the WHY command - so my script doesn't work.
As I don't use DALnet, I have no idea how their response looks like.
If you do, you just have to change the regexp to match their message.
And if DALnet doesn't support the CS command, then change it to CHANSERV, which is AFAIK supported. |
|
| Back to top |
|
 |
CrazyCat Revered One

Joined: 13 Jan 2002 Posts: 1032 Location: France
|
Posted: Mon Jul 19, 2021 3:00 am Post subject: |
|
|
Adding putlog in different places may help to find which trouble occures, if bind is activated or not, which string is received, if the regexp matches... _________________ https://www.eggdrop.fr - French IRC network
Offer me a coffee - Do not ask me help in PM, we are a community. |
|
| Back to top |
|
 |
DasBrain Voice
Joined: 08 Apr 2021 Posts: 12
|
Posted: Mon Jul 19, 2021 11:58 am Post subject: |
|
|
Sure, add those 3 lines at the end of the script:
| Code: |
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
|
|
|
| Back to top |
|
 |
|