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.

CS auto why

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
y
yanny
Voice
Posts: 2
Joined: Thu Aug 20, 2009 2:02 am

CS auto why

Post by yanny »

hi i would like to request for tcl script that would automatically do /cs why #channel nick when someone is opped and would notice to the channel ops immediately.. thanks i badly need this script to know whos access are they using.. i hope someone will make it for me
User avatar
arfer
Master
Posts: 436
Joined: Fri Nov 26, 2004 8:45 pm
Location: Manchester, UK

Post by arfer »

The response to a /WHO command may differ depending on the ircd services module, so, whilst I have tested this on DALnet, I can't guarantee it will work as expected elsewhere.

Code: Select all

# why.tcl
# find out why users are op'd by chanserv services and onotice channel

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"
    pWhyCancel
    return 0
}

# eof
Last edited by arfer on Wed Aug 26, 2009 12:42 pm, edited 1 time in total.
I must have had nothing to do
y
yanny
Voice
Posts: 2
Joined: Thu Aug 20, 2009 2:02 am

Post by yanny »

it is working perfectly fine... u are terrific!! thank you!!
User avatar
Thanhas
Op
Posts: 124
Joined: Sat Sep 02, 2006 11:14 am
Location: Ottawa, Canada

Post by Thanhas »

Hello,
i apprecaite the codes of arfer.
i have one request in it?
can you add last mask in it? i me it tells that the Op was Joined with those nicks and masks past one week.
for e.g
arfer was seen with arfer1 (arfe@your.rock.ever) arfr2 (arfer@Long.live.bratish) being as op Past one week :)

hope its pssible...
User avatar
arfer
Master
Posts: 436
Joined: Fri Nov 26, 2004 8:45 pm
Location: Manchester, UK

Post by arfer »

That information is not returned with a /WHY request (not on the network I use anyway)
I must have had nothing to do
User avatar
Thanhas
Op
Posts: 124
Joined: Sat Sep 02, 2006 11:14 am
Location: Ottawa, Canada

Post by Thanhas »

arfer wrote:That information is not returned with a /WHY request (not on the network I use anyway)
But i have seen this on some channel so i request here...
Give a try if you could ?
User avatar
devilsoulblack
Halfop
Posts: 62
Joined: Wed Nov 19, 2003 9:18 pm
Location: Chile
Contact:

Post by devilsoulblack »

@arfer : thanks for sharing
---------
Add [SOLVED] to the thread title if your issue has been.
Search - FAQ
User avatar
4mirc
Voice
Posts: 37
Joined: Fri May 16, 2008 11:11 pm
Contact:

Post by 4mirc »

hello all

its wonderfull script but can any one add code

to make the code work in chans i want not all chans the bot in?

thanks for all
Post Reply