egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

translating "idletime"

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
Torrevado
Op


Joined: 02 Aug 2006
Posts: 101

PostPosted: Tue Apr 29, 2008 7:11 pm    Post subject: translating "idletime" Reply with quote

I'd like to translate "$idletime", would it be possible?
Code:
proc whois:idle { from keyword arguments } {
      set channel $::whoischannel
      set target $::whoistarget
      set idletime [lindex [split $arguments] 2]
      set signon [lindex [split $arguments] 3]
      whois:putmsg $channel "$target idle: [duration $idletime]. Signed on [ctime $signon]"
      unbind RAW - 317 whois:idle
   }
Back to top
View user's profile Send private message
speechles
Revered One


Joined: 26 Aug 2006
Posts: 1398
Location: emerald triangle, california (coastal redwoods)

PostPosted: Tue Apr 29, 2008 7:18 pm    Post subject: Re: translating "unixtime" Reply with quote

Code:
whois:putmsg $channel "$target idle: [string map {"years" "tyears"
"weeks" "tweeks" "days" "tdays" "hours" "thours" "minutes" "tminutes" "seconds" "tseconds"} [duration $idletime]]. Sined on [ctime $signon]"

Pretend the above is all on one line, the string map delineated by spaces. In the string map, change each reference starting with T to your translated word for each. String map can also be used for translating the signed on time.
Back to top
View user's profile Send private message
Torrevado
Op


Joined: 02 Aug 2006
Posts: 101

PostPosted: Tue Apr 29, 2008 7:41 pm    Post subject: translating "unixtime" Reply with quote

Thanks speechles Wink
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber