mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Apr 2011
Posts: 11
K
KBN Offline OP
Pikka bird
OP Offline
Pikka bird
K
Joined: Apr 2011
Posts: 11
Is there a way to do loads like: load average: 0.08, 0.02, 0.01

in a mirc script i want to add it to my uptime script

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Where is the information coming from and what do you want to do with it?

Joined: Sep 2006
Posts: 59
R
Babel fish
Offline
Babel fish
R
Joined: Sep 2006
Posts: 59
Originally Posted By: KBN
Is there a way to do loads like: load average: 0.08, 0.02, 0.01

in a mirc script i want to add it to my uptime script


If you're using Linux you can get this information from /proc/loadavg

Joined: Jul 2006
Posts: 4,164
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,164
I'm not sure if this is what you want but it retreive the load percentage for each processor:
Code:
alias procload {
  .comopen p WbemScripting.SWbemLocator
  noop $com(p,ConnectServer,3,dispatch* d)
  noop $com(d,ExecQuery,3,bstr*,select * from Win32_Processor,dispatch* r)
  var %a 1
  while ($comval(r,%a,Name)) var %r = $addtok(%r,$+($chr(32),Load percentage for $v1,: $comval(r,%a,LoadPercentage),%),44),%a = %a + 1
  :error
  if ($com(p)) .comclose p
  if ($com(d)) .comclose d
  if ($com(r)) .comclose r
  return %r
}
Use for example //echo -a $procload, and note that it freezes mirc for a few ms so don't call it too often




#mircscripting @ irc.swiftirc.net == the best mIRC help channel

Link Copied to Clipboard