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.

ban msg problem

Help for those learning Tcl or writing their own scripts.
Post Reply
.
.pt
Halfop
Posts: 71
Joined: Wed Nov 16, 2005 10:14 am

ban msg problem

Post by .pt »

Code: Select all

"b" {
   if {![check:auth $nick $hand]} { return 0 }
   if {[lindex [split $arg] 1] == ""} {
    puthelp "NOTICE $nick :SYNTAX: $fzcom(trigger)b <nick1/ban1,nick2/ban2,..> \[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 "Requested by $nick."
     set btime "[lindex [split $arg] end]"
    } else {
     set kreason "($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 "($nick) [join [lrange [split $arg] 2 end-1]]"
     set btime "[lindex [split $arg] end]"
    } else {
     set kreason "($nick) [join [lrange [split $arg] 2 end]]"
     set btime "$fzcom(btime)"
    }
   } else {
    set kreason "Requested by $nick."
    set btime "$fzcom(btime)"
   }
   foreach knick $knicks {
    if {[string match -nocase *!*@* $knick]} {
     if {![string match -nocase $knick $botname]} {
      newchanban $chan $knick $nick "$kreason" $btime
      lappend ibanned $knick
     } else {
      puthelp "NOTICE $nick :Can't outsmart me, I won't ban myself."
     }
    } else {
     if {![isbotnick $knick] && ![matchattr [nick2hand $knick] mo|mo $chan]} {
      if {[onchan $knick $chan]} {
       newchanban $chan [set bmask [cmdbtype $knick![getchanhost $knick $chan] $fzcom(btype)]] $nick "$kreason" $btime
       lappend ibanned "$knick ($bmask)"
      } else {
       puthelp "NOTICE $nick :$knick is not on $chan."
      }
     } else {
      puthelp "NOTICE $nick :Can't outsmart me, no banning a master."
     }
    }
   }
   if {[info exists ibanned]} {
    foreach wribanned [wordwrap [join $ibanned ,] 70 ,] {
     puthelp "NOTICE $nick :Added $wribanned to my $chan banlist."
    }
    flushmode $chan
   }
   return 0
  }
---------------------------------------------------------------------------------------
when i do .b nick msg time or .b nick msg the kick reason its always the ban time instead of the msg i put on it
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

That's a rip of my fzcommands.tcl, use the original one.
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

@ .pt

Use code tags in future when posting code.
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
Post Reply