mIRC Home    About    Download    Register    News    Help

Print Thread
#226264 24/09/10 05:32 PM
Joined: Feb 2003
Posts: 3,432
S
sparta Offline OP
Hoopy frood
OP Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
I using this line to echo what i type to my self (theme).

echo -am $+(,$oclr,$ts) $mee $1- | .msg $active $1-

$oclr <- return what color to use.
$ts <- return timestamp in the format i want to display it in.
$mee <- return $+(<,$me,>)

and i still only testing this, but i cant get the echo to display it right, if i enable timestamp it returns the echo as it should be displayed, but if i disable it i ending up with a space befor my nick get echoed to me, any idea on how to remove that space?

;-- Edit

Here is a dump to show the problem.

Last edited by sparta; 24/09/10 08:45 PM.

if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
Atm you always have a space between $oclr and $mee, even if $ts is $null:
echo -am $+(,$oclr,$ts)_$mee $1-

Some possible solutions:

a) an $iif to return that space only if required:
Code:
echo -am $+(,$oclr,$iif($ts,$v1 $+ $chr(32)),$mee) $1- 


b)bind $ts to $mee...
Code:
echo -am $+(,$oclr,$ts,$mee) $1-
...and have $ts return the trailing space only if it's returning a value:
Code:
alias ts { if (%showtimestamp) returnex <your timestamp> $+ $chr(32) }


c) put the color not in the text part, but as a parameter of /echo. Text now starts with "$ts" and the leading space will be ignored if $ts is $null:
Code:
echo $oclr -am $ts $mee $1-

Joined: Feb 2003
Posts: 3,432
S
sparta Offline OP
Hoopy frood
OP Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
thanx, i test your solution. smile


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }

Link Copied to Clipboard