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.

need help with whyonnotice tcl

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
j
jurist111
Voice
Posts: 20
Joined: Thu Aug 26, 2010 8:36 am
Location: pakistan

need help with whyonnotice tcl

Post by jurist111 »

hii this tcl gives msg in pvt tht why a nick is op i want tht it gives in channel or on notice..thanks
# Welcome to JuRiSt Tcl World
# Just Upload in your Bot This tcl will notice in channel when some one get op

# JuRiSt Why On Notice TCL
putlog "Why On Notice TCL - "

set vWhyServ "chanserv@services.dal.net"
set vWhyTime 10

bind MODE - "% +o" pWhySend
bind NOTC - * pWhyReceive

proc pWhyCancel {} {
global vWhyChan vWhyNick
foreach item [utimers] {
if {[string equal pWhyTimeout [lindex $item 1]]} {
killutimer [lindex $item 2]
}
}
if {[info exists vWhyNick]} {unset vWhyNick}
if {[info exists vWhyChan]} {unset vWhyChan}
return 0
}

proc pWhyReceive {nick uhost hand text dest} {
global vWhyNick vWhyChan vWhyServ
if {![regexp {^#} $dest]} {
if {[string equal -nocase $nick [lindex [split $vWhyServ @] 0]]} {
if {[info exists vWhyNick]} {
set response [stripcodes bcruag $text]
if {[string match -nocase *${vWhyNick}* [join [lrange [split $response] 0 2]]]} {
putserv "NOTICE @$vWhyChan :$response"
pWhyCancel
}
}
}
}
return 0
}

proc pWhySend {nick uhost hand chan mode target} {
global vWhyServ vWhyNick vWhyChan vWhyTime
if {[string equal -nocase $nick [lindex [split $vWhyServ @] 0]]} {
set vWhyNick $target
set vWhyChan $chan
putserv "PRIVMSG $vWhyServ :WHY $vWhyChan $vWhyNick"
utimer $vWhyTime pWhyTimeout
}
return 0
}

proc pWhyTimeout {} {
global vWhyNick vWhyChan
putserv "PRIVMSG @$vWhyChan :a /WHY command for $vWhyNick timed out without response or maybe someone del my access. i cannot send you any info with out @op"
pWhyCancel
return 0
}

# eof
JuRiSt
Post Reply