Daniel W. Posted June 21, 2006 Share Posted June 21, 2006 (edited) Hi, i wrote this function to get a unique code of a pc. Updated it and changed the name Here is the code: Func _UniquePCCode() Local $return , $first Local $pass = @ComputerName $encrypt = _Stringencrypt( 1 , $pass , $pass ) & @OSLang & @OSTYPE & @OSVersion & @OSServicePack & DriveGetSerial("C:\") $split = StringSplit( $encrypt , "a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z" ) For $a = 1 to $split[0] For $b = 65 to 90 If StringInStr( $split[$a] , Chr($B) ) Then $split[$a] = StringReplace( $split[$a] , Chr($B), $b ) EndIf Next $first &= $split[$a] Next StringStripWS( $first , 8 ) $split1 = StringSplit( $first , "_" ) For $d = 1 to $split1[0] $return &= $split[$d] Next $return = StringMid( $return , StringLen( $return ) / 2 - 3 , 8 ) $second = Hex($return) $return = "" $split = StringSplit( $second , "a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z" ) For $a = 1 to $split[0] For $b = 65 to 90 If StringInStr( $split[$a] , Chr($B) ) Then $split[$a] = StringReplace( $split[$a] , Chr($B), $b ) EndIf Next $return &= $split[$a] Next $return = StringMid( $return , StringLen( $return ) / 2 - 3 , 8 ) Return $return EndFunc ;==>_UniquePCCode Note you need _stringencrypt from string.au3 for it. Regards Edited June 30, 2006 by Daniel W. --------------------------------------------------------------------------------------------------------------------------------Scripts : _Encrypt UDF_UniquePCCode UDF MS like calculatorInstall programm *UPDATED* --------------------------------------------------------------------------------------------------------------------------------[quote name='Helge' post='213117' date='Jul 26 2006, 10:22 AM']Have you ever tried surfing the internet with a milk-carton ?This is similar to what you're trying to do.[/quote] Link to comment Share on other sites More sharing options...
Valik Posted June 21, 2006 Share Posted June 21, 2006 That's a terribly mis-leading name since there already is a term "unicode" in computing. Link to comment Share on other sites More sharing options...
Daniel W. Posted June 21, 2006 Author Share Posted June 21, 2006 narg is this a problem? I can change the name if you want but i though unicode for uniquecode is no problem... --------------------------------------------------------------------------------------------------------------------------------Scripts : _Encrypt UDF_UniquePCCode UDF MS like calculatorInstall programm *UPDATED* --------------------------------------------------------------------------------------------------------------------------------[quote name='Helge' post='213117' date='Jul 26 2006, 10:22 AM']Have you ever tried surfing the internet with a milk-carton ?This is similar to what you're trying to do.[/quote] Link to comment Share on other sites More sharing options...
Valik Posted June 22, 2006 Share Posted June 22, 2006 So you need me to coerce you into changing the name? The fact that the term has a previous and highly widespread (as in global) definition is not a sufficient reason to stop using the term out of context? Link to comment Share on other sites More sharing options...
Daniel W. Posted June 30, 2006 Author Share Posted June 30, 2006 I updated it and changed the name --------------------------------------------------------------------------------------------------------------------------------Scripts : _Encrypt UDF_UniquePCCode UDF MS like calculatorInstall programm *UPDATED* --------------------------------------------------------------------------------------------------------------------------------[quote name='Helge' post='213117' date='Jul 26 2006, 10:22 AM']Have you ever tried surfing the internet with a milk-carton ?This is similar to what you're trying to do.[/quote] Link to comment Share on other sites More sharing options...
JSThePatriot Posted June 30, 2006 Share Posted June 30, 2006 I noticed you are trimming white space " " using StringReplace(). Maybe you could try to use StringTrimWS() as it may be slightly faster. JS AutoIt Links File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more) Link to comment Share on other sites More sharing options...
Daniel W. Posted June 30, 2006 Author Share Posted June 30, 2006 Done Thanks for the tip --------------------------------------------------------------------------------------------------------------------------------Scripts : _Encrypt UDF_UniquePCCode UDF MS like calculatorInstall programm *UPDATED* --------------------------------------------------------------------------------------------------------------------------------[quote name='Helge' post='213117' date='Jul 26 2006, 10:22 AM']Have you ever tried surfing the internet with a milk-carton ?This is similar to what you're trying to do.[/quote] Link to comment Share on other sites More sharing options...
JSThePatriot Posted June 30, 2006 Share Posted June 30, 2006 Done Thanks for the tipNP Glad I could offer some possible help.I havent seen anything else yet that may help.JS AutoIt Links File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more) Link to comment Share on other sites More sharing options...
Daniel W. Posted June 30, 2006 Author Share Posted June 30, 2006 (edited) Shortened again Replaced this: Do $return = StringTrimLeft( $return , 1 ) If StringLen( $return ) > 8 Then $return = StringTrimRight( $return , 1 ) EndIf Until StringLen( $return ) = 8 oÝ÷ ÙhØb±«¢+Ø(ÀÌØíÉÑÕɸôMÑÉ¥¹5¥ ÀÌØíÉÑÕɸ°MÑÉ¥¹1¸ ÀÌØíÉÑÕɸ¤¼È´Ì°à¤ Edited June 30, 2006 by Daniel W. --------------------------------------------------------------------------------------------------------------------------------Scripts : _Encrypt UDF_UniquePCCode UDF MS like calculatorInstall programm *UPDATED* --------------------------------------------------------------------------------------------------------------------------------[quote name='Helge' post='213117' date='Jul 26 2006, 10:22 AM']Have you ever tried surfing the internet with a milk-carton ?This is similar to what you're trying to do.[/quote] Link to comment Share on other sites More sharing options...
ReaImDown Posted December 18, 2007 Share Posted December 18, 2007 (edited) nice work guys, I like it, this will come in handy Edited December 18, 2007 by ReaImDown [u][font="Century Gothic"]~я α и d γ ĵ . ċ . ѕ қ ϊ и и ε я~- My Programs -auto shutdownSleep funcdisallow programs[/font][/u] Link to comment Share on other sites More sharing options...
Xenobiologist Posted December 18, 2007 Share Posted December 18, 2007 Hi, shortened a little bit and made it useable even if there is no drive c:\ Func _UniquePCCode1() Local $return, $first $split = StringSplit(_StringEncrypt(1, @ComputerName, @ComputerName) & _ @OSLang & @OSTYPE & @OSVersion & @OSServicePack & DriveGetSerial(StringLeft(@WindowsDir, 3)), _ "a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z") For $a = 1 To $split[0] For $b = 65 To 90 If StringInStr($split[$a], Chr($B)) Then $split[$a] = StringReplace($split[$a], Chr($B), $B) EndIf Next $first &= $split[$a] Next $split1 = StringSplit(StringStripWS($first, 8), "_") For $d = 1 To $split1[0] $return &= $split[$d] Next $split = StringSplit(Hex(StringMid($return, StringLen($return) / 2 - 3, 8)), _ "a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z") $return = '' For $a = 1 To $split[0] For $b = 65 To 90 If StringInStr($split[$a], Chr($B)) Then $split[$a] = StringReplace($split[$a], Chr($B), $B) EndIf Next $return &= $split[$a] Next Return StringMid($return, StringLen($return) / 2 - 3, 8) EndFunc ;==>_UniquePCCode1 So long, 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 Link to comment Share on other sites More sharing options...
ReaImDown Posted December 19, 2007 Share Posted December 19, 2007 Hi, shortened a little bit and made it useable even if there is no drive c:\ Func _UniquePCCode1() Local $return, $first $split = StringSplit(_StringEncrypt(1, @ComputerName, @ComputerName) & _ @OSLang & @OSTYPE & @OSVersion & @OSServicePack & DriveGetSerial(StringLeft(@WindowsDir, 3)), _ "a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z") For $a = 1 To $split[0] For $b = 65 To 90 If StringInStr($split[$a], Chr($B)) Then $split[$a] = StringReplace($split[$a], Chr($B), $B) EndIf Next $first &= $split[$a] Next $split1 = StringSplit(StringStripWS($first, 8), "_") For $d = 1 To $split1[0] $return &= $split[$d] Next $split = StringSplit(Hex(StringMid($return, StringLen($return) / 2 - 3, 8)), _ "a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z") $return = '' For $a = 1 To $split[0] For $b = 65 To 90 If StringInStr($split[$a], Chr($B)) Then $split[$a] = StringReplace($split[$a], Chr($B), $B) EndIf Next $return &= $split[$a] Next Return StringMid($return, StringLen($return) / 2 - 3, 8) EndFunc ;==>_UniquePCCode1 So long, Mega even better, lol [u][font="Century Gothic"]~я α и d γ ĵ . ċ . ѕ қ ϊ и и ε я~- My Programs -auto shutdownSleep funcdisallow programs[/font][/u] Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now