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 tag nick

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
F
Football
Master
Posts: 205
Joined: Fri Dec 26, 2008 3:08 pm
Location: Quakenet, #Football

Voice tag nick

Post by Football »

Hey,

I need a script that will voice anyone who changes his nick to CFC|* or AFC|* or joins with that kind of nick and will devoice the user if he changes his nick to a nick that doesn't include those tags.

Thanks.
Idling at #Football, Quakenet.
User avatar
TCL_no_TK
Owner
Posts: 509
Joined: Fri Aug 25, 2006 7:05 pm
Location: England, Yorkshire

Post by TCL_no_TK »

There's a few of these around the forum already, most commonly used is this one.
F
Football
Master
Posts: 205
Joined: Fri Dec 26, 2008 3:08 pm
Location: Quakenet, #Football

Post by Football »

Yeah it works, but what if I want more than one tag
It says how to define TAG|Nick, what if I want a few more defined tags?

Code: Select all

bind join - {% CFC|*} voice:user 
bind nick - {% CFC|*} voice:user 
bind nick - * devoice:user 

proc voice:user {nick uhost hand chan {nn ""}} { 
 if {$nn == ""} {set nn $nick} 
 if {![isvoice $nn $chan]} { 
  pushmode $chan +v $nn 
 } 
} 

proc devoice:user {nick uhost hand chan nn} { 
 if {![string match -nocase CFC|* $nn] && [isvoice $nn $chan]} { 
  pushmode $chan -v $nn 
 } 
Idling at #Football, Quakenet.
User avatar
TCL_no_TK
Owner
Posts: 509
Joined: Fri Aug 25, 2006 7:05 pm
Location: England, Yorkshire

Post by TCL_no_TK »

easy way :P add

Code: Select all

bind join - {% AFC|*} voice:user
bind nick - {% AFC|*} voice:user 
change

Code: Select all

 if {![string match -nocase CFC|* $nn] && [isvoice $nn $chan]} { 
for

Code: Select all

 if {![string match -nocase CFC|* $nn] && ![string match -nocase AFC|* $nn] && [isvoice $nn $chan]} { 
F
Football
Master
Posts: 205
Joined: Fri Dec 26, 2008 3:08 pm
Location: Quakenet, #Football

Post by Football »

This didn't work for me..

Code: Select all

setudef flag tagvoice

bind join - {% CFC|*} voice:user 
bind nick - {% CFC|*} voice:user 
bind join - {% AFC|*} voice:user 
bind nick - {% AFC|*} voice:user
bind join - {% AVFC|*} voice:user 
bind nick - {% AVFC|*} voice:user
bind join - {% LFC|*} voice:user 
bind nick - {% LFC|*} voice:user
bind join - {% MU|*} voice:user 
bind nick - {% MU|*} voice:user
bind join - {% NU|*} voice:user 
bind nick - {% NU|*} voice:user
bind join - {% NUFC|*} voice:user 
bind nick - {% NUFC|*} voice:user
bind join - {% BCFC|*} voice:user 
bind nick - {% BCFC|*} voice:user
bind join - {% EPL|*} voice:user 
bind nick - {% EPL|*} voice:user
bind nick - * devoice:user 

proc voice:user {nick uhost hand chan {nn ""}} { 
 if {$nn == ""} {set nn $nick} 
 if {![isvoice $nn $chan]} { 
  pushmode $chan +v $nn 
 } 
} 

proc devoice:user {nick uhost hand chan nn} { 
 if {![string match -nocase CFC|* $nn] && ![string match -nocase AFC|* $nn] && ![string match -nocase AVFC|* $nn] && ![string match -nocase LFC|* $nn] && ![string match -nocase EPL|* $nn] && ![string match -nocase MU|* $nn] && ![string match -nocase BCFC|* $nn] && ![string match -nocase NU|* $nn] && ![string match -nocase NUFC|* $nn] && [isvoice $nn $chan]} {  
  pushmode $chan -v $nn 
 } 
Idling at #Football, Quakenet.
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

Seems to be one } missing at the end of devoice:user.
NML_375
F
Football
Master
Posts: 205
Joined: Fri Dec 26, 2008 3:08 pm
Location: Quakenet, #Football

Post by Football »

Well it works now, but the flag doesn't it totally ignores the flag and uses this script in every channel even though it's set to -tagvoice, how do I sort that?

Code: Select all

setudef flag tagvoice 

bind join - {% CFC|*} voice:user 
bind nick - {% CFC|*} voice:user 
bind join - {% AFC|*} voice:user 
bind nick - {% AFC|*} voice:user 
bind join - {% AVFC|*} voice:user 
bind nick - {% AVFC|*} voice:user 
bind join - {% LFC|*} voice:user 
bind nick - {% LFC|*} voice:user 
bind join - {% MU|*} voice:user 
bind nick - {% MU|*} voice:user 
bind join - {% NU|*} voice:user 
bind nick - {% NU|*} voice:user 
bind join - {% NUFC|*} voice:user 
bind nick - {% NUFC|*} voice:user 
bind join - {% BCFC|*} voice:user 
bind nick - {% BCFC|*} voice:user 
bind join - {% EPL|*} voice:user 
bind nick - {% EPL|*} voice:user 
bind join - {% THFC|*} voice:user 
bind nick - {% THFC|*} voice:user 
bind nick - * devoice:user 

proc voice:user {nick uhost hand chan {nn ""}} { 
 if {$nn == ""} {set nn $nick} 
 if {![isvoice $nn $chan]} { 
  pushmode $chan +v $nn 
 } 
} 

proc devoice:user {nick uhost hand chan nn} { 
 if {![string match -nocase CFC|* $nn] && ![string match -nocase AFC|* $nn] && ![string match -nocase AVFC|* $nn] && ![string match -nocase LFC|* $nn] && ![string match -nocase EPL|* $nn] && ![string match -nocase MU|* $nn] && ![string match -nocase BCFC|* $nn] && ![string match -nocase NU|* $nn] && ![string match -nocase NUFC|* $nn] && ![string match -nocase THFC|* $nn] && [isvoice $nn $chan]} {  
  pushmode $chan -v $nn 
}
 }
 
Idling at #Football, Quakenet.
r
raider2k
Op
Posts: 140
Joined: Tue Jan 01, 2008 10:42 am

Post by raider2k »

i think it will work like that, was wondering why theres a flag but nothings using it .. lets try the following:

Code: Select all

setudef flag tagvoice

bind join - {% CFC|*} voice:user
bind nick - {% CFC|*} voice:user
bind join - {% AFC|*} voice:user
bind nick - {% AFC|*} voice:user
bind join - {% AVFC|*} voice:user
bind nick - {% AVFC|*} voice:user
bind join - {% LFC|*} voice:user
bind nick - {% LFC|*} voice:user
bind join - {% MU|*} voice:user
bind nick - {% MU|*} voice:user
bind join - {% NU|*} voice:user
bind nick - {% NU|*} voice:user
bind join - {% NUFC|*} voice:user
bind nick - {% NUFC|*} voice:user
bind join - {% BCFC|*} voice:user
bind nick - {% BCFC|*} voice:user
bind join - {% EPL|*} voice:user
bind nick - {% EPL|*} voice:user
bind join - {% THFC|*} voice:user
bind nick - {% THFC|*} voice:user
bind nick - * devoice:user

proc voice:user {nick uhost hand chan {nn ""}} {
 if { ![channel get $chan tagvoice] } { return 0 }
 if {$nn == ""} {set nn $nick}
 if {![isvoice $nn $chan]} {
  pushmode $chan +v $nn
 }
}

proc devoice:user {nick uhost hand chan nn} {
 if { ![channel get $chan tagvoice] } { return 0 }
 if {![string match -nocase CFC|* $nn] && ![string match -nocase AFC|* $nn] && ![string match -nocase AVFC|* $nn] && ![string match -nocase LFC|* $nn] && ![string match -nocase EPL|* $nn] && ![string match -nocase MU|* $nn] && ![string match -nocase BCFC|* $nn] && ![string match -nocase NU|* $nn] && ![string match -nocase NUFC|* $nn] && ![string match -nocase THFC|* $nn] && [isvoice $nn $chan]} { 
  pushmode $chan -v $nn
}
 }
F
Football
Master
Posts: 205
Joined: Fri Dec 26, 2008 3:08 pm
Location: Quakenet, #Football

Post by Football »

Works, Thank you very much!
Idling at #Football, Quakenet.
L
Luminous
Op
Posts: 146
Joined: Fri Feb 12, 2010 1:00 pm

Post by Luminous »

I have a somewhat related question... I've been trying to get join binds to work for ages, but have never succeeded. I never tried it with {%...} though.. I guess that is why. If I wanted to kick someone joining under a nick, would something like this work?

Code: Select all

bind join - {% somenick!*@host.domain} kick:somenick
 proc kick:somenick {nick host hand chan test} {
   putserv "KICK $chan $nick :You are banned."
}
Or would that mask not work?
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

@ Luminous:
The mask is correct, however, the number of arguments in your proc is incorrect; drop the "text" argument. Quoted from doc/tcl-commands.doc:
( 8 ) JOIN (stackable)
bind join <flags> <mask> <proc>
procname <nick> <user@host> <handle> <channel>

Description: triggered by someone joining the channel. The mask in
the bind is matched against "#channel nick!user@host" and can
contain wildcards.
Module: irc
NML_375
L
Luminous
Op
Posts: 146
Joined: Fri Feb 12, 2010 1:00 pm

Post by Luminous »

Ah, right... I just wrote that out real quick upon discovering this thread, lol. Thanks. :)
F
Football
Master
Posts: 205
Joined: Fri Dec 26, 2008 3:08 pm
Location: Quakenet, #Football

Post by Football »

I`ve added a second script, called it chelsea.tcl, but it doesn't work along with the previous code even though this is a more specific one and even though I've changed the flag, How do I make these two scripts work together?

Code: Select all

setudef flag chelsea 

bind join - {% CFC|*} voice:user 
bind nick - {% CFC|*} voice:user 
bind nick - * devoice:user 

proc voice:user {nick uhost hand chan {nn ""}} { 
 if { ![channel get $chan chelsea] } { return 0 } 
 if {$nn == ""} {set nn $nick} 
 if {![isvoice $nn $chan]} { 
  pushmode $chan +v $nn 
 } 
} 

proc devoice:user {nick uhost hand chan nn} { 
 if { ![channel get $chan chelsea] } { return 0 } 
 if {![string match -nocase CFC|* $nn] && [isvoice $nn $chan]} { 
  pushmode $chan -v $nn 
} 
 } 
Idling at #Football, Quakenet.
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

@ Football:
You are using the same names for your procs, which results in the later overwriting the previous one. Either use a different name on your procs, or considder merging the codes into a single proc.
NML_375
F
Football
Master
Posts: 205
Joined: Fri Dec 26, 2008 3:08 pm
Location: Quakenet, #Football

Post by Football »

can you show me an example of a proper modified one?
Idling at #Football, Quakenet.
Post Reply