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

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


Joined: 11 May 2007
Posts: 73

PostPosted: Fri May 11, 2007 12:29 am    Post subject: voice on specific nicks, both on join and nickchange Reply with quote

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


Joined: 26 Apr 2004
Posts: 1580
Location: Switzerland

PostPosted: Fri May 11, 2007 8:53 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Fri May 11, 2007 10:30 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
awyeah
Revered One


Joined: 26 Apr 2004
Posts: 1580
Location: Switzerland

PostPosted: Fri May 11, 2007 11:11 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
nsrafk
Halfop


Joined: 11 May 2007
Posts: 73

PostPosted: Fri May 11, 2007 12:09 pm    Post subject: Reply with quote

Sir_Fz thanks man, your script works just as i want it to!
Thanks a bunch!
Back to top
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Fri May 11, 2007 1:30 pm    Post subject: Reply with quote

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


Joined: 11 May 2007
Posts: 73

PostPosted: Sat May 12, 2007 2:04 pm    Post subject: Reply with quote

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? Smile
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sat May 12, 2007 3:38 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
nsrafk
Halfop


Joined: 11 May 2007
Posts: 73

PostPosted: Sat May 12, 2007 3:47 pm    Post subject: Reply with quote

Oh, no i didnt notice that Smile Sorry. It works perfectly!
Back to top
View user's profile Send private message
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3741
Location: Mint Factory

PostPosted: Sat May 12, 2007 4:09 pm    Post subject: Reply with quote

What about a 'botisop' check?
_________________
Once the game is over, the king and the pawn go back in the same box.
Back to top
View user's profile Send private message
awyeah
Revered One


Joined: 26 Apr 2004
Posts: 1580
Location: Switzerland

PostPosted: Sun May 13, 2007 7:19 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sun May 13, 2007 8:17 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Randomircguy
Voice


Joined: 11 May 2008
Posts: 1

PostPosted: Sun May 11, 2008 11:58 am    Post subject: Reply with quote

I can't make this work.. Help please! I paste it and change "TAG" but it still wont voice...
Back to top
View user's profile Send private message
testebr
Halfop


Joined: 01 Dec 2005
Posts: 86

PostPosted: Wed Apr 01, 2009 6:22 pm    Post subject: Reply with quote

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