egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Auto Devoice a specific user if anyone Voices them?

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
mvp1
Voice


Joined: 27 Jan 2022
Posts: 22

PostPosted: Tue Jul 26, 2022 2:55 am    Post subject: Auto Devoice a specific user if anyone Voices them? Reply with quote

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
View user's profile Send private message
CrazyCat
Revered One


Joined: 13 Jan 2002
Posts: 1057
Location: France

PostPosted: Tue Jul 26, 2022 4:23 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
mvp1
Voice


Joined: 27 Jan 2022
Posts: 22

PostPosted: Tue Jul 26, 2022 7:24 am    Post subject: Reply with quote

CrazyCat, thanks heaps mate! You're a legend Smile

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 Smile

Thanks again.
Back to top
View user's profile Send private message
CrazyCat
Revered One


Joined: 13 Jan 2002
Posts: 1057
Location: France

PostPosted: Tue Jul 26, 2022 9:41 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber