| View previous topic :: View next topic |
| Author |
Message |
Football Master
Joined: 26 Dec 2008 Posts: 205 Location: Quakenet, #Football
|
Posted: Sun Mar 21, 2010 2:36 pm Post subject: Voice tag nick |
|
|
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. |
|
| Back to top |
|
 |
TCL_no_TK Owner

Joined: 25 Aug 2006 Posts: 509 Location: England, Yorkshire
|
Posted: Sun Mar 21, 2010 5:11 pm Post subject: |
|
|
There's a few of these around the forum already, most commonly used is this one. _________________ TCL the misunderstood |
|
| Back to top |
|
 |
Football Master
Joined: 26 Dec 2008 Posts: 205 Location: Quakenet, #Football
|
Posted: Sun Mar 21, 2010 6:05 pm Post subject: |
|
|
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: | 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. |
|
| Back to top |
|
 |
TCL_no_TK Owner

Joined: 25 Aug 2006 Posts: 509 Location: England, Yorkshire
|
Posted: Mon Mar 22, 2010 3:23 am Post subject: |
|
|
easy way add | Code: | bind join - {% AFC|*} voice:user
bind nick - {% AFC|*} voice:user | change | Code: | | if {![string match -nocase CFC|* $nn] && [isvoice $nn $chan]} { | for | Code: | | if {![string match -nocase CFC|* $nn] && ![string match -nocase AFC|* $nn] && [isvoice $nn $chan]} { |
_________________ TCL the misunderstood |
|
| Back to top |
|
 |
Football Master
Joined: 26 Dec 2008 Posts: 205 Location: Quakenet, #Football
|
Posted: Mon Mar 22, 2010 8:47 am Post subject: |
|
|
This didn't work for me..
| Code: | 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. |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Mon Mar 22, 2010 11:43 am Post subject: |
|
|
Seems to be one } missing at the end of devoice:user. _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
Football Master
Joined: 26 Dec 2008 Posts: 205 Location: Quakenet, #Football
|
Posted: Mon Mar 22, 2010 12:33 pm Post subject: |
|
|
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: | 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. |
|
| Back to top |
|
 |
raider2k Op
Joined: 01 Jan 2008 Posts: 140
|
Posted: Mon Mar 22, 2010 12:39 pm Post subject: |
|
|
i think it will work like that, was wondering why theres a flag but nothings using it .. lets try the following:
| Code: |
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
}
}
|
|
|
| Back to top |
|
 |
Football Master
Joined: 26 Dec 2008 Posts: 205 Location: Quakenet, #Football
|
Posted: Mon Mar 22, 2010 1:28 pm Post subject: |
|
|
Works, Thank you very much! _________________ Idling at #Football, Quakenet. |
|
| Back to top |
|
 |
Luminous Op
Joined: 12 Feb 2010 Posts: 146
|
Posted: Mon Mar 22, 2010 7:40 pm Post subject: |
|
|
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: | 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? |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Mon Mar 22, 2010 7:45 pm Post subject: |
|
|
@ 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:
| Quote: | ( 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, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
Luminous Op
Joined: 12 Feb 2010 Posts: 146
|
Posted: Mon Mar 22, 2010 9:36 pm Post subject: |
|
|
Ah, right... I just wrote that out real quick upon discovering this thread, lol. Thanks.  |
|
| Back to top |
|
 |
Football Master
Joined: 26 Dec 2008 Posts: 205 Location: Quakenet, #Football
|
Posted: Wed Mar 24, 2010 4:30 am Post subject: |
|
|
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: | 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. |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Wed Mar 24, 2010 11:19 am Post subject: |
|
|
@ 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, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
Football Master
Joined: 26 Dec 2008 Posts: 205 Location: Quakenet, #Football
|
Posted: Wed Mar 24, 2010 2:45 pm Post subject: |
|
|
can you show me an example of a proper modified one? _________________ Idling at #Football, Quakenet. |
|
| Back to top |
|
 |
|