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.

help with ban

Help for those learning Tcl or writing their own scripts.
Post Reply
User avatar
dusk
Halfop
Posts: 91
Joined: Sun Mar 06, 2005 7:25 pm
Location: Belgium

help with ban

Post by dusk »

I'm using a public kickban command but yesterday I noticed something goes wrong...

Code: Select all

(01:54) Join: tripke (triplelion@d54C1F0D0.access.telenet.be) has join
(01:54) <@reef> !kb tripke
(01:54) * Doogie sets mode: +b *!*triplelio@d54C1F0D0.access.telenet.be
(01:54) Kick: tripke was kicked by Doogie (banned) on #chan
(01:54) Join: tripke (triplelion@d54C1F0D0.access.telenet.be) has join
As you can see the bot doesn't set the correct ban (missing n after triplelio)
This is the proc I'm working with :

Code: Select all

proc kickban {nik uhost hand chn txt} {
global botnick
set nick [lindex $txt 0]
set reas [lrange $txt 1 end]
set target [getchanhost $nick $chn]
set banmask "*!*[string trimleft [string range $target [string first "!" $target] end] ?^~-_+?]"
if {[string tolower $nick] != [string tolower $botnick]} {
if {![string length [string trim $reas]]} {
   set reas "banned by \[${hand}/\002${nik}\002] - Geen reden opgegeven..."} else {
   set reas "banned by \[${hand}/\002${nik}\002] - $reas"}
   
putserv "mode $chn +b $banmask"
putserv "kick $chn $nick $reas"
}
}
If someone could take a look please :$


GRTZ
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

Try:

Code: Select all

set target_uhost [getchanhost $nick]
set banmask *!*[lindex [split [maskhost $target_uhost] "!"] 1]
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
Post Reply