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.

Checkchan (need help displaying Elapsed Time)

Old posts that have not been replied to for several years.
Locked
User avatar
dotslasher
Halfop
Posts: 62
Joined: Sun Aug 10, 2003 8:10 pm

Checkchan (need help displaying Elapsed Time)

Post by dotslasher »

Code: Select all

# Time elapsed to expire each entry, in seconds. If the nick left more than
# $dun_rejoin(time) it is assumed he/she is not going back and forth
set dun_rejoin(time) 1200

# This will hold the info : host time_of_parting old_nick channel_parted
set dun_rejoin(nicks) ""

bind join - * dun:rejoin:check

proc dun:rejoin:check {nick uhost hand channel} {
    global dun_rejoin

# Check if the nick joined a channel of interest
    set found ""
    set chans [string tolower $dun_rejoin(chans)]
    if {$chans == "*"} {set chans [string tolower [channels]]}
    foreach j $chans {
        if {[string tolower $channel] == $j} {
            set found $j
            break
        }
    }

    if {$found == ""} {return 0}

# Check if the host has been seen already
    set found -1
    set host  [lindex [split $uhost "@"] 1]

    for {set j 0} {$j < [llength $dun_rejoin(nicks)]} {incr j 4} {
        if {$host == [lindex $dun_rejoin(nicks) $j] && [string tolower $channel] == [lindex $dun_rejoin(nicks) [expr $j+3]]} {set found $j}
    }

    if {$found == -1} {
        dun:rejoin:clean
        return 0
    } else {
        set previous [lindex $dun_rejoin(nicks) [expr $found+1]]
        set poopie [incr [expr $dun_rejoin(time)+[unixtime]] -$previous]
        if {$previous > [expr $dun_rejoin(time)+[unixtime]] || $nick == [lindex $dun_rejoin(nicks) [expr $found+2]]} {
            dun:rejoin:clean
            return 0
        } else {
            puthelp "WALLCHOPS #darth :\00304$nick\003 ($uhost) rejoined $channel $poopie seconds ago Old Nick was: \00303[lindex $dun_rejoin(nicks) [expr $found+2]]"
	    dun:rejoin:clean
	    return 0
	}
    }
}
i'm trying to get the elapsed time to display in the msg that my eggdrop sends to the ops (wallchops). i know i'm doing sumt wrong but cant figure out what --> current error i'm getting when trying to put in the $poopie variable --> [Beholder]: [19:45] Tcl error [dun:rejoin:check]: can't read "1103072701": no such variable.

and the problem lies in this code

Code: Select all

set poopie [incr [expr $dun_rejoin(time)+[unixtime]] -$previous]
for sure :) any hints?
User avatar
user
&nbsp;
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

what are you trying to "incr"? and what exactly are you trying to do?
Have you ever read "The Manual"?
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

Type:

.tcl set errorInfo

In DCC and check which line is causing the problem. Probobaly your conversion of unixtime number into the gmt, est format. Try using clock, seconds along with format.
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
User avatar
user
&nbsp;
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

awyeah wrote:Type:

.tcl set errorInfo

In DCC and check which line is causing the problem. Probobaly your conversion of unixtime number into the gmt, est format. Try using clock, seconds along with format.
Nope. He already located the line causing the problem and it's not even remotely related to what you just said. The error message is pretty unambigous.
Have you ever read "The Manual"?
User avatar
dotslasher
Halfop
Posts: 62
Joined: Sun Aug 10, 2003 8:10 pm

Post by dotslasher »

well i was trying to find a way to calculate the elapsed time, and aparantly that aint the way :p.

do u guys know how to calculate the elapsed time?
User avatar
user
&nbsp;
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

Darth_Unslut wrote:do u guys know how to calculate the elapsed time?

Code: Select all

expr {$now-$then}
Have you ever read "The Manual"?
User avatar
dotslasher
Halfop
Posts: 62
Joined: Sun Aug 10, 2003 8:10 pm

Post by dotslasher »

tnxie
Locked