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.

change function for TCL script

Old posts that have not been replied to for several years.
Locked
x
xGame
Voice
Posts: 24
Joined: Wed Aug 06, 2003 4:55 pm

change function for TCL script

Post by xGame »

Hi Guys :
i want change this code to : if some Offender make masskick in channel when bot Aop i want bot make "chanserv :why $chan $nick" after that identify to Sop nickname and del nickname from channel Aop list . Network is dalnet .
thanx all

exmp for masskick on DALnet :

* HiLaLiX was kicked by ChanServ (Masskick from HiLaLiX!zzqvoi@212.62.96.45)
* K7LH was kicked by ChanServ (Masskick from HiLaLiX!zzqvoi@212.62.96.45)

Code: Select all

# Full name of channel services 
set chanserv "chanserv@Services.dal.net" 

# Channel *not* to function in 
set nogo "#channelname" 

bind kick - * kick:remove 
bind notc - "* has AOp access to *" check:verify 

proc kick:remove {nick uhost hand chan targ rsn} { 
if {$targ == $::botnick} { 
if {![string match $chan $::nogo]} { 
putserv "PRIVMSG $::chanserv :why $chan $nick" 
} 
} 
} 

proc check:verify {nick host hand arg {dest ""}} { 
set arg [ctrl:filter $arg] 
if {[string equal $dest $::botnick]} { 
set offender [lindex [split $arg] 0] 
set chan [string trim [lindex [split $arg] 5] .] 
set opnick [string trim [lindex [split $arg] end] .] 
set thehand [findhand $offender [getchanhost $offender]] 
if {$offender != "" && $thehand != "*"} { 
deluser $thehand 
} 
putquick "PRIVMSG $::chanserv :aop $chan del $opnick" 
putquick "MODE $chan -o $offender" 
putkick $chan $offender "You tit head, you just lost access!" 
} 
} 

# ctrl:filter <string> 
# Strip all control characters. Thanks to Ppslim.  

proc ctrl:filter {str} { 
regsub -all -- {\003[0-9]{0,2}(,[0-9]{0,2})?|\017|\037|\002|\026|\006|\007} $str "" str 
return $str 
} 

# findhand - tries to find a handle 

proc findhand {nick host} { 
if {[validuser $nick]} { 
return $nick 
} else { 
set thehand [nick2hand $nick] 
if {[validuser $thehand]} { 
return $thehand 
} 

set thehand [finduser $host] 
return $thehand 
} 
} 

### End ### 
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

this should work:

Code: Select all

# Full name of channel services 
set chanserv "chanserv@Services.dal.net" 

# Channel *not* to function in 
set nogo "#channelname" 

bind kick - * kick:remove 
bind notc - "* Identification to the nickname *" check:verify 

proc kick:remove {nick uhost hand chan targ rsn} { 
if {$targ == $::botnick && [string match [split $rsn] "*Masskick*"]} { 
if {![string match $chan $::nogo]} { 
putserv "PRIVMSG $::chanserv :why $chan [lindex [split [lindex [split $rsn] 2] "!"] 0]" 
} 
} 
} 

proc check:verify {nick host hand arg {dest ""}} { 
set arg [ctrl:filter $arg] 
if {[string equal $dest $::botnick]} { 
set offender [lindex [split $arg] 0] 
set aop [lindex [split $arg] 2]
set chan [string trim [lindex [split $arg] 5] .] 
set opnick [string trim [lindex [split $arg] end] .] 
set thehand [findhand $offender [getchanhost $offender]] 
if {$offender != "" && $thehand != "*"} { 
deluser $thehand 
} 
putquick "PRIVMSG $::chanserv :$aop $chan del $opnick" 
putquick "MODE $chan -o $offender" 
putkick $chan $offender "You tit head, you just lost access!" 
} 
} 

# ctrl:filter <string> 
# Strip all control characters. Thanks to Ppslim.  

proc ctrl:filter {str} { 
regsub -all -- {\003[0-9]{0,2}(,[0-9]{0,2})?|\017|\037|\002|\026|\006|\007} $str "" str 
return $str 
} 

# findhand - tries to find a handle 

proc findhand {nick host} { 
if {[validuser $nick]} { 
return $nick 
} else { 
set thehand [nick2hand $nick] 
if {[validuser $thehand]} { 
return $thehand 
} 

set thehand [finduser $host] 
return $thehand 
} 
} 

### End ###
x
xGame
Voice
Posts: 24
Joined: Wed Aug 06, 2003 4:55 pm

Post by xGame »

Sir_Fz
thanx bro , but when bot sop the aop con't make Masskick , must bot Aop when bot see MassKick in channel it will make "chanserv :why $chan $nick" after he get Offender will identify itself to (putserv "NickServ :identify SopNick Passwd") after that will del Offender from Aop's channel list .
thanx anyway :oops:
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

well same thing, if mkick happened then it means your bot is aop, thus you make it identify, and create another notc bind to see if the bot identified then do the why...
Locked