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.

voice only with specific flag

Help for those learning Tcl or writing their own scripts.
Post Reply
User avatar
ultralord
Master
Posts: 255
Joined: Mon Nov 06, 2006 6:52 pm

voice only with specific flag

Post by ultralord »

Hello i have this script..

Code: Select all

set g_pickupchan "#channel"
bind mode - "% +v" g_delvoices


proc g_delvoices {nick host handle channel mode victim} {
global g_pickupchan
if { [matchattr $hand H] } {
return 0
}
if {$channel==$g_pickupchan} {     
putserv "MODE $g_pickupchan -v $victim"
  }
}
i want this: if someone have flag H .. if give voice to a user then the user will be voiced.. if someone give voice bot devoice the user.. how i can do it..?

thnx
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

Code: Select all

if {![matchattr $handle H|H $channel]} {return}
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
User avatar
ultralord
Master
Posts: 255
Joined: Mon Nov 06, 2006 6:52 pm

Post by ultralord »

i edit the code to:

Code: Select all

proc g_delvoices {nick host handle channel mode victim} {
global g_pickupchan
if {![matchattr $handle H|H $channel]} {return}
if {$channel==$g_pickupchan} {     
putserv "MODE $g_pickupchan -v $victim"
  }
}
but when i give voice then the bot devoice the specific nick.. but i am authenticated before.. what is wrong?

thanks
User avatar
TCL_no_TK
Owner
Posts: 509
Joined: Fri Aug 25, 2006 7:05 pm
Location: England, Yorkshire

Post by TCL_no_TK »

Check your channel settings, or see if you have superbitch.tcl settings on that channel. look for +bitch on .chaninfo #channel_name And there is also a chance that the user could have been given the devoice flag check the .whois <handle> on the DCC/Chat telnet partyline.
User avatar
De Kus
Revered One
Posts: 1361
Joined: Sun Dec 15, 2002 11:41 am
Location: Germany

Post by De Kus »

I wonder why you use 2 if conditions in such a trivial issue. Also using pushmode is considered more spam proof, because it can accumulate mode requests which might arise in a join-flood... these often arise on net rejoins.

Code: Select all

  if {![matchattr $handle H|H $channel] && $channel == $::g_pickupchan} {
    pushmode $channel -v $victim
  }
  return 0
These 4 lines of code would be enough within the proc.

Also about the person who grants voice... if the person who has the flag H voices a person, it is fine, in all other (all is in, even permanent owner is not recognized) cases it should devoice the person?!
De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens...
Post Reply