mIRC Homepage
Posted By: MTec89 stripping - 08/08/03 06:36 PM
using moo.dll $dll(" $+ $scriptdirmoo.dll $+ ",cpuinfo,_)
i need to grab the cpu load % and set it as a variable
it returns somthing like this;
1-AMD , 1095MHz, 64KB (14% Load)
Posted By: pheonix Re: stripping - 08/08/03 06:56 PM
if i read it right you want to extract:
14% from:
1-AMD , 1095MHz, 64KB (14% Load)
?
if so:
tokenize 32 $dll(" $+ $scriptdirmoo.dll $+ ",cpuinfo,_)
set %yourvar $remove($5,$chr(asc value for "("))
Posted By: MTec89 Re: stripping - 08/08/03 07:16 PM
i cant find the $asc # for ( because i get $asc invalid format
Posted By: Watchdog Re: stripping - 08/08/03 07:22 PM
I am sure it is $chr(40)
Posted By: Hammer Re: stripping - 08/08/03 07:31 PM
To return 1-AMD , 1095MHz, 64KB (14% Load), use your dll call
  • $dll($+(",$scriptdirmoo.dll,"), cpuinfo, _)
To return 14% Load), chop off everything before the first ( with
  • $gettok($dll($+(",$scriptdirmoo.dll,"),cpuinfo,_), 2, 40)
To return 14% load, use $left( , -1) to chop off the final ).
  • $left($gettok($dll($+(",$scriptdirmoo.dll,"),cpuinfo,_),2,40), -1)
To return 14%, use a $gettok( , 1, 32) to grab everything from the result before the first space.
  • $gettok($gettok($dll($+(",$scriptdirmoo.dll,"),cpuinfo,_),2,40), 1, 32)
To return 14, use a $getok( , 1, 37) to grab everything from the result before the first %.
  • $gettok($gettok($dll($+(",$scriptdirmoo.dll,"),cpuinfo,_),2,40), 1, 37)
cool
Posted By: MTec89 Re: stripping - 08/08/03 07:38 PM
thanks smile but can i add text on top of a progress bar?
Posted By: Hammer Re: stripping - 08/08/03 10:51 PM
If you are creating your progress bar in a custom @picwin, yes. You just update the progress bar and re/drawtext your text over the top.
Posted By: MTec89 Re: stripping - 08/08/03 11:01 PM
im doing one using mdx
Posted By: KingTomato Re: stripping - 09/08/03 02:10 AM
why not use the rambar function... it gives u percent used (without % sign) out of a whole 100. It the function that moo uses to add the "14%" to the cpuinfo method
Posted By: MTec89 Re: stripping - 09/08/03 03:15 AM
i tried it before and cant get it to work, and everything works fine (except for my lag bar) so i would like to not screw with it wink
Posted By: Rich Re: stripping - 09/08/03 03:41 PM
It's 35 actually, 40 is '('
Code:
/alias ascii echo -a Ascii for $+(",$1,") is: $asc($1)

One of my favorite aliases smile
Posted By: qwerty Re: stripping - 09/08/03 04:55 PM
This is my favorite alias too. I use this:
Code:
getasc bset -t &a 1 $$1- | echo -s $bvar(&a,1-)
Posted By: Watchdog Re: stripping - 09/08/03 05:09 PM
You misread his question, it was "(" he wanted the ASCII code for. He used "#" to represent the word "number". grin
© mIRC Discussion Forums