mIRC Home    About    Download    Register    News    Help

Print Thread
Page 1 of 2 1 2
#52642 05/10/03 10:53 PM
Joined: Jul 2003
Posts: 742
MTec89 Offline OP
Hoopy frood
OP Offline
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?


http://MTec89Net.com
irc.freenode.net #MTec89Net
#52643 06/10/03 12:37 AM
Joined: Dec 2002
Posts: 1,527
_
Hoopy frood
Offline
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
#52644 06/10/03 01:28 AM
Joined: Jul 2003
Posts: 742
MTec89 Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Jul 2003
Posts: 742
how would i get just XX% or XX


http://MTec89Net.com
irc.freenode.net #MTec89Net
#52645 06/10/03 02:13 AM
Joined: Dec 2002
Posts: 1,527
_
Hoopy frood
Offline
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
#52646 06/10/03 03:00 AM
Joined: Jul 2003
Posts: 742
MTec89 Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Jul 2003
Posts: 742
smile thank you


http://MTec89Net.com
irc.freenode.net #MTec89Net
#52647 06/10/03 03:42 AM
Joined: Dec 2002
Posts: 1,527
_
Hoopy frood
Offline
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
#52648 06/10/03 03:44 AM
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
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
#52649 06/10/03 07:01 PM
Joined: Jul 2003
Posts: 742
MTec89 Offline OP
Hoopy frood
OP Offline
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..


http://MTec89Net.com
irc.freenode.net #MTec89Net
#52650 06/10/03 08:44 PM
Joined: Dec 2002
Posts: 1,527
_
Hoopy frood
Offline
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
#52651 06/10/03 08:44 PM
Joined: Feb 2003
Posts: 810
C
Hoopy frood
Offline
Hoopy frood
C
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
#52652 06/10/03 08:49 PM
Joined: Dec 2002
Posts: 1,527
_
Hoopy frood
Offline
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
#52653 06/10/03 08:52 PM
Joined: May 2003
Posts: 2,265
P
Hoopy frood
Offline
Hoopy frood
P
Joined: May 2003
Posts: 2,265
am i the only person who thinks $regex/$regsub is the hardest thing ever added to mirc frown?
lol blush


new username: tidy_trax
#52654 06/10/03 08:54 PM
Joined: Dec 2002
Posts: 1,527
_
Hoopy frood
Offline
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
#52655 06/10/03 09:00 PM
Joined: Feb 2003
Posts: 810
C
Hoopy frood
Offline
Hoopy frood
C
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
#52656 06/10/03 09:04 PM
Joined: May 2003
Posts: 2,265
P
Hoopy frood
Offline
Hoopy frood
P
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
#52657 06/10/03 09:08 PM
Joined: Feb 2003
Posts: 810
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Feb 2003
Posts: 810
Yeah, without $regex() you'd have to use $removecs() along with the entire alphabet or any other nasty code smile.


* cold edits his posts 24/7
#52658 06/10/03 09:12 PM
Joined: May 2003
Posts: 2,265
P
Hoopy frood
Offline
Hoopy frood
P
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
#52659 06/10/03 09:18 PM
Joined: Feb 2003
Posts: 810
C
Hoopy frood
Offline
Hoopy frood
C
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
#52660 06/10/03 09:36 PM
Joined: May 2003
Posts: 2,265
P
Hoopy frood
Offline
Hoopy frood
P
Joined: May 2003
Posts: 2,265
thanks smile


new username: tidy_trax
#52661 07/10/03 12:02 AM
Joined: Jul 2003
Posts: 742
MTec89 Offline OP
Hoopy frood
OP Offline
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


http://MTec89Net.com
irc.freenode.net #MTec89Net
Page 1 of 2 1 2

Link Copied to Clipboard