hi, i need ur kind help, i am working on this kik command for dcc n for pub, but took me long time to figure out how to set a date n hanlde in a kik msg, like Z was kicked by eggdrop(Apr 23 AW:msg) , but some how i am getting an error about date, please help me this time, thanks u, here are the codes.
for pub:
proc kick_command {nick host handle channel args1} {
set args [split $args1 " "]
set knick [lindex $args 0]
set currdate [date]
set day [lindex $currdate 0]
set amonth [lindex $currdate 1]
set ayear [lindex $currdate 2]
switch $amonth {
Jan {set month "1"}
Feb {set month "2"}
Mar {set month "3"}
Apr {set month "4"}
May {set month "5"}
Jun {set month "6"}
Jul {set month "7"}
Aug {set month "8"}
Sep {set month "9"}
Oct {set month "10"}
Nov {set month "11"}
Dec {set month "12"}
}
set year [string range $ayear 2 3]
set kickdate "$amonth $day"
if {[test_real $nick]} {
return 0
}
if {$knick==""} { return 0 }
set reason [lrange $args 1 end]
if {$reason==""} {
set reason "..go and play outside!"
}
set kickstring "KICK $channel $knick :$kickdate $nick :$reason"
if {[matchattr [nick2hand $knick $channel] o]==0} {
putserv "$kickstring"
} else {
if {[matchattr $handle m]==1} {
putserv "$kickstring"
} else {
set kickstring "KICK $channel $nick :Wow! Lamerrr! Ain't it amazin? (Kick attempt on +o $knick)"
putserv "$kickstring"
}
}
return 1
}
For Dcc:
proc dcc_k_command {handle idx arg} {
set channel [lindex [console $idx] 0]
set nick [hand2nick $handle]
set host [getchanhost $nick]
return [kick_command $nick $host $handle $channel $arg]
}