mIRC Home    About    Download    Register    News    Help

Print Thread
Stupid problem.. #153838 23/07/06 02:44 PM
Joined: Feb 2006
Posts: 164
V
vexed Offline OP
Vogon poet
OP Offline
Vogon poet
V
Joined: Feb 2006
Posts: 164
Code:
 Raw 315:*:{ echo -s  finished updating /who list for [ $+ $2 $+ ] %who. [ $+ [ $2 ] ] entries in [ $+ $iif(%sticks <= 1000,$v1 $+ ms,$round($calc($v1 / 1000),2) $+ s)) $+ ] | haltdef | unset %who.* } 

Code:
 alias who {  set %sticks $ticks | who $1 } 


finished updating /who list for [#lobby] 17 entries in [60946.01s]

What is wrong with that? frown

Last edited by vexed; 23/07/06 02:44 PM.
Re: Stupid problem.. #153839 23/07/06 03:52 PM
Joined: Oct 2005
Posts: 1,741
G
genius_at_work Offline
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
You need to calculate the difference between $ticks and %sticks before you display the results.

set %sticks $ticks
<time passes>
echo -a $calc($ticks - %sticks) ms passed

Code:
Raw 315:*:{
  var %entries = $($+(%,who.,$2),2)
  var %elapsed = $calc($ticks - %sticks)
  if (%elapsed &lt; 1000) %elapsed = %elapsed $+ ms
  else %elapsed = $round($calc(%elapsed / 1000),2) $+ s
  
  echo -s finished updating /who list for [ $+ $2 $+ ] %entries entries in [ $+ %elapsed $+ ] 
  haltdef 
  unset %who.* 
}


-genius_at_work

Re: Stupid problem.. #153840 23/07/06 03:56 PM
Joined: Dec 2002
Posts: 1,245
M
MikeChat Offline
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
in the raw event, you need to subtract %sticks from the current $ticks

Re: Stupid problem.. #153841 23/07/06 04:43 PM
Joined: Feb 2006
Posts: 164
V
vexed Offline OP
Vogon poet
OP Offline
Vogon poet
V
Joined: Feb 2006
Posts: 164
hmm
i get this now

finished updating /who list for$2%entries entries in%elapsed

Re: Stupid problem.. #153842 23/07/06 04:49 PM
Joined: Oct 2005
Posts: 1,741
G
genius_at_work Offline
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
Change the echo line to this:

echo -s finished updating /who list for $+([,$2,]) %entries entries in $+([,%elapsed,])

The error was due to mIRC considering [ ] to be evaluation brackets.

-genius_at_work

Re: Stupid problem.. #153843 23/07/06 05:40 PM
Joined: Feb 2006
Posts: 164
V
vexed Offline OP
Vogon poet
OP Offline
Vogon poet
V
Joined: Feb 2006
Posts: 164
I should of noticed that. (doh)

Thanks alot
wink

Re: Stupid problem.. #153844 24/07/06 04:15 PM
Joined: Apr 2004
Posts: 218
P
PhantasyX Offline
Fjord artisan
Offline
Fjord artisan
P
Joined: Apr 2004
Posts: 218
Just to tack on you can also make it say "0.234s" with:
"$time($calc(($ticks - %ticks) / 1000)) $+ s"

-zach


Live to Dream & Dream for Life