Project 1999

Go Back   Project 1999 > General Community > Off Topic

Closed Thread
 
Thread Tools Display Modes
  #1  
Old 01-07-2010, 05:48 PM
guineapig guineapig is offline
Planar Protector

guineapig's Avatar

Join Date: Oct 2009
Posts: 4,028
Default 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...
__________________
Quote:
Originally Posted by nilbog View Post
Server chat is for civil conversation. Personal attacks/generally being confrontational will not be tolerated.
  #2  
Old 01-07-2010, 06:00 PM
guineapig guineapig is offline
Planar Protector

guineapig's Avatar

Join Date: Oct 2009
Posts: 4,028
Default

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.
__________________
Quote:
Originally Posted by nilbog View Post
Server chat is for civil conversation. Personal attacks/generally being confrontational will not be tolerated.
  #3  
Old 01-07-2010, 08:50 PM
Goobles Goobles is offline
Planar Protector

Goobles's Avatar

Join Date: Oct 2009
Location: A shoe
Posts: 1,518
Default

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.
  #4  
Old 01-07-2010, 10:09 PM
karsten karsten is offline
Planar Protector

karsten's Avatar

Join Date: Oct 2009
Posts: 1,892
Default

[You must be logged in to view images. Log in or Register.]
__________________
Noah, the Loincloth Hero
Ogre High Jump Champion 2019
  #5  
Old 01-07-2010, 10:33 PM
Goobles Goobles is offline
Planar Protector

Goobles's Avatar

Join Date: Oct 2009
Location: A shoe
Posts: 1,518
Default

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  
Old 01-08-2010, 12:16 AM
guineapig guineapig is offline
Planar Protector

guineapig's Avatar

Join Date: Oct 2009
Posts: 4,028
Default

Am I missing something???
__________________
Quote:
Originally Posted by nilbog View Post
Server chat is for civil conversation. Personal attacks/generally being confrontational will not be tolerated.
  #7  
Old 01-08-2010, 12:29 AM
Allizia Allizia is offline
Sarnak


Join Date: Oct 2009
Location: Texas
Posts: 234
Default

End select instead of end if? I have basic knowledge at best

[You must be logged in to view images. Log in or Register.]
  #8  
Old 01-08-2010, 09:20 AM
guineapig guineapig is offline
Planar Protector

guineapig's Avatar

Join Date: Oct 2009
Posts: 4,028
Default

Quote:
Originally Posted by Allizia [You must be logged in to view images. Log in or Register.]
End select instead of end if? I have basic knowledge at best

[You must be logged in to view images. Log in or Register.]
I'll certainly try it... anyone else?
__________________
Quote:
Originally Posted by nilbog View Post
Server chat is for civil conversation. Personal attacks/generally being confrontational will not be tolerated.
  #9  
Old 01-26-2010, 06:29 PM
xxxbeinxxx xxxbeinxxx is offline
Skeleton


Join Date: Jan 2010
Posts: 15
Default

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)
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 01:29 PM.


Everquest is a registered trademark of Daybreak Game Company LLC.
Project 1999 is not associated or affiliated in any way with Daybreak Game Company LLC.
Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.