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.

timed unban not working

Help for those learning Tcl or writing their own scripts.
Post Reply
User avatar
heartbroken
Op
Posts: 110
Joined: Thu Jun 23, 2011 11:15 pm
Location: somewhere out there

timed unban not working

Post by heartbroken »

hi :)

i found a code and i edit somethings. but it has some problems like this code should be remove ban of user in a timed period. i set ban for chan-ignore and its been working nicely but when time comes for remove it that mode is not working..i tried different type of timing sets for remove that mode when timer finished but nope..

and i wanna ask you something how can we set user-nick in msg part i tried like : hi $nick welcome etc.. but $nick shows botnick :P

need your help ..thank you..

Code: Select all

#########################################################################

set canales "#muy-chan"

set badidents {
"1020*"
"1030*"
"1040*"
"2050*"
"1042*"
"1031*"
}

########################################################

set tiempoban 15

set noflagban "fmo|omf"

set mensaje "my first msg"
set mensaje1 "this is my second one*"
set mensaje2 "i'm still talking"

##########################################################
bind join - * join:bbadident

proc join:bbadident {nick host hand chan} {
 global botnick badidents canales noflagban tiempoban mensaje mensaje1 mensaje2
  if {(([lsearch -exact [string tolower $canales] [string tolower $chan]] != -1) || ($canales== "*")) && ($nick != $botnick)} {
    foreach bbadident [string tolower $badidents] {
     set badidban "*!*$bbadident*@*"
     set userident "[string trimleft [string tolower [lindex [split $host "@"] 0]] "~"]"
    if {[string match *$bbadident* [string tolower $userident]]} {
      if {([botisop $chan]) && (![isop $nick $chan]) && (![isvoice $nick $chan]) && (![matchattr $hand $noflagban $chan]) && ([onchan $nick $chan])} {
	  putquick "MODE $chan +b ~q:$badidban"
	  putserv "NOTICE $nick :$mensaje"
	  putserv "NOTICE $nick :$mensaje1"
          putserv "NOTICE $nick :$mensaje2"
        timer $tiempoban "pushmode $chan -b ~q:$badidban"
        return 0
        }
      }
    }
  }
}

putlog "-= Loaded: BadIdban.tcl By Chino_^ =-"

return


Life iS Just a dReaM oN tHE wAy to DeaTh
Post Reply