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 on specific nicks, both on join and nickchange

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
n
nsrafk
Halfop
Posts: 73
Joined: Fri May 11, 2007 12:25 am

voice on specific nicks, both on join and nickchange

Post by nsrafk »

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!
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

Here is the first part for auto-voice, which I understood clearly:

Code: Select all

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.
==================================
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Code: Select all

# 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
Last edited by Sir_Fz on Sat May 12, 2007 3:57 pm, edited 1 time in total.
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

Sir_Fz wrote:

Code: Select all

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.
==================================
n
nsrafk
Halfop
Posts: 73
Joined: Fri May 11, 2007 12:25 am

Post by nsrafk »

Sir_Fz thanks man, your script works just as i want it to!
Thanks a bunch!
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

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
n
nsrafk
Halfop
Posts: 73
Joined: Fri May 11, 2007 12:25 am

Post by nsrafk »

Code: Select all

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? :)
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Code: Select all

if {![string match -nocase tag|* $nn] && [isvoice $nn $chan]} {
did you change "tag" to your actual TAG in this line?
n
nsrafk
Halfop
Posts: 73
Joined: Fri May 11, 2007 12:25 am

Post by nsrafk »

Oh, no i didnt notice that :) Sorry. It works perfectly!
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

What about a 'botisop' check?
Once the game is over, the king and the pawn go back in the same box.
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

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.
==================================
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

If the bot is not opped, the command won't be sent to the server (pushmode features).
R
Randomircguy
Voice
Posts: 1
Joined: Sun May 11, 2008 11:51 am

Post by Randomircguy »

I can't make this work.. Help please! I paste it and change "TAG" but it still wont voice...
t
testebr
Halfop
Posts: 86
Joined: Thu Dec 01, 2005 12:22 pm

Post by testebr »

I can request two improvements?

1) Work with specific channels (.chanset #channel +tag);
2) Accept multi-tag config to auto voice/devoice.

Thanks.
Post Reply