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 

Set or remove "Silence"

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


Joined: 11 Jun 2004
Posts: 38
Location: Trois-Rivières, Canada

PostPosted: Mon Mar 24, 2008 8:01 am    Post subject: Set or remove "Silence" Reply with quote

Our eggdrop is permanently under Silence. What I am looking for is a snippet which would remove "Silence" when a said nick parts a particular channel or quits and set "Silence" when the said nick gets ops on that particular channel.

Tx in advance
Back to top
View user's profile Send private message
DragnLord
Owner


Joined: 24 Jan 2004
Posts: 711
Location: C'ville, Virginia, USA

PostPosted: Mon Mar 24, 2008 11:07 am    Post subject: Reply with quote

Since not all IRCds have a "silence" command, you may need to provide the command syntax.
Back to top
View user's profile Send private message
gemeau50
Voice


Joined: 11 Jun 2004
Posts: 38
Location: Trois-Rivières, Canada

PostPosted: Mon Mar 24, 2008 11:26 am    Post subject: Reply with quote

Network: Undernet
Set: /silence *.*@*
Remove /silence -*.*@*
Back to top
View user's profile Send private message
DragnLord
Owner


Joined: 24 Jan 2004
Posts: 711
Location: C'ville, Virginia, USA

PostPosted: Mon Mar 24, 2008 11:51 am    Post subject: Reply with quote

I haven't tested this, but it should give you a good starting point if nothing else.

Code:
# can contain wildcards such as nick*!*@*, but has to be in nick!user@host format
set swho "nick!*@*"

bind join - $swho silence_join
bind part - $swho silence_part

proc silence_join {n u h c} {putquick "SILENCE *.*@*"}
proc silence_part {n u h c} {putquick "SILENCE -*.*@*"}
Back to top
View user's profile Send private message
gemeau50
Voice


Joined: 11 Jun 2004
Posts: 38
Location: Trois-Rivières, Canada

PostPosted: Wed Mar 26, 2008 8:08 am    Post subject: Reply with quote

Since "PART" is to leave a channel and "QUIT" is to leave a network, do /part and /quit the same in TCL or do I have to bind QUIT also?

Also your join and part procedure do not provide for a specific channel.
Back to top
View user's profile Send private message
user
 


Joined: 18 Mar 2003
Posts: 1452
Location: Norway

PostPosted: Wed Mar 26, 2008 8:48 am    Post subject: Reply with quote

gemeau50 wrote:
Since "PART" is to leave a channel and "QUIT" is to leave a network, do /part and /quit the same in TCL or do I have to bind QUIT also?

Also your join and part procedure do not provide for a specific channel.


doc/tcl-commands.doc wrote:
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.


bind part <flags> <mask> <proc>

procname <nick> <user@host> <handle> <channel> <msg>

Description: triggered by someone leaving the channel. The mask is
matched against "#channel nick!user@host" and can contain
wildcards.


bind sign <flags> <mask> <proc>

procname <nick> <user@host> <handle> <channel> <reason>

Description: triggered by a signoff, or possibly by someone who got
netsplit and never returned. The signoff message is the last
argument to the proc. Wildcards can be used in the mask, which is
matched against '#channel nick!user@host'.

As the channel name is part of the string matched against the mask, you HAVE to include a part to match it (starting the mask with a nick would make it never match)
The sign bind can trigger your part proc because they pass the same number of arguments. You might also want to include splt and rejn binds (if your wait-split setting is > 0)
_________________
Have you ever read "The Manual"?
Back to top
View user's profile Send private message
gemeau50
Voice


Joined: 11 Jun 2004
Posts: 38
Location: Trois-Rivières, Canada

PostPosted: Thu Mar 27, 2008 8:46 am    Post subject: Reply with quote

Rather than trying to explain to you what I'm looking for, let me give it to you in mIRC script. I'm hoping the someone will be kind enough to convert it in TCL.

Code:
on *:join:channelname: { if ($address == cservice@undernet.org) { silence *!*@* } }
on *:part:channelname: { if ($address == cservice@undernet.org) { silence -*!*@* } }
on *:quit: { if ($address == cservice@undernet.org) { -silence *!*@* } }

TX
Back to top
View user's profile Send private message
user
 


Joined: 18 Mar 2003
Posts: 1452
Location: Norway

PostPosted: Thu Mar 27, 2008 10:02 am    Post subject: Reply with quote

I don't know mIRC script, but I guess you want something like this...
Code:
bind join - "#chan *!cservice@undernet.org" {silence +}
bind part - "#chan *!cservice@undernet.org" {silence -}
bind sign - "#chan *!cservice@undernet.org" {silence -}

proc silence {prefix args} {putserv "SILENCE $prefix*!*@*"}

_________________
Have you ever read "The Manual"?
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Thu Mar 27, 2008 10:02 am    Post subject: Reply with quote

Code:
# can contain wildcards such as nick*!*@*, but has to be in
# nick!user@host format
set swho *!cservice@undernet.org

bind join - "#channelname $swho" silence:control
bind part - "#channelname $swho" silence:control
bind sign - "#channelname $swho" silence:control

proc silence:control {n u h c args} {
 if {[llength $args]} {
  putserv "SILENCE -*!*@*"
 } {
  putserv "SILENCE *!*@*"
 }
}


Edit: user was faster Wink
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
DragnLord
Owner


Joined: 24 Jan 2004
Posts: 711
Location: C'ville, Virginia, USA

PostPosted: Thu Mar 27, 2008 11:45 am    Post subject: Reply with quote

gemeau50 wrote:
Also your join and part procedure do not provide for a specific channel.

You failed to provide that information.
Back to top
View user's profile Send private message
user
 


Joined: 18 Mar 2003
Posts: 1452
Location: Norway

PostPosted: Thu Mar 27, 2008 4:43 pm    Post subject: Re: Set or remove "Silence" Reply with quote

gemeau50 wrote:
... when a said nick parts a particular channel ...

Wink
_________________
Have you ever read "The Manual"?
Back to top
View user's profile Send private message
DragnLord
Owner


Joined: 24 Jan 2004
Posts: 711
Location: C'ville, Virginia, USA

PostPosted: Thu Mar 27, 2008 11:29 pm    Post subject: Reply with quote

DragnLord wrote:
I haven't tested this, but it should give you a good starting point if nothing else.
Wink
Back to top
View user's profile Send private message
gemeau50
Voice


Joined: 11 Jun 2004
Posts: 38
Location: Trois-Rivières, Canada

PostPosted: Fri Mar 28, 2008 2:52 pm    Post subject: Reply with quote

Tx! It does what I wanted the bot to do.

Regards
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