This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Auto Devoice a specific user if anyone Voices them?

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
m
mvp1
Voice
Posts: 22
Joined: Thu Jan 27, 2022 4:28 am

Auto Devoice a specific user if anyone Voices them?

Post by mvp1 »

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
User avatar
CrazyCat
Revered One
Posts: 1302
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Post by CrazyCat »

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: Select all

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.
m
mvp1
Voice
Posts: 22
Joined: Thu Jan 27, 2022 4:28 am

Post by mvp1 »

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.
User avatar
CrazyCat
Revered One
Posts: 1302
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Post by CrazyCat »

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: Select all

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
   }
}
Post Reply