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.

Incompatible tcl - Need Help

Old posts that have not been replied to for several years.
Locked
h
hmelo

Post by hmelo »

Hi guys, i have one tcl that works fine in egg 1.4.3 but in 1.6 serie it is a little incompatible. Can anyone help me fixing it ??

i´m getting:
[23:05] Tcl error [cmfreqpart]: called "cmfreqpart" with too many arguments
----------------------------------

# if {[catch {set tjoin $tjoin}]} {
set tjoin ""
# }

bind join o * cmfreqjoin
bind part o * cmfreqpart
bind sign o * cmfreqsign
bind dcc m frequencia cmfreqstats
bind dcc n zerarfreq cmfreqzera

proc cmfreqzera {hand idx args} {
foreach usr [userlist o] {
setuser $usr xtra freqhr 0
}
return 1
}

proc cmfreqjoin {nick uhost hand chan} {
global tjoin
set tmp ""
lappend tmp $hand
lappend tmp [unixtime]
lappend tjoin $tmp
}

proc cmfreqpart {nick uhost hand chan} {
global tjoin
set x 0
foreach tmp $tjoin {
if {[lindex $tmp 0] == $hand} {
setuser $hand xtra freqhr [expr [getuser $hand xtra freqhr] + [unixtime] - [lindex $tmp 1]]
set tjoin [lreplace $tjoin $x $x]
return
}
set x [expr $x + 1]
}
}

proc cmfreqsign {nick uhost hand chan reason} {
cmfreqpart $nick $uhost $hand $chan
}

proc cmfreqlista {} {
set lista ""
foreach usr [userlist o] {
if {[llength $lista] == 0 || [catch {expr [getuser $usr xtra freqhr]}]} {
lappend lista $usr
} else {
set min 0
set max [expr [llength $lista] - 1]
set med -1
while {$max > $med || $med > $min} {
set med [expr ($max - $min) / 2 + $min]
if {[getuser $usr xtra freqhr] > [getuser [lindex $lista $med] xtra freqhr]} {
set max [expr $med - 1]
} else {
set min [expr $med + 1]
}
}
if {$min == [llength $lista]} {
lappend lista $usr
} else {
set lista [lreplace $lista $min [expr $min - 1] $usr]
}
}
}
return $lista
}

proc cmfreqstats {hand idx args} {
set lista [cmfreqlista]
set x 0
foreach usr $lista {
if {![catch {expr [getuser $usr xtra freqhr]}]} {
putdcc $idx "[expr [getuser $usr xtra freqhr] / 60] min. - $usr"
} else {
putdcc $idx "0 seg - $usr"
}
}
return 1
}

<font size=-1>[ This Message was edited by: hmelo on 2002-03-12 21:06 ]</font>
P
Petersen
Owner
Posts: 685
Joined: Thu Sep 27, 2001 8:00 pm
Location: Blackpool, UK

Post by Petersen »

proc cmfreqpart {nick uhost hand chan {msg ""}} {


though this is documented...

h
hmelo

Post by hmelo »

tks petersen
Locked