i keep getting the error below anyone know the prob?
TCL error [test1]: wrong # args: extra words after "else" clause in "if" command
bind pub - test test1
proc test1 {nick host hand chan arg} {
putserv "PRIVMSG $chan :[test2 [getuser [lindex $arg 0] laston $chan]]"
}
proc test2 {time ime} {
set year [expr $time - $ime]
if {$year >= 31536000} {
set yearsfull [expr $year / 31536000]
set years [expr floor($yearsfull)]
set yearssub [expr 31536000 * $years]
set week [expr $year - $yearsub]
} else {
set week $year
set years 0
}
if {$week >= 604800} {
set weeksfull [expr $week / 604800]
set weeks [expr floor($weeksfull)]
set weekssub [expr 604800 * $weeks]
set day [expr $week - $weeksub]
} else {
set day $week
set weeks 0
}
if {$day >= 86400} {
set daysfull [expr $day / 86400]
set days [expr floor($daysfull)]
set dayssub [expr 86400 * $days]
set hour [expr $day - $dayssub]
} else {
set hour $day
set days 0
}
if {$hour >= 3600} {
set hoursfull [expr $hour / 3600]
set hours [expr floor($hoursfull)]
set hourssub [expr 3600 * $hours]
set min [expr $hour - $hourssub]
} else {
set min $hour
set hours 0
}
if {$min >= 60} {
set minsfull [expr $min / 60]
set mins [expr floor($minsfull)]
set minssub [expr 60 * $mins]
set second [expr $min % 60]
}
if {$min < 60} && {$min > 0} {
set second $min
}
if {$mins} {
set mins 0
} elseif {$mins == ""} {
set mins 0
}
if {$years < 1} {
set years_numeric 0
set years ""
} elseif {$years == 1} {
set years_numeric $years
set years "1 year "
} else {
set years_numeric $years
set years "$years years "
}
if {$weeks < 1} {
set weeks_numeric 0
set weeks ""
} elseif {$weeks == 1} {
set weeks_numeric $weeks
set weeks "1 week "
} else {
set weeks_numeric $weeks
set weeks "$weeks weeks "
}
if {$days < 1} {
set days_numeric 0
set days ""
} elseif {$days == 1} {
set days_numeric $days
set days "1 week "
} else {
set days_numeric $days
set days "$days days "
}
if {$hours < 1} {
set hours_numeric 0
set hours ""
} elseif {$hours == 1} {
set hours_numeric $hours
set hours "1 hour "
} else {
set hours_numeric $hours
set hours "$hours hours "
}
if {$mins < 1} {
set mins_numeric 0
set mins ""
} elseif {$mins == 1} {
set mins_numeric $mins
set mins "1 minute "
} else {
set mins_numeric $mins
set mins "$mins minutes "
}
if {$second < 1} {
set second "less than a second"
} elseif {$second == 1} {
set second "1 second "
} else {
set second "$second seconds"
}
if {$years_numeric > 0} {
set result "$years $weeks"
} elseif {$weeks_numeric > 0} {
set result "$weeks $days"
} elseif {$days_numeric > 0} {
set result "$days $hours"
} elseif {$hours_numeric > 0} {
set result $hours
} elseif {$mins_numeric >= 1} {
set result $mins
} elseif {$mins_numeric < 1} {
set result "less than a minute"
}
set result "$result ago"
return $result
}
}