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.

Can some one changs this where it wite to

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
s
sdays
Halfop
Posts: 98
Joined: Sat Oct 21, 2006 4:46 am

Can some one changs this where it wite to

Post by sdays »

Can some one changs this where it wite to a txt file thx

Code: Select all

set bwhois(list) {
"meh"
"[censored]"
}

# .2. What bad channels should be banned?
set bwhois(chans) {#sus}

# .3. Specify the ban reason and the ban time (in minutes) for a bad realname:
set bwhois(br) {"changs realname thx!" 600}

# .4. Specify the ban reason and the ban time (in minutes) for a bad channel:
set bwhois(bc) {"Wrong channel boy!" 60}

# .4. Number of joins in seconds do a delayed whois.
set bwhois(flud) "5:3:10"

#
## ¤ Don't edit past here unless you know TCL! ¤
#

set bwhois(version) "0.1"
setudef flag badwhois

##
# ¤ binds

bind join * * badwhois:join
bind part - * badwhois:part
bind raw - 311 badwhois:check
bind raw - 319 badwhois:chans

##
# ¤ whois on join

proc badwhois:join {nick uhost hand chan} { 
  global bflud bwhois
  if {![channel get $chan badwhois] || [isbotnick $nick ] || [matchattr $hand f|f $chan]} {
    return
  } 
  if {![info exists bflud($chan)]} {
    set bflud($chan) 0
  }
  incr bflud($chan)
  utimer [lindex [set bla [split $bwhois(flud) ":"]] 1] [list incr bflud($chan) -1]
  if {$bflud($chan) >= [lindex $bla 0]} {
    puthelp "WHOIS $nick"
    } else {
    utimer [lindex $bla 2] [puthelp "WHOIS $nick"]
  }
  lappend bwhois(whois) "$nick:$chan:*!*@[lindex [split $uhost @] 1]"
}

##
# ¤ realname check

proc badwhois:check {from key txt} { 
  global bwhois
  if {![info exists bwhois(whois)]} {
    set bwhois(whois) ""
  }
  if {[isbotnick [set nick [lindex [split $txt] 1]]] || [validuser [nick2hand $nick]]} {
    return
  }
  set realname [stripcodes bcruag [string range [join [lrange [split $txt] 5 end]] 1 end]]
  foreach bla $bwhois(list) {
    if {[string match -nocase $bla $realname]} {
      set position [lsearch $bwhois(whois) "*:[set mask *!*@[lindex $txt 3]]*"]
      if {[botisop [set chan [lindex [set t [split [lindex $bwhois(whois) $position] :]] 1]]]} {
        putquick "KICK $chan $nick :[lindex $bwhois(br) 0]" -next
      }
      newchanban $chan $mask BadWhois [lindex $bwhois(br) 0] [lindex $bwhois(br) 1]
      set bwhois(whois) [lreplace $bwhois(whois) $position $position]
      break
    }
  }
}

##
# ¤ channels check

proc badwhois:chans {from key txt} { 
  global bwhois
  if {[isbotnick [set nick [lindex [split $txt] 1]]] || [validuser [nick2hand $nick]]} {
    return
  }
  if {[set position [lsearch $bwhois(whois) "*$nick:*"]] != -1} {
    foreach bla [lrange $txt 2 e] {
      if {[string match -nocase "*[string trimleft $bla ":@+"]*" $bwhois(chans)]} {
        if {[botisop [set chan [lindex [set t [split [lindex $bwhois(whois) $position] :]] 1]]]} {
          putquick "KICK $chan [lindex $t 0] :[lindex $bwhois(bc) 0]" -next
        }
        newchanban $chan [lindex $t 2] BadWhois [lindex $bwhois(bc) 0] [lindex $bwhois(bc) 1]
        set bwhois(whois) [lreplace $bwhois(whois) $position $position]
        break
      }
    }
  }
}

##
# ¤ array remove

proc badwhois:part {nick uhost hand chan msg} {
  global bflud
  if {[isbotnick $nick] && [string match -nocase "*$chan*" [array names bflud]]} {
    array unset bflud $chan
  }
}

putlog "badwhois v$bwhois(version) loaded.."
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Change what? what's wrong? write the specifics, don't expect us to inspect them.
s
sdays
Halfop
Posts: 98
Joined: Sat Oct 21, 2006 4:46 am

Post by sdays »

write to blacklist.db
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

write what? The names/hostmasks of people who got kicked?
s
sdays
Halfop
Posts: 98
Joined: Sat Oct 21, 2006 4:46 am

Post by sdays »

no i want the bans go to blacklist.txt
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

Code: Select all

# insert this (all except the lines noted for the particular procs)
# after the lines with 'newchanban'
  
# set your filename here:
set kblog "/path/to/filename.txt"

set klog [open $kblog a]

# this line goes in proc badwhois:check
puts $klog "[ctime [unixtime] New BadWhois:check Ban on $chan\: $mask"

# this line goes in proc badwhois:chans
puts $klog "[ctime [unixtime]] New BadWhois:chans Ban on $chan\: [lindex $t 2]"

catch [close $klog]
f
fayettemat
Voice
Posts: 27
Joined: Tue Jan 09, 2007 6:10 pm

Post by fayettemat »

# insert this (all except the lines noted for the particular procs)
# after the lines with 'newchanban'

# set your filename here:
set kblog "/path/to/filename.txt"
the /path/to/ is the full path not just /scripts or /files
:)
Post Reply