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 

commands2.9.tcl

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases
View previous topic :: View next topic  
Author Message
pig
Voice


Joined: 08 Jul 2005
Posts: 4
Location: London

PostPosted: Fri Jul 15, 2005 9:42 am    Post subject: commands2.9.tcl Reply with quote

Any help would be most appreciated.

Can anyone tell me what part of this code i need to change and to what in order for the bot to ban a nick and its ident only instead of the whole host ban that it is currently doing?

"bankick" {
if {![check:auth $nick $hand]} { return 0 }
if {![botisop $chan]} {
puthelp "NOTICE $nick :$fzcom(logo): I'm not oped on $chan."
return 0
}
if {[lindex [split $arg] 1] == ""} {
puthelp "NOTICE $nick :$fzcom(logo): SYNTAX: $fzcom(trigger)bankick <nick1/ban1,nick2/ban1,..> \[reason\] \[bantime\]."
return 0
}
set knicks [split [lindex [split $arg] 1] ,]
if {[llength [lrange [split $arg] 2 end]] == 1} {
if {[string is integer [lindex [split $arg] end]]} {
set kreason "$fzcom(logo): Requested by $nick."
set btime "[lindex [split $arg] end]"
} else {
set kreason "$fzcom(logo): ($nick) [join [lrange [split $arg] 2 end]]"
set btime "$fzcom(btime)"
}
} elseif {[llength [lrange [split $arg] 2 end]] > 1} {
if {[string is integer [lindex [split $arg] end]]} {
set kreason "$fzcom(logo): ($nick) [join [lrange [split $arg] 2 end-1]]"
set btime "[lindex [split $arg] end]"
} else {
set kreason "$fzcom(logo): ($nick) [join [lrange [split $arg] 2 end]]"
set btime "$fzcom(btime)"
}
} else {
set kreason "$fzcom(logo): Requested by $nick."
set btime "$fzcom(btime)"
}
foreach knick $knicks {
if {[string match -nocase *!*@* $knick]} {
if {![string match -nocase $knick $botname]} {
foreach kuser [chanlist $chan] {
if {[string match -nocase $knick $kuser![getchanhost $kuser $chan]]} {
if {![matchattr [nick2hand $kuser] mo|mo $chan]} {
pushmode $chan +b $knick
putquick "KICK $chan $kuser :$kreason"
lappend thebanked($knick) $kuser
} {
puthelp "NOTICE $nick :$fzcom(logo): I will not bankick a master/owner ($kuser matching $knick)"
}
}
}
if {![info exists thebanked]} {
puthelp "NOTICE $nick :$fzcom(logo): There are no nicks matching $knick on $chan."
} {
if {[lsearch -exact [array names thebanked] $knick] == -1} {
puthelp "NOTICE $nick :$fzcom(logo): There are no nicks matching $knick on $chan."
}
}
flushmode $chan
} {
puthelp "NOTICE $nick :$fzcom(logo): Can't outsmart me, I will not bankick myself"
}
} {
if {[onchan $knick $chan]} {
if {![isbotnick $knick] && ![matchattr [nick2hand $knick] mo|mo $chan]} {
pushmode $chan +b "*!*@[scan [getchanhost $knick $chan] %*\[^@\]@%s]"
putquick "KICK $chan $knick :$kreason"
timer $btime [list pushmode $chan -b "*!*@[scan [getchanhost $knick $chan] %*\[^@\]@%s]"]
lappend bankicked $knick
} else {
puthelp "NOTICE $nick :$fzcom(logo): Can't outsmart me, no bankicking a master."
}
} else {
puthelp "NOTICE $nick :$fzcom(logo): $knick is not on $chan."
}
}
}
if {[info exists bankicked]} {
foreach wrbankicked [wordwrap [join $bankicked ,] 70 ,] {
puthelp "NOTICE $nick :$fzcom(logo): Bankicked $wrbankicked from $chan."
}
}
if {[array exists thebanked]} {
foreach banked [array names thebanked] {
foreach wrbanked [wordwrap [join $thebanked($banked) ,] 70 ,] {
puthelp "NOTICE $nick :$fzcom(logo): Bankicked $wrbanked matching $banked on $chan."
}
}
}
flushmode $chan
return 0
}
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Fri Jul 15, 2005 9:54 am    Post subject: Reply with quote

Download version 3.0. You can choose what bantype to ban in this version. It should be in the tcl archive soon.
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
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: Sat Jul 16, 2005 6:51 am    Post subject: Reply with quote

By the way if you still want todo it, you will need to replace:

Code:

#this:
pushmode $chan +b "*!*@[scan [getchanhost $knick $chan] %*\[^@\]@%s]"

#with this:
pushmode $chan +b "$knick![lindex [split [getchanhost $knick $chan] @] 0]@*"

_________________
·­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
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases 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