| View previous topic :: View next topic |
| Author |
Message |
nsrafk Halfop
Joined: 11 May 2007 Posts: 73
|
Posted: Fri May 11, 2007 12:29 am Post subject: voice on specific nicks, both on join and nickchange |
|
|
Hi all.
First post here. I need a script which will voice people who joins a specific channel with a specific nick. Ill make example:
TAG|User joins #somechannel
Eggie gives +v to him.
Now, if he changes nick to User, the eggie should now devoice him.
The same thing goes if:
User joins #somechannel
- nothing happens
User changes nick to TAG|User
Eggie gives +v
--- And again, eggie should devoice if User changes nick to something without TAG.
Is this possible? And yes, ive tried to search tcl archive, but dunno what im searching for :/
Thanks in advance! |
|
| Back to top |
|
 |
awyeah Revered One

Joined: 26 Apr 2004 Posts: 1580 Location: Switzerland
|
Posted: Fri May 11, 2007 8:53 am Post subject: |
|
|
Here is the first part for auto-voice, which I understood clearly:
| Code: |
set voicenicks {
"nick1"
"nick2"
}
set voicechan "#mychan"
bind join - "*" voice:nicks
proc voice:nicks {nick uhost hand chan} {
global voicenicks voicechan
if {[string equal -nocase $voicechan $chan]} {
foreach user $voicenicks {
if {[string equal -nocase $user $nick]} {
putserv "MODE $chan +v $nick"; break
}
}
}
}
|
_________________ ·awyeah·
==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
================================== |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Fri May 11, 2007 10:30 am Post subject: |
|
|
| Code: | # Edit 'TAG' to your desired tag
bind join - {% TAG|*} voice:user
bind nick - {% TAG|*} 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
}
}
# Also edit 'tag' here to your desired tag
proc devoice:user {nick uhost hand chan nn} {
if {![string match -nocase tag|* $nn] && [isvoice $nn $chan]} {
pushmode $chan -v $nn
}
} |
Edit: Added comments indicating where to edit tags _________________ Follow me on GitHub
- Opposing
Public Tcl scripts
Last edited by Sir_Fz on Sat May 12, 2007 3:57 pm; edited 1 time in total |
|
| Back to top |
|
 |
awyeah Revered One

Joined: 26 Apr 2004 Posts: 1580 Location: Switzerland
|
Posted: Fri May 11, 2007 11:11 am Post subject: |
|
|
| Sir_Fz wrote: | | Code: | bind join - {% TAG|*} voice:user
bind nick - {% TAG|*} 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 tag|* $nn] && [isvoice $nn $chan]} {
pushmode $chan -v $nn
}
} |
|
I don't think bind join will work, since the proc for bind join should only have 4 parameters, nick, uhost, hand and chan.. whereas this one has 5 which is nn. _________________ ·awyeah·
==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
================================== |
|
| Back to top |
|
 |
nsrafk Halfop
Joined: 11 May 2007 Posts: 73
|
Posted: Fri May 11, 2007 12:09 pm Post subject: |
|
|
Sir_Fz thanks man, your script works just as i want it to!
Thanks a bunch! |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Fri May 11, 2007 1:30 pm Post subject: |
|
|
| awyeah wrote: |
...
I don't think bind join will work, since the proc for bind join should only have 4 parameters, nick, uhost, hand and chan.. whereas this one has 5 which is nn. |
I believe you failed to notice that the last argument has a default-value, allowing the proc to handle 4 or 5 arguments.
I suppose the same effect could be achieved using args and "lindex $args end", although Sir_Fz's way works equally well... _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
nsrafk Halfop
Joined: 11 May 2007 Posts: 73
|
Posted: Sat May 12, 2007 2:04 pm Post subject: |
|
|
| Code: | bind join - {% TAG|*} voice:user
bind nick - {% TAG|*} 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 tag|* $nn] && [isvoice $nn $chan]} {
pushmode $chan -v $nn
}
} |
This works great, theres just one problem:
If nick TAG|bla changes nick to TAG|test then the script will devoice him. Any suggestions?  |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Sat May 12, 2007 3:38 pm Post subject: |
|
|
| Code: | | if {![string match -nocase tag|* $nn] && [isvoice $nn $chan]} { |
did you change "tag" to your actual TAG in this line? _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
nsrafk Halfop
Joined: 11 May 2007 Posts: 73
|
Posted: Sat May 12, 2007 3:47 pm Post subject: |
|
|
Oh, no i didnt notice that Sorry. It works perfectly! |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Sat May 12, 2007 4:09 pm Post subject: |
|
|
What about a 'botisop' check? _________________ Once the game is over, the king and the pawn go back in the same box. |
|
| Back to top |
|
 |
awyeah Revered One

Joined: 26 Apr 2004 Posts: 1580 Location: Switzerland
|
Posted: Sun May 13, 2007 7:19 am Post subject: |
|
|
You don't normally need botisop for these type of scripts executing just simple mode change commands. If the bot is not opped, it will not give an error for the script in the partyline and will not change the channel mode +v/-v, but will continue to execute the script further onwards.
The bot will however send a request to the server for mode change, but due to the non-op status, server/client will return not-opped status. _________________ ·awyeah·
==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
================================== |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Sun May 13, 2007 8:17 am Post subject: |
|
|
If the bot is not opped, the command won't be sent to the server (pushmode features). _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
Randomircguy Voice
Joined: 11 May 2008 Posts: 1
|
Posted: Sun May 11, 2008 11:58 am Post subject: |
|
|
| I can't make this work.. Help please! I paste it and change "TAG" but it still wont voice... |
|
| Back to top |
|
 |
testebr Halfop
Joined: 01 Dec 2005 Posts: 86
|
Posted: Wed Apr 01, 2009 6:22 pm Post subject: |
|
|
I can request two improvements?
1) Work with specific channels (.chanset #channel +tag);
2) Accept multi-tag config to auto voice/devoice.
Thanks. |
|
| Back to top |
|
 |
|