|
Joined: Jul 2003
Posts: 742
Hoopy frood
|
OP
Hoopy frood
Joined: Jul 2003
Posts: 742 |
i think i remember there being a dll function in moo.dll to display only the cpu percent...does anyone know this?
|
|
|
|
Joined: Dec 2002
Posts: 1,527
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,527 |
$dll($scriptdirmoo.dll,cpuinfo,_)
that doesnot get only the percent usage. i dont think there is one that just gets that directly. now the way id try and get that info is to $gettok. unless someone has a better method this is how id do it
$gettok($dll($mircdirSYSinf\moo.dll,cpuinfo,_),5,32) $gettok($dll($mircdirSYSinf\moo.dll,cpuinfo,_),6,32)
that would return (NN% Load)
depending upon if the moo.dll u have reads the same as mine does
D3m0nnet.com
|
|
|
|
Joined: Jul 2003
Posts: 742
Hoopy frood
|
OP
Hoopy frood
Joined: Jul 2003
Posts: 742 |
how would i get just XX% or XX
|
|
|
|
Joined: Dec 2002
Posts: 1,527
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,527 |
$remove($gettok($dll($scriptdirmoo.dll,cpuinfo,_),5,32),$chr(40)) would return XX%
$remove($gettok($dll($scriptmoo.dll,cpuinfo,_),5,32),$chr(40),$chr(37)) would return XX
D3m0nnet.com
|
|
|
|
Joined: Jul 2003
Posts: 742
Hoopy frood
|
OP
Hoopy frood
Joined: Jul 2003
Posts: 742 |
thank you
|
|
|
|
Joined: Dec 2002
Posts: 1,527
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,527 |
np im sure someone else may come up with a more efficiant method but the one i come up with does work.
D3m0nnet.com
|
|
|
|
Joined: Jan 2003
Posts: 3,012
Hoopy frood
|
Hoopy frood
Joined: Jan 2003
Posts: 3,012 |
I was going to say use the $wiltok and match the *% but you method works. im not sure if all the processor information take up the same amount of tokens, but if it does--you're safe.
-KingTomato
|
|
|
|
Joined: Jul 2003
Posts: 742
Hoopy frood
|
OP
Hoopy frood
Joined: Jul 2003
Posts: 742 |
it does not work globally i have seen a screenshot m\of my script that instead of xx% it shows xxxxMHz
so this is not exactly in working order..
|
|
|
|
Joined: Dec 2002
Posts: 1,527
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,527 |
change the token number then in the check..... i mean really do we need to write everything for u?
D3m0nnet.com
|
|
|
|
Joined: Feb 2003
Posts: 810
Hoopy frood
|
Hoopy frood
Joined: Feb 2003
Posts: 810 |
If it's not always in the same order, you might consider using $regex().
* cold edits his posts 24/7
|
|
|
|
Joined: Dec 2002
Posts: 1,527
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,527 |
ok since yours processor info is longer than mine then ud just add 2 spaces for it to check instead of it reading 5,32 it would then need to read 7,32
or try another method like the one KT suggested. that way ud be able to cover all bases if your going to plan on distributing your script
D3m0nnet.com
|
|
|
|
Joined: May 2003
Posts: 2,265
Hoopy frood
|
Hoopy frood
Joined: May 2003
Posts: 2,265 |
am i the only person who thinks $regex/$regsub is the hardest thing ever added to mirc ? lol
new username: tidy_trax
|
|
|
|
Joined: Dec 2002
Posts: 1,527
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,527 |
ive actually never messed with regex. anything i need to do i can accomplish without it. atleast for my purposes.
D3m0nnet.com
|
|
|
|
Joined: Feb 2003
Posts: 810
Hoopy frood
|
Hoopy frood
Joined: Feb 2003
Posts: 810 |
Well it's kinda intimidating at first, but it's not that hard if you practice some usages.. Actually, many patterns that would be impossible/difficult to achieve, or that require a lot of code, could be accomplished with regular expressions quite easily.
* cold edits his posts 24/7
|
|
|
|
Joined: May 2003
Posts: 2,265
Hoopy frood
|
Hoopy frood
Joined: May 2003
Posts: 2,265 |
the hardest thing ive ever made using $regex is:
alias percent { return $calc($1 / $2) * 100 $+ % } alias caps { return $percent($1-,$regex($1-,/[A-Z]/g)) }
new username: tidy_trax
|
|
|
|
Joined: Feb 2003
Posts: 810
Hoopy frood
|
Hoopy frood
Joined: Feb 2003
Posts: 810 |
Yeah, without $regex() you'd have to use $removecs() along with the entire alphabet or any other nasty code .
* cold edits his posts 24/7
|
|
|
|
Joined: May 2003
Posts: 2,265
Hoopy frood
|
Hoopy frood
Joined: May 2003
Posts: 2,265 |
i know, but i mean i can sometimes(after multiple corrections) use more complicated $regex, but compared to stuff ive seen you and other use, its quite simple :\
new username: tidy_trax
|
|
|
|
Joined: Feb 2003
Posts: 810
Hoopy frood
|
Hoopy frood
Joined: Feb 2003
Posts: 810 |
Ah, it's a matter of practising and perceiving where you could use them. Try reading this and this (although the first link is mixed with PHP concepts and the second with perl, there is good info about regex on both sources).
* cold edits his posts 24/7
|
|
|
|
Joined: May 2003
Posts: 2,265
Hoopy frood
|
Hoopy frood
Joined: May 2003
Posts: 2,265 |
thanks
new username: tidy_trax
|
|
|
|
Joined: Jul 2003
Posts: 742
Hoopy frood
|
OP
Hoopy frood
Joined: Jul 2003
Posts: 742 |
this script isnt just for me.. i need something that will globally work.. not just a fix for one specific system, which will then mess the script up when i try to use it
|
|
|
|
|