View previous topic :: View next topic |
Author |
Message |
CP-Geek Voice
Joined: 25 Sep 2005 Posts: 3
|
Posted: Sun Sep 25, 2005 3:40 pm Post subject: !banlist times, from unix-time to normal? |
|
|
I'm running 1.16.17 botnet with two bots, all working like a charm. Well, almost. When I do !banlist I get the list of bans (ftom channel.user) with unix-time when they were set, how could this be altered to "normal" time?
CP-Geek  |
|
Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Sun Sep 25, 2005 3:50 pm Post subject: |
|
|
Use the [ctime] command, example:
will return the current date. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
Back to top |
|
 |
demond Revered One

Joined: 12 Jun 2004 Posts: 3073 Location: San Francisco, CA
|
Posted: Sun Sep 25, 2005 3:50 pm Post subject: |
|
|
[ctime] _________________ connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use [code] tag when posting logs, code |
|
Back to top |
|
 |
CP-Geek Voice
Joined: 25 Sep 2005 Posts: 3
|
Posted: Mon Sep 26, 2005 7:17 am Post subject: |
|
|
I'm having some trouble to figure out where ctime should me put, this is the !banlist-section of chan.tcl:
Code: | #banlist
proc pub_do_bans {nick uhost hand chan text} {
puthelp "NOTICE $nick : Ban List for $chan."
foreach {a b c d} [banlist $chan] {
puthelp "NOTICE $nick :- [format %-12s%-12s%-12s%-12s $a $b $c $d]"
}
puthelp "NOTICE $nick : Ban List for $chan Completed."
}
#end of banlist |
Ideas? |
|
Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Mon Sep 26, 2005 8:54 pm Post subject: |
|
|
You'll have to convert the unixtime in each variable. i.e.
Code: | [string map [list [lindex $a 3] [ctime [lindex $a 3]]] $a] |
(this should be applied on $b, $c and $d as well) _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
Back to top |
|
 |
CP-Geek Voice
Joined: 25 Sep 2005 Posts: 3
|
Posted: Mon Sep 26, 2005 10:58 pm Post subject: |
|
|
Humble hank You's, works like a charm!
CP-Geek  |
|
Back to top |
|
 |
|