JustinReno Posted March 23, 2008 Posted March 23, 2008 (edited) I know what your thinking, there are a bunch of these. But, mine is simple and its very neat... MsgBox(64, "Serial Number Generator", _GenerateSerialNumber()) Func _GenerateSerialNumber() $Characters = StringSplit("ABCDEFGHIJKLMNOPQRSTUVWXYZ123456789", "") $SerialNumber = "" For $X = 1 To 5 For $I = 1 To 5 $SerialNumber &= $Characters[Random(1, 35, 1)] Next If $X <> 5 Then $SerialNumber &= "+" Next Return $SerialNumber EndFunc Edited March 24, 2008 by Jardenix
Emiel Wieldraaijer Posted March 23, 2008 Posted March 23, 2008 yes it generates serials very simple nothing more Best regards,Emiel Wieldraaijer
Developers Jos Posted March 23, 2008 Developers Posted March 23, 2008 Doubt if you ever see a serial with a 0 (Zero) in it. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
i542 Posted March 24, 2008 Posted March 24, 2008 I know what your thinking, there are a bunch of these. But, mine is simple and its very neat... MsgBox(64, "Serial Number Generator", _GenerateSerialNumber()) Func _GenerateSerialNumber() $Characters = StringSplit("ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890", "") $SerialNumber = "" For $X = 1 To 5 For $I = 1 To 5 $SerialNumber &= $Characters[Random(1, 35, 1)] Next If $X <> 5 Then $SerialNumber &= "+" Next Return $SerialNumber EndFuncoÝ÷ Ûú®¢×jey©ÝÜ(®K7Ül¥v}ýµ·iÛhi×ij¶¦z׫ªê-&j|§ºfÞ®ÇhÊ°j{jºeG+ºÚ"µÍÙÐÞ ][ÝÔÙX[[XÙ[]Ü][ÝËÑÙ[]TÙX[[X JB[ÈÑÙ[]TÙX[[X ÌÍØÚÈH K ÌÍÜÙXÝ[ÛÈH JBIÌÍÐÚXÝÈHÝ[ÔÜ] ][ÝÐPÑQÒRÓSÔTÕUÖVLÍ MÎL ][ÝË ][ÝÉ][ÝÊBIÌÍÔÙX[[XH ][ÝÉ][ÝÂQÜ ÌÍÖHHÈ ÌÍÜÙXÝ[ÛÂBQÜ ÌÍÒHHHÈ ÌÍØÚÂBBIÌÍÔÙX[[X [ÏH ÌÍÐÚXÝÖÔ[ÛJKÍKJWBBS^BRY ÌÍÖ ÉÝÈ ÌÍÜÙXÝ[ÛÈ[ ÌÍÔÙX[[X [ÏH ][ÝËI][ÝÂS^T] ÌÍÔÙX[[X[[ Using this one you can define how many chars will be in one section and how many sections will be there. I can do signature me.
James Posted March 24, 2008 Posted March 24, 2008 My Serial Key Generator - Maybe I should add some parameters, like you did i542! Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
WhOOt Posted March 24, 2008 Posted March 24, 2008 It sure is simple But it isn't really useful - it needs to be created in a different -non random way. You need to use a specefic alogorythm, or else you will have trouble checking if it is correct What I'm trying to say is that if anyone just types in 5 random characters, they got it right
James Posted March 24, 2008 Posted March 24, 2008 Oh god. Don't know if it is just me, but those AutoIt tags of ours have screwed up again =/ Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
LIMITER Posted March 24, 2008 Posted March 24, 2008 I made a serial generator a while ago : expandcollapse popup#NoTrayIcon #include <file.au3> #include <string.au3> $sFilePath = @HomeDrive & "\serial.txt" _FileCreate($sFilePath) $file = FileOpen($sFilePath, 1) $lines = InputBox("L|M|TER Serial Generator","Enter the number of serial codes to generate") if @error = 1 Then Exit ProgressOn("L|M|TER Serial Generator", "Generating serials ...", "", -1, -1, 16) For $i = 1 To $lines $a = Call("generate");Change this to Call("generate1") for the second type of code FileWrite($file,$a & @CRLF) $percent = Round($i / $lines * 100) ProgressSet($percent, $percent & "% done") Sleep(100) Next ProgressSet(100, "Done") Sleep(1000) ProgressOff() Exit Func generate() Dim $string = StringReplace(Random(5047548,9522131),".",""), $result $aNumber = StringRegExp($string, "\d{4}", 3) For $i = 0 To UBound($aNumber) - 1 $result &= $aNumber[$i] & "-" Next $result = StringTrimRight($result, 1) Return $result EndFunc Func generate1() $avChars = StringSplit("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ", "") $sTxt = "" For $i = 1 To 5 For $n = 1 To 4 $sTxt &= $avChars[Random(1, 36, 1)] Next If $i < 5 Then $sTxt &= "-" Next Return $sTxt EndFunc
JustinReno Posted March 24, 2008 Author Posted March 24, 2008 Thanks for the reply, and thank you i486 for the cool parameters. And I'll remove the 0 in the $Character array like Jos suggested.
Developers Jos Posted March 24, 2008 Developers Posted March 24, 2008 (edited) Thanks for the reply, and thank you i486 for the cool parameters. And I'll remove the 0 in the $Character array like Jos suggested. Didn't suggest to remove the 0, but was just trying to tell you that with your current script the 0 never will be selected because thats in position 36 in the Array.Think you made the same mistake in your corrected script and 9 will never be selected now. Edited March 24, 2008 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
James Posted March 24, 2008 Posted March 24, 2008 Jos, would that not be considered a bug then? An array is supposed to contain everything, not all but -1 of them. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
Developers Jos Posted March 24, 2008 Developers Posted March 24, 2008 Jos, would that not be considered a bug then? An array is supposed to contain everything, not all but -1 of them.huh ? the script is wrong, not autoit3. Let me spell it out for you: this portion returns the random character from the array: $Characters[Random(1, 34, 1)] But the array is filled from position 0 through 35 as this snippet proves: $Characters = StringSplit("ABCDEFGHIJKLMNOPQRSTUVWXYZ123456789", "") For $X = 1 To $Characters[0] ConsoleWrite($X & '=' & $Characters[$x] & @crlf) Next Conclusion: 9 will never be in any serial with the currently posted script. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
James Posted March 25, 2008 Posted March 25, 2008 This is in response to mustautoit PM. Thankyou for your interest in my script If you would like to prevent multiple uses of the key then you could use FTP functions. When a serial key is registered it uploads itself to a FTP directory somewhere. If the key already exists then dont register the program. Hope this helps. Thankyou, James Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
Dampe Posted March 25, 2008 Posted March 25, 2008 Hey, using his function I wrote a quick genner. expandcollapse popup;Writes a .txt list of random Serial Numbers to a file #include <GuiConstants.au3> #NoTrayIcon $counter= 1 Do $ammount = InputBox ("Ammount of serial keys to generate", "How many serial keys would you like to generate?") Until $ammount <> 0 Do $file = FileOpenDialog ("Create a file...", @DesktopDir, "Text files (*.txt)") Until $file <> "" GUICreate ("Progress...", 300, 65) GUICtrlCreateLabel ("Progress...", 5, 5) $prog = GUICtrlCreateProgress (5, 20, 290, 20) GUICtrlCreateLabel ("Key:", 5, 45) $curlabel = GUICtrlCreateLabel ("", 35, 45, 290, 15) $perc = GUICtrlCreateLabel ("", 235, 45, 35, 15) GUISetState (@SW_SHOW) Do $close = GUIGetMsg() $serial = _GenerateSerialNumber() GUICtrlSetData ($curlabel, $serial) FileWriteLine ($file, $serial & @CRLF) $counter = $counter + 1 GUICtrlSetData ($prog, $counter / $ammount * 100) GUICtrlSetData ($perc, Round ($counter / $ammount * 100, 2) & "%") If $close = $GUI_EVENT_CLOSE Then MsgBox (48, "Key generation interrupted!", "Key generation canceled by user") Exit 0 EndIf Until $counter = $ammount MsgBox (64, "Success", "Successfully generated " & $ammount & " serial keys!") Func _GenerateSerialNumber() $Characters = StringSplit("ABCDEFGHIJKLMNOPQRSTUVWXYZ123456789", "") $SerialNumber = "" For $X = 1 To 5 For $I = 1 To 5 $SerialNumber &= $Characters[Random(1, 35, 1)] Next If $X <> 5 Then $SerialNumber &= "-" Next $SerialNumber = StringTrimRight ($SerialNumber, 1) Return $SerialNumber EndFunc
karman Posted March 25, 2008 Posted March 25, 2008 ehm, it's more like random crap generator. it's in no way a serial number
Paulexander Posted June 17, 2010 Posted June 17, 2010 Thanks for this one, it also works as a nice simple alphanumeric text generator. I needed to edit an application's unique ID by replacing the last 4 digits with a unique number, and this will produce the string I need. I just changed the string to be alphanumeric only, removed the for loop to create 5 sets of numbers, and updated the random function for the max of 16, and voila! MsgBox(64, "ID Generator", _GenerateID()) Func _GenerateID() $Characters = StringSplit("ABCDEF0123456789", "") $SerialNumber = "" For $I = 1 To 4 $SerialNumber &= $Characters[Random(1, 16, 1)] Next Return $SerialNumber EndFunc
Thatsgreat2345 Posted June 17, 2010 Posted June 17, 2010 I fail to see the point of this, you're making a random string and not actually having any sort of authentication thus this isn't a serial, it's just a pointless string.
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