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.

Topic

Old posts that have not been replied to for several years.
Locked
B
Baidoc
Voice
Posts: 3
Joined: Sat Mar 06, 2004 7:45 pm
Location: Romania
Contact:

Topic

Post by Baidoc »

Hi. I`m trying to make a TCL that gets this line:
* Set by X on Wed Jul 06 04:02:38 -> From the channel topic. For eg.

* Topic is 'Welcome'
* Set by X on Wed Jul 06 04:02:38
how can I get the last like? I have *no* idea :(

Thanks.
BaidocSan
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

Code: Select all

bind raw - 333 get_topic_ts
proc get_topic_ts {from keyword args} {
   set args [split $args]
   set chan [lindex $args 1]
   set whom [lindex $args 2]
   set timestamp [lindex $args 3]
   puthelp "privmsg $chan :The topic was set by $whom on [ctime $timestamp]"
}
putserv "topic #channel"
g
greenbear
Owner
Posts: 733
Joined: Mon Sep 24, 2001 8:00 pm
Location: Norway

Post by greenbear »

User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

I was just wondering, isn't $args already a list? should it be split as well ?
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

no, it's a string - the actual server reply, trimmed on the left to not include from/source and the numeric (it even retains the ':' separator as its first character)
Locked