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.
fairly simple
//echo $uptime(mirc,1)
returns 10hrs 25mins 3secs
//echo $uptime(mirc,2)
returns 10hrs 25mins
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
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)))
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
well done DaveC, thanks a lot. thanks for explain very well
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.
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