#1
|
|||
|
VBS question
Hey fellow geeks.
Quick VBS question. I have a script here for a basic keygen. It works fine except for one thing. After you type in (for example) 2-3 digit number and the key is generated you click okay and it goes back to the window requesting another session key. That part is fine. However, when I click close (x) it brings up the generated number again. Also if you click close (x) on the window with the generated key it also takes you back to the window requesting another key. Here's the code: --------------------------------- On Error Resume Next Dim Key, tempString, tempKey, Input Do Input = InputBox("Enter Serial!") Input = int(Input) Key = ((((((((Input ^ 8) / 92657) + 16) * 7) / 316) - 23) / 71104) + 26) * 24 tempString = CStr(Key) tempString = Left(tempString, 6) tempKey = Int(tempString) if (tempKey < 1000000) then tempString = CStr(tempKey * 2540) tempString = Left(tempString, 6) Key = Int(tempString) else Key = tempKey end if msgbox (Key) Loop Until Input < 1 ----------------------------------------- How the hell do I get the code to terminate the script as soon as the close (x) click event happens??? I cant think of a bunch of ways to do it logically but I really suck at VBS and can't figure out the syntax. Any help would be greatly appreciated. This is just for home computer use so feel free to use the code for whatever if you want to... | ||
|
#2
|
|||
|
Oh, in case anyone is curious. Just paste the code into a text file and save it as a .vbs file. Then you can double click on it to run and see how it works currently.
| ||
|
#3
|
|||
|
Reported.
__________________
it's like you make the atomic bomb (server) and you don't want to let other countries (guilds) have nuclear secrets (under the radar information). it's gm's business and no one else's or else everyone gets nuked. letting Iran or North Korea beta test and keep the successful nukes, makes other countries uncomfortable. | ||
|
#5
|
|||
|
Sad.
__________________
it's like you make the atomic bomb (server) and you don't want to let other countries (guilds) have nuclear secrets (under the radar information). it's gm's business and no one else's or else everyone gets nuked. letting Iran or North Korea beta test and keep the successful nukes, makes other countries uncomfortable. | ||
|
#6
|
|||
|
Am I missing something???
| ||
|
#8
|
|||
|
I'll certainly try it... anyone else?
| ||
|
#9
|
|||
|
This fixes the issue you described, but you need to validate your input to make sure the value isn't equal to null.
Dim Key, tempString, tempKey, Input Input = InputBox("Enter Serial!") Input = int(Input) Key = ((((((((Input ^ 8) / 92657) + 16) * 7) / 316) - 23) / 71104) + 26) * 24 tempString = CStr(Key) tempString = Left(tempString, 6) tempKey = Int(tempString) if (tempKey < 1000000) then tempString = CStr(tempKey * 2540) tempString = Left(tempString, 6) Key = Int(tempString) else Key = tempKey end if msgbox (Key) | ||
|
Thread Tools | |
Display Modes | |
|
|