View previous topic :: View next topic |
Author |
Message |
mvp1 Voice
Joined: 27 Jan 2022 Posts: 22
|
Posted: Tue Jul 26, 2022 2:55 am Post subject: Auto Devoice a specific user if anyone Voices them? |
|
|
Hi guys,
I need a quick TCL code please, for eggdrop, which can make sure a specific user "USERX" is never voiced in a channel #CHANNELX by anyone.
So basically the code should check all the +v mode changes in #CHANNELX and if it detects USERX is voiced, it should apply mode -v (devoice) straight away to make sure the USERX does not stay with +v at all.
Any help is appreciated as always.
Cheers |
|
Back to top |
|
 |
CrazyCat Revered One

Joined: 13 Jan 2002 Posts: 1074 Location: France
|
Posted: Tue Jul 26, 2022 4:23 am Post subject: |
|
|
How do you determine userX ? a nick, a hostmask ?
Is there only one user or could it be a list of users ?
Imho, the simplest way is to add users in eggdrop with a particular flag like G which will be the opposite to g (note the cap/minus)
Code: | bind mode - "% +v" vcheck
proc vcheck {nick uhost handle chan mode target} {
if {$mode ne "+v"} { return }
# useless check but adds a security
set vhandle [nick2hand $target $chan]
if {[matchattr $vhandle +G|+G $chan]} {
pushmode $chan -v $target
flushmode $chan
}
} |
Next step: add users to your eggdrop give them the +G flag, globally or per channel. _________________ 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 |
|
 |
mvp1 Voice
Joined: 27 Jan 2022 Posts: 22
|
Posted: Tue Jul 26, 2022 7:24 am Post subject: |
|
|
CrazyCat, thanks heaps mate! You're a legend
Loved the idea of adding users with flag, which I think is much easier.
Works perfect for now. Will ask for help if there are any changes needed further
Thanks again. |
|
Back to top |
|
 |
CrazyCat Revered One

Joined: 13 Jan 2002 Posts: 1074 Location: France
|
Posted: Tue Jul 26, 2022 9:41 am Post subject: |
|
|
Short correction: better to use the +q flag rather than the +G: it's a built-in flag which forbid the autovoice for the user, and the script will just act when voice is manually given:
Code: | bind mode - "% +v" vcheck
proc vcheck {nick uhost handle chan mode target} {
if {$mode ne "+v"} { return }
# useless check but adds a security
set vhandle [nick2hand $target $chan]
if {[matchattr $vhandle +q|+q $chan]} {
pushmode $chan -v $target
flushmode $chan
}
} |
_________________ 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 |
|
 |
|