Sign in to follow this  
Followers 0
yucatan

regread and round

10 posts in this topic

#1 ·  Posted (edited)

but i have one more problem and i dont know why it dont work i wanne do the same with the $mhz

$mhz = RegRead("HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcessor\0", "~MHz")

MsgBox(4096, "Test", $mhz )

MsgBox(0, "CPU SPEED (MHZ):", round($mhz[1] / 1024,1))

when i run this i get a error can u tell me why?

i have one more problem

the new computer has something 2 cpu's so i wanne detect that

HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcessor\0 (patch of the first processor)

HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcessor\1 (patch of the secend processor)

can somebody not help me with something like if HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcessor\1

exsist then write ""

i have one more problem its a simpel thing but i just can figure it out

why this dont work

$mem = MemGetStats()

$memmb = round($mem[1] / 1024,1))

$memgb = ($mem[1] / 1024 / 1024,1))

when i run it i get a error

D:\Documents and Settings\Yucatan\Bureaublad\testers.au3 (15) : ==> Unbalanced brackets in expression.:

$memmb = round($mem[1] / 1024,1))

$memmb = ^ ERROR

Edited by yucatan

Share this post


Link to post
Share on other sites



For $i = 0 To 10
    $mhz = RegRead("HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcessor\" & $i, "~MHz")
    If @error Then ExitLoop
    MsgBox(0, "CPU SPEED (GHz) Processor " & $i & " :", Round($mhz / 1024, 1))
Next

May switch to Do until in lieu of For Next

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

why this dont work

$mem = MemGetStats()

$memmb = round($mem[1] / 1024,1))

$memgb = ($mem[1] / 1024 / 1024,1))

when i run it i get a error

D:\Documents and Settings\Yucatan\Bureaublad\testers.au3 (15) : ==> Unbalanced brackets in expression.:

$memmb = round($mem[1] / 1024,1))

$memmb = ^ ERROR

i want this because i dont what that number in a msgbox it just needs to go in a $var

Edited by yucatan

Share this post


Link to post
Share on other sites

There is one ) at the end which doesn't belong there


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

For $i = 0 To 10

$mhz = RegRead("HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcessor\" & $i, "~MHz")

If @error Then ExitLoop

FileWrite($file, "CPU SPEED (GHz) Processor " & $i & " :", Round($mhz / 1024, 1))

Next

why i this dont work then?

Edited by yucatan

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

For $i = 0 To 10

$mhz = RegRead("HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcessor\" & $i, "~MHz")

If @error Then ExitLoop

FileWrite($file, "CPU SPEED (GHz) Processor " & $i & " :", Round($mhz / 1024, 1))

Next

why i this dont work then?

You need to learn from what Scite tells you!

FileWrite($file, "CPU SPEED (GHz) Processor " & $i & " :", Round($mhz / 1024, 1))

should be

FileWrite($file, "CPU SPEED (GHz) Processor " & $i & " :" & Round($mhz / 1024, 1))

Mega

Edited by Xenobiologist

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

hi thx alot i only have one more problem look at this pleas

now it does this

CPU SPEED (GHz) Processor 0: 2.9

CPU SPEED (GHz) Processor 1: 2.9

CPU Name 0: Intel® Pentium® D CPU 3.00GHz

CPU Name 1: Intel® Pentium® D CPU 3.00GHz

RAM Memory in KB 2096300

RAM Memory in MB 2047.2

look at this 2 lines

CPU Name 0: Intel® Pentium® D CPU 3.00GHz

CPU Name 1: Intel® Pentium® D CPU 3.00GHz

in the register is it like this

Intel® Pentium® D CPU 3.00GHz

and not like this

Intel® Pentium® D CPU 3.00GHz

can i not make a little kind of loop to look when the first letter comes then starts to write or something like

haha lol i see you cant see what i mean with i attach the log

just look in compuinfo.txt then you shall understand what i meen

compuinfo.txt

Edited by yucatan

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

So there is whitespace in front of Intel® Pentium® D CPU 3.00GHz, like this "................Intel® Pentium® D CPU 3.00GHz".

Try StringStripWS($var, 1) or StringStripWS($var, 5)

Edited by weaponx

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

hi weaponx i did it a try but with 1 dont work i now already tryed every modes 1 until 8 all of the dont do anything but i have found a script look here (test.au3)

in you see my processor good so why i cant use this fuction. i dont understand the code its a little high for me i tryed to merge but i failed but look @ compuinfo2.txt

the funny things is it works realy perfect nice log

only one problem when i read the code i see nothing i realy dont understand what the code do somthing with obj but can somebody make a little bit more clear what it does?

test.au3

Edited by yucatan

Share this post


Link to post
Share on other sites

I don't see a problem...

Maybe the last line:

FileWrite($file, "script" & $PcInfo & @CRLF)

To...

FileWrite($file,$PcInfo & @CRLF)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0