|
Joined: Jan 2004
Posts: 84
Babel fish
|
OP
Babel fish
Joined: Jan 2004
Posts: 84 |
see this code
$remove($replace($uptime(mirc,1),mins,m,secs,s), $+ $chr(32) $+ )
i need to remove that secs,s and if is possible to say like this
Uptime: 3h and 20m i not want that secs.
any help please. thanks.
|
|
|
|
Joined: Nov 2003
Posts: 257
Fjord artisan
|
Fjord artisan
Joined: Nov 2003
Posts: 257 |
fairly simple
//echo $uptime(mirc,1)
returns 10hrs 25mins 3secs
//echo $uptime(mirc,2)
returns 10hrs 25mins
Last edited by alkahol1k; 09/03/05 04:32 AM.
|
|
|
|
Joined: Jan 2004
Posts: 84
Babel fish
|
OP
Babel fish
Joined: Jan 2004
Posts: 84 |
alkahol1k, thanks for quick reply, but that can be like this format eg. 6hrs and 30mins i like with that and between hr and mins. thanks anyway
|
|
|
|
Joined: Sep 2003
Posts: 4,230
Hoopy frood
|
Hoopy frood
Joined: Sep 2003
Posts: 4,230 |
this $remove($replace($uptime(mirc,1),mins,m,secs,s), $+ $chr(32) $+ ) does not even make this Uptime: 3h and 20m with or without seconds!?!?!?!?!?
alkahol1k was correct you need to use $uptime(mirc,2) which well not display the seconds, but it wont help using the above line try this one
$replace($uptime(mirc,2),days,d,hrs,h,mins,m,$chr(32),$+($chr(32),and,$chr(32)))
days become d, hrs become h, mins become m, seconds are not displayed
[edit] I just read your reply again, and now you wanted only " and " inserted and the hrs etc left as they are if so...
$replace($uptime(mirc,2),$chr(32),$+($chr(32),and,$chr(32)))
Last edited by DaveC; 09/03/05 07:39 AM.
|
|
|
|
Joined: Feb 2004
Posts: 206
Fjord artisan
|
Fjord artisan
Joined: Feb 2004
Posts: 206 |
alkahol1k, thanks for quick reply, but that can be like this format eg. 6hrs and 30mins i like with that and between hr and mins. thanks anyway
alias myuptime {
tokenise 32 $uptime(mirc,2)
return $1 and $2
}
Example Usage: //echo $myuptime Or (replacing the standard units):
alias myuptime {
tokenise 32 $replace($uptime(mirc,2),hrs,h,mins,m)
return $1 and $2
}
Finally, what if there are only minutes (I don;t have mIRC running to test this)?
alias myuptime {
tokenise 32 $replace($uptime(mirc,2),hrs,h,mins,m)
return $1 iff($2, and $2, only )
}
Untested - I dont use tokenise a lot, so I hope I got the command right from memory! Cheers, DK
Darwin_Koala
Junior Brat, In-no-cent(r)(tm) and original source of DK-itis!
|
|
|
|
Joined: Jan 2004
Posts: 84
Babel fish
|
OP
Babel fish
Joined: Jan 2004
Posts: 84 |
well done DaveC, thanks a lot. thanks for explain very well
|
|
|
|
Joined: Jan 2004
Posts: 84
Babel fish
|
OP
Babel fish
Joined: Jan 2004
Posts: 84 |
Darwin_Koala, thanks, but have problem with tokenise in 3 code of yours.
* /tokenise: not connected to server (line 180, settings.mrc)
Anyway thanks for effort.
|
|
|
|
Joined: Feb 2004
Posts: 206
Fjord artisan
|
Fjord artisan
Joined: Feb 2004
Posts: 206 |
Darwin_Koala, thanks, but have problem with tokenise in 3 code of yours.
* /tokenise: not connected to server (line 180, settings.mrc)
Anyway thanks for effort. Your welcome :-) My major error .. tokenise should be tokenize ! I think you will find that will make a difference. The "Not connected to a server" error may be because the software looks for a "server command" if it can't find a local one to the same job. In my defence, I did say that I don't use it much! Cheers, DK
Darwin_Koala
Junior Brat, In-no-cent(r)(tm) and original source of DK-itis!
|
|
|
|
|