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 

Voice tag nick

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


Joined: 26 Dec 2008
Posts: 205
Location: Quakenet, #Football

PostPosted: Sun Mar 21, 2010 2:36 pm    Post subject: Voice tag nick Reply with quote

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
View user's profile Send private message
TCL_no_TK
Owner


Joined: 25 Aug 2006
Posts: 509
Location: England, Yorkshire

PostPosted: Sun Mar 21, 2010 5:11 pm    Post subject: Reply with quote

There's a few of these around the forum already, most commonly used is this one.
_________________
TCL the misunderstood
Back to top
View user's profile Send private message Send e-mail
Football
Master


Joined: 26 Dec 2008
Posts: 205
Location: Quakenet, #Football

PostPosted: Sun Mar 21, 2010 6:05 pm    Post subject: Reply with quote

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
View user's profile Send private message
TCL_no_TK
Owner


Joined: 25 Aug 2006
Posts: 509
Location: England, Yorkshire

PostPosted: Mon Mar 22, 2010 3:23 am    Post subject: Reply with quote

easy way Razz 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
View user's profile Send private message Send e-mail
Football
Master


Joined: 26 Dec 2008
Posts: 205
Location: Quakenet, #Football

PostPosted: Mon Mar 22, 2010 8:47 am    Post subject: Reply with quote

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


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Mon Mar 22, 2010 11:43 am    Post subject: Reply with quote

Seems to be one } missing at the end of devoice:user.
_________________
NML_375, idling at #eggdrop@IrcNET
Back to top
View user's profile Send private message
Football
Master


Joined: 26 Dec 2008
Posts: 205
Location: Quakenet, #Football

PostPosted: Mon Mar 22, 2010 12:33 pm    Post subject: Reply with quote

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
View user's profile Send private message
raider2k
Op


Joined: 01 Jan 2008
Posts: 140

PostPosted: Mon Mar 22, 2010 12:39 pm    Post subject: Reply with quote

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
View user's profile Send private message
Football
Master


Joined: 26 Dec 2008
Posts: 205
Location: Quakenet, #Football

PostPosted: Mon Mar 22, 2010 1:28 pm    Post subject: Reply with quote

Works, Thank you very much!
_________________
Idling at #Football, Quakenet.
Back to top
View user's profile Send private message
Luminous
Op


Joined: 12 Feb 2010
Posts: 146

PostPosted: Mon Mar 22, 2010 7:40 pm    Post subject: Reply with quote

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


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Mon Mar 22, 2010 7:45 pm    Post subject: Reply with quote

@ 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
View user's profile Send private message
Luminous
Op


Joined: 12 Feb 2010
Posts: 146

PostPosted: Mon Mar 22, 2010 9:36 pm    Post subject: Reply with quote

Ah, right... I just wrote that out real quick upon discovering this thread, lol. Thanks. Smile
Back to top
View user's profile Send private message
Football
Master


Joined: 26 Dec 2008
Posts: 205
Location: Quakenet, #Football

PostPosted: Wed Mar 24, 2010 4:30 am    Post subject: Reply with quote

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


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Wed Mar 24, 2010 11:19 am    Post subject: Reply with quote

@ 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
View user's profile Send private message
Football
Master


Joined: 26 Dec 2008
Posts: 205
Location: Quakenet, #Football

PostPosted: Wed Mar 24, 2010 2:45 pm    Post subject: Reply with quote

can you show me an example of a proper modified one?
_________________
Idling at #Football, Quakenet.
Back to top
View user's profile Send private message
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