HELP PLEASE!!!! Can Some one help me find the right code to use to do a task?
HELP showing me or explaining how to do them tasks would be great!
This is the task i can't get. This script is going to implement a usage count system for running the Star Trek game you wrote previously. The total number of times the Star Trek game has been played, along with the date of the most recent play should be stored in the registry. The key used to store the information should be placed under the HKCU\Software key with a subkey name of your liking. The logic diagrammed below should be implemented by your script.
This is what i need help with doing these things:
1. Display the current usage count 2. Reset the current usage count to 0 3. Display last play date 4. play the star trek game 5. quit"
HELP PLease
My code:
Option Explicit
Dim intPlayGame, strSplashImage, strAnswerOne, strAnswerTwo, strAnswerThree, f, filename
Dim strAnswerFour, strAnswerFive, intNumberCorrect, strFederationRank
Dim objFsoObject,WshShell, count
Set WshShell = WScript.CreateObject("WScript.Shell")
filename=InputBox("1. Display the current usage count 2. Reset the current usage count to 0 3. Display last play date 4. play the star trek game 5. quit","Star Trek Main meun on 10/18/11")
Const cTitlebarMsg = "The Star Trek Quiz Game"
f = InputBox("What is your name", "Name PLease")
Do
If filename = 1 Then
count = WshShell.RegRead("HKey\current_user")
If Err.Number <> 0 Then
MsgBox "Apparently, Star Trek application hasn't been run yet!",,"Whoa Nellie!"
else
MsgBox "Star Trek application has been run " & count & " times on this machine."
End If
Elseif filename = 4 Then
'Start the user's score at zero
intNumberCorrect = 0
'Display the splash screen and ask the user if he or she wants to play
strSplashImage = space(11) & "********" & vbCrLf & _
" ******************" & space(20) & "**************************" & _
space(15) & vbCrLf & "*" & space(30) & "*" & space(18) & _
"**" & space(39) & "*" & vbCrLf & " ******************" & _
space(20) & "*************************" & vbCrLf & space(31) & _
"******" & space(26) & "***" & vbCrLf & _
space(34) & "******" & space(22) & "***" & vbCrLf & _
space(37) & "******" & space(17) & "***" & vbCrLf & _
space(26) & " ****************************" & vbCrLf & _
space(26) & "*******************************" & vbCrLf & _
space(26) & "******************************" & vbCrLf & _
space(26) & " ****************************" & vbCrLf & vbCrLf & vbCrLf & _
"Would you like to boldly go where no one has gone before?"
intPlayGame = MsgBox(strSplashImage, 36, cTitlebarMsg)
If intPlayGame = 6 Then 'User elected to play the game
strAnswerOne = InputBox("What was the Science Officer's name in the " & _
"original Star Trek series?", cTitlebarMsg)
If LCase(strAnswerOne) = "spock" Then
intNumberCorrect = intNumberCorrect + 1
else
MsgBox "spock"
End If
Else 'User doesn't want to play
MsgBox "Thank you for taking the Star Trek Quiz." & _
vbCrLf & vbCrLf & "Live long and prosper!", , cTitlebarMsg
WScript.Quit()
End If
strAnswerTwo = InputBox("What Star Trek villain appeared in both the " & _
"original series and a Star Trek movie?", cTitlebarMsg)
If LCase(strAnswerTwo) = "khan" Then
intNumberCorrect = intNumberCorrect + 1
else
MsgBox "khan"
End If
strAnswerThree = InputBox("What was the numeric designation of " & _
"Voyager's on-board Borg?", cTitlebarMsg)
If CStr(strAnswerThree) = "7" Then
intNumberCorrect = intNumberCorrect + 1
ElseIf CStr(strAnswerThree) = "7 of 9" Then
intNumberCorrect = intNumberCorrect + 1
else
MsgBox "7"
End If
strAnswerFour = InputBox("Name the only Star Trek character to " & _
"regularly appear on two series and at least two Star Trek " & _
"movies?", cTitlebarMsg)
If LCase(strAnswerFour) = "worf" Then
intNumberCorrect = intNumberCorrect + 1
else
MsgBox "worf"
End If
strAnswerFive = InputBox("What is the last name of your favorite " & _
"Captain?", cTitlebarMsg)
If Len(strAnswerFive) > 3 Then
If Instr(1, "kirkpicardsiscojanewayarcher", LCase(strAnswerFive), 1) _
<> 0 Then
intNumberCorrect = intNumberCorrect + 1
else
MsgBox "kirkpicardsiscojanewayarcher"
End If
End If
Select Case intNumberCorrect
Case 5 'User got all five answers right
strFederationRank = "Admiral"
Case 4 'User got 4 of 5 answers right
strFederationRank = "Captain"
Case 3 'User got 3 of 5 answers right
strFederationRank = "Commander"
Case 2 'User got 2 of 5 answers right
strFederationRank = "Lieutenant-Commander"
Case 1 'User got 1 of 5 answers right
strFederationRank = "Lieutenant"
Case 0 'User did not get any answers right
strFederationRank = "Ensign"
End Select
MsgBox f & " You answered " & intNumberCorrect & " out of 5 correct." & _
vbCrLf & vbCrLf & "Your Star Fleet rank is : " & _
strFederationRank, , cTitlebarMsg
If filename = 5 Then
End If
end If
Loop
|