bind mode (servermode on split rejoin)

Help for those learning Tcl or writing their own scripts.
Post Reply
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

bind mode (servermode on split rejoin)

Post by awyeah »

Just wondering..

Code: Select all

proc mass:op:chan {nick uhost hand chan mode arg} {
 global botnick moptrigger opflood kickno
when a split rejoins, and a bind mode proc is called and assumingly the server sets restores some channel modes as they were before the split, some +o/-o +v/-v +b/-b etc, the value on that proc $nick would be what?

Since a nick does not exist with the servers name then?? would it be null? Meaning ""? and what about the $uhost? I suppose *!*@* if not then? Just wanted to clarify on this.

The rest $chan, $mode and $arg should be fine, was just confused about $nick, $uhost and $hand if the server is taken as a nick.

Should we check for [string match *.* $nick] if we want to detect a servermode??

Thanks,
JD
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
B
BoaR
Halfop
Posts: 48
Joined: Fri Jul 20, 2007 1:36 am

Post by BoaR »

bind rejn - {*} [namespace current]::modes
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

Thanks, but my idea was a bit different. My bind mode fires on, servermode sometimes. The script basically checks for people mass opping/voicing users and so it kicks the person who set the mass chan modes and bans that persons *!*@host.domain.com

So when a server does the same thing on split rejoin, the script cannot kick, because there is no such nick, as it is a server, but it places the ban *!*@*. So I was wondering, maybe the nick and uhost args are null.

Anyway, will just have to wait for another one on DALnet. You can find them often on DALnet hehe. :P

IMHO bind rejoin is only useful when we are dealing with users joining from a split, and not concerned about the server modes which the server sets after the rejoin is successful.
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
B
BoaR
Halfop
Posts: 48
Joined: Fri Jul 20, 2007 1:36 am

Post by BoaR »

ah ok.
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

JFYI, on a server rejoin (rejoin from split) on DALnet, I logged this from my bot recently:
For a normal bind mode proc:

Mass op: ($nick) ($uhost) ($hand) ($chan) ($mode) ($target)
=> Mass op: () (tranquility.hub.dal.net) (*) (#awyeah) (+o) (Lucifer)
Meaning the "nick" is considered null (empty), while the "uhost" is the name of the server.
·­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 »

MODE (stackable)
bind mode <flags> <mask> <proc>
proc-name <nick> <user@host> <handle> <channel> <mode-change> <target>

Description: mode changes are broken down into their component
parts before being sent here, so the <mode-change> will always
be a single mode, such as "+m" or "-o". target will show the
argument of the mode change (for o/v/b/e/I) or "" if the set
mode does not take an argument. The bot's automatic response
to a mode change will happen AFTER all matching Tcl procs are
called. The mask will be matched against '#channel +/-modes'
and can contain wildcards.

If it is a server mode, nick will be "", user@host is the server
name, and handle is *.
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

Thanks heh, got that already. Just wasn't clearly explained in the bind mode help.
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
Post Reply