Jump to content


Photo

Random Memory Game


  • Please log in to reply
6 replies to this topic

#1 godsstigma

godsstigma
  • Members
  • 222 posts

Posted 30 January 2009 - 10:01 PM

I made this because sometimes when I try to remember something short like a group of numbers or a random string of letters I always second guess myself and look back… sometimes numerous times.

I didn’t finish the “about” or “help” functions… well because I didn’t want to.

You should be able to figure it out though.
just be sure to set the options before running for the first time.

You will need two text files and one sound file located here or just let the script download them for you:
http://www.autohotke.../ALPHA_LIST.txt
http://www.autohotke...PHRASE_LIST.txt
http://www.autohotke...gma/correct.wav

(Place them in the script directory)


#notrayicon
setbatchlines, -1
urldownloadtofile, http://www.autohotkey.net/~godsstigma/ALPHA_LIST.txt, %a_scriptdir%\ALPHA_LIST.txt
urldownloadtofile, http://www.autohotkey.net/~godsstigma/PHRASE_LIST.txt, %a_scriptdir%\PHRASE_LIST.txt
urldownloadtofile, http://www.autohotkey.net/~godsstigma/correct.wav, %a_scriptdir%\correct.wav
nothing = 
iniread, displaytype, %a_scriptdir%\settings.ini, options, type
iniread, value, %a_scriptdir%\settings.ini, options, value
iniread, timeout, %a_scriptdir%\settings.ini, options, timeout
if timeout = 0.25
	{
	timeoutsleep = 250
	}
if timeout = 0.5
	{
	timeoutsleep = 500
	}
if timeout = 0.75
	{
	timeoutsleep = 750
	}
if timeout = 1
	{
	timeoutsleep = 1000
	}
menu, optionmenu, add, &Settings, options
menu, optionmenu, add, &Exit, guiclose
menu, aboutmenu, add, &About, about
menu, aboutmenu, add, &Help, help

menu, menubar1, add, &Game, :optionmenu
menu, menubar1, add, &?, :aboutmenu

gui, menu, menubar1
gui, font, s12
Gui, Add, Text, x36 y97 w250 h45 +Center +Border vtextshow, Press "Test Me" to begin.
gui, font, s8
Gui, Add, Edit, x36 y217 w250 h20 +Center vinput, 
;Gui, Add, Text, x36 y77 w90 h20 +Center, Remember this:
Gui, Add, Text, x36 y197 w90 h20 +Center, Answer
Gui, Add, Button, x106 y257 w100 h30 gbegin, Test me
Gui, Add, Text, x116 y27 w40 h20 , Right =
Gui, Add, Text, x116 y47 w50 h20 , Wrong =
Gui, Add, Text, x176 y27 w40 h20 vRight, 
Gui, Add, Text, x176 y47 w40 h20 vWrong, 
ans_right = 0
ans_wrong = 0
guicontrol,, right, %ans_right%
guicontrol,, wrong, %ans_wrong%
Gui, Show, h315 w330, Random Memory Tester

Gui, 2: Add, DropDownList, x26 y47 w110 h200 vOpt_Displaytype, Integer|Alpha|Phrase
Gui, 2: Add, DropDownList, x26 y107 w110 h200 VOpt_Value, 2|3|4|5|6|7
Gui, 2: Add, Text, x26 y27 w110 h20 +Center, Display Type
Gui, 2: Add, Text, x26 y87 w110 h20 +Center, Number of Values
Gui, 2: Add, DropDownList, x26 y167 w110 h200 vOpt_Displaytimeout, 0.25|0.5|0.75|1
Gui, 2: Add, Text, x26 y147 w110 h20 +Center, Display Timeout
Gui, 2: Add, Button, x26 y217 w110 h30 gsubmit, Submit
Return
;###################################################
begin:
gui,submit,nohide
guicontrol,, textshow, %nothing%
SetTitleMatchMode, 2
controlfocus, Edit1, Random Memory Tester
goto, MainGenerate
return
;###################################################
numpadenter::
enter::
gui, submit, nohide
if input = %show%
	{
	ans_right++
	guicontrol,, right, %ans_right%
	soundplay, %a_scriptdir%\correct.wav
	sleep, 1000
	guicontrol,, input, %nothing%
	goto, MainGenerate
	return
	}
if input =
	{
	ans_wrong++
	guicontrol,, wrong, %ans_wrong%
	guicontrol,, input, %nothing%
	msgbox, 16, Wrong!!!, Sorry... but you are an idiot., 1
	sleep, 1000
	goto, MainGenerate
	return
	}
else
	{
	ans_wrong++
	guicontrol,, wrong, %ans_wrong%
	guicontrol,, input, %nothing%
	msgbox, 16, Wrong!!!, Sorry... but you are an idiot., 1
	sleep, 1000
	goto, MainGenerate
	return
	}
return

;###################################################
MainGenerate:
Gui, submit, nohide
if displaytype = integer
	{
	controlfocus, Edit1, Random Memory Tester
	random, 1, 0, 9
	random, 2, 0, 9
	random, 3, 0, 9
	random, 4, 0, 9
	random, 5, 0, 9
	random, 6, 0, 9
	random, 7, 0, 9
	
	if value = 2
	{
	show = %1%%2%
	guicontrol,, textshow, %show%
	sleep, %timeoutsleep%
	guicontrol,, textshow, %nothing%
	return
	}
	if value = 3
	{
	show = %1%%2%%3%
	guicontrol,, textshow, %show%
	sleep, %timeoutsleep%
	guicontrol,, textshow, %nothing%
	return
	}
	if value = 4
	{
	show = %1%%2%%3%%4%
	guicontrol,, textshow, %show%
	sleep, %timeoutsleep%
	guicontrol,, textshow, %nothing%
	return
	}
	if value = 5

	{
	show = %1%%2%%3%%4%%5%
	guicontrol,, textshow, %show%
	sleep, %timeoutsleep%
	guicontrol,, textshow, %nothing%
	return
	}
	if value = 6
	{
	show = %1%%2%%3%%4%%5%%6%
	guicontrol,, textshow, %show%
	sleep, %timeoutsleep%
	guicontrol,, textshow, %nothing%
	return
	}
	if value = 7
	{
	show = %1%%2%%3%%4%%5%%6%%7%
	guicontrol,, textshow, %show%
	sleep, %timeoutsleep%
	guicontrol,, textshow, %nothing%
	return
	}
	}
if displaytype = alpha
	{
	controlfocus, Edit1, Random Memory Tester
	Random, a, 1, 26
	Random, b, 1, 26
	Random, c, 1, 26
	Random, d, 1, 26
	Random, e, 1, 26
	Random, f, 1, 26
	Random, g, 1, 26
	filereadline, 1, %a_scriptdir%\alpha_list.txt, %a%
	filereadline, 2, %a_scriptdir%\alpha_list.txt, %b%
	filereadline, 3, %a_scriptdir%\alpha_list.txt, %c%
	filereadline, 4, %a_scriptdir%\alpha_list.txt, %d%
	filereadline, 5, %a_scriptdir%\alpha_list.txt, %e%
	filereadline, 6, %a_scriptdir%\alpha_list.txt, %f%
	filereadline, 7, %a_scriptdir%\alpha_list.txt, %g%
	if value = 2
	{
	show = %1%%2%
	guicontrol,, textshow, %show%
	sleep, %timeoutsleep%
	Guicontrol,, textshow, %nothing%
	return
	}
	if value = 3
	{
	show = %1%%2%%3%
	guicontrol,, textshow, %show%
	sleep, %timeoutsleep%
	Guicontrol,, textshow, %nothing%
	return
	}
	if value = 4
	{
	show = %1%%2%%3%%4%
	guicontrol,, textshow, %show%
	sleep, %timeoutsleep%
	Guicontrol,, textshow, %nothing%
	return
	}
	if value = 5
	{
	show = %1%%2%%3%%4%%5%
	guicontrol,, textshow, %show%
	sleep, %timeoutsleep%
	guicontrol,, textshow, %nothing%
	return
	}
	if value = 6
	{
	show = %1%%2%%3%%4%%5%%6%
	guicontrol,, textshow, %show%
	sleep, %timeoutsleep%
	guicontrol,, textshow, %nothing%
	return
	}
	if value = 7
	{
	show = %1%%2%%3%%4%%5%%6%%7%
	guicontrol,, textshow, %show%
	sleep, %timeoutsleep%
	guicontrol,, textshow, %nothing%
	return
	}
}
if displaytype = phrase
	{
	controlfocus, Edit1, Random Memory Tester
	Random, a, 1, 103
	Random, b, 1, 103
	Random, c, 1, 103
	Random, d, 1, 103
	Random, e, 1, 103
	Random, f, 1, 103
	Random, g, 1, 103
	filereadline, 1, %a_scriptdir%\phrase_list.txt, %a%
	filereadline, 2, %a_scriptdir%\phrase_list.txt, %b%
	filereadline, 3, %a_scriptdir%\phrase_list.txt, %c%
	filereadline, 4, %a_scriptdir%\phrase_list.txt, %d%
	filereadline, 5, %a_scriptdir%\phrase_list.txt, %e%
	filereadline, 6, %a_scriptdir%\phrase_list.txt, %f%
	filereadline, 7, %a_scriptdir%\phrase_list.txt, %g%
	if value = 2
	{
	show = %1% %2%
	guicontrol,, textshow, %show%
	sleep, %timeoutsleep%
	Guicontrol,, textshow, %nothing%
	return
	}
	if value = 3
	{
	show = %1% %2% %3%
	guicontrol,, textshow, %show%
	sleep, %timeoutsleep%
	Guicontrol,, textshow, %nothing%
	return
	}
	if value = 4
	{
	show = %1% %2% %3% %4%
	guicontrol,, textshow, %show%
	sleep, %timeoutsleep%
	Guicontrol,, textshow, %nothing%
	return
	}
	if value = 5
	{
	show = %1% %2% %3% %4% %5%
	guicontrol,, textshow, %show%
	sleep, %timeoutsleep%
	guicontrol,, textshow, %nothing%
	return
	}
	if value = 6
	{
	show = %1% %2% %3% %4% %5% %6%
	guicontrol,, textshow, %show%
	sleep, %timeoutsleep%
	guicontrol,, textshow, %nothing%
	return
	}
	if value = 7
	{
	show = %1% %2% %3% %4% %5% %6% %7%
	guicontrol,, textshow, %show%
	sleep, %timeoutsleep%
	guicontrol,, textshow, %nothing%
	return
	}
}
return
;###################################################
submit:
gui, submit, nohide
gui, 2: hide
iniwrite, %Opt_Displaytype%, %a_scriptdir%\settings.ini, options, type
iniwrite, %Opt_value%, %a_scriptdir%\settings.ini, options, value
iniwrite, %Opt_displaytimeout%, %a_scriptdir%\settings.ini, options, timeout
gui, 2: destroy
reload
return
;###################################################
options:
Gui, 2: Show, h276 w165, Options
return
;###################################################
about:
msgbox Something here soon
return
;###################################################
help:
msgbox Something here soon
return
;###################################################
GuiClose:
ExitApp
[/url]

#2 HotKeyIt

HotKeyIt
  • Fellows
  • 6129 posts

Posted 30 January 2009 - 10:43 PM

Nice.

#3 Jex

Jex
  • Members
  • 101 posts

Posted 30 January 2009 - 11:36 PM

That's cool. Defiantly a neat idea. Script works well.
It would be nice if when you got it wrong, it showed you what it was. As to see how wrong you were.

#4 godsstigma

godsstigma
  • Members
  • 222 posts

Posted 30 January 2009 - 11:51 PM

Thanks....

here you go jex:

#notrayicon
setbatchlines, -1
urldownloadtofile, http://www.autohotkey.net/~godsstigma/ALPHA_LIST.txt, %a_scriptdir%\ALPHA_LIST.txt
urldownloadtofile, http://www.autohotkey.net/~godsstigma/PHRASE_LIST.txt, %a_scriptdir%\PHRASE_LIST.txt
urldownloadtofile, http://www.autohotkey.net/~godsstigma/correct.wav, %a_scriptdir%\correct.wav
nothing = 
iniread, displaytype, %a_scriptdir%\settings.ini, options, type
iniread, value, %a_scriptdir%\settings.ini, options, value
iniread, timeout, %a_scriptdir%\settings.ini, options, timeout
if timeout = 0.25
	{
	timeoutsleep = 250
	}
if timeout = 0.5
	{
	timeoutsleep = 500
	}
if timeout = 0.75
	{
	timeoutsleep = 750
	}
if timeout = 1
	{
	timeoutsleep = 1000
	}
menu, optionmenu, add, &Settings, options
menu, optionmenu, add, &Exit, guiclose
menu, aboutmenu, add, &About, about
menu, aboutmenu, add, &Help, help

menu, menubar1, add, &Game, :optionmenu
menu, menubar1, add, &?, :aboutmenu

gui, menu, menubar1
gui, font, s12
Gui, Add, Text, x36 y97 w250 h45 +Center +Border vtextshow, Press "Test Me" to begin.
gui, font, s8
Gui, Add, Edit, x36 y217 w250 h20 +Center vinput, 
;Gui, Add, Text, x36 y77 w90 h20 +Center, Remember this:
Gui, Add, Text, x36 y197 w90 h20 +Center, Answer
Gui, Add, Button, x106 y257 w100 h30 gbegin, Test me
Gui, Add, Text, x116 y27 w40 h20 , Right =
Gui, Add, Text, x116 y47 w50 h20 , Wrong =
Gui, Add, Text, x176 y27 w40 h20 vRight, 
Gui, Add, Text, x176 y47 w40 h20 vWrong, 
ans_right = 0
ans_wrong = 0
guicontrol,, right, %ans_right%
guicontrol,, wrong, %ans_wrong%
Gui, Show, h315 w330, Random Memory Tester

Gui, 2: Add, DropDownList, x26 y47 w110 h200 vOpt_Displaytype, Integer|Alpha|Phrase
Gui, 2: Add, DropDownList, x26 y107 w110 h200 VOpt_Value, 2|3|4|5|6|7
Gui, 2: Add, Text, x26 y27 w110 h20 +Center, Display Type
Gui, 2: Add, Text, x26 y87 w110 h20 +Center, Number of Values
Gui, 2: Add, DropDownList, x26 y167 w110 h200 vOpt_Displaytimeout, 0.25|0.5|0.75|1
Gui, 2: Add, Text, x26 y147 w110 h20 +Center, Display Timeout
Gui, 2: Add, Button, x26 y217 w110 h30 gsubmit, Submit
Return
;###################################################
begin:
gui,submit,nohide
guicontrol,, textshow, %nothing%
SetTitleMatchMode, 2
controlfocus, Edit1, Random Memory Tester
goto, MainGenerate
return
;###################################################
numpadenter::
enter::
gui, submit, nohide
if input = %show%
	{
	ans_right++
	guicontrol,, right, %ans_right%
	soundplay, %a_scriptdir%\correct.wav
	sleep, 1000
	guicontrol,, input, %nothing%
	goto, MainGenerate
	return
	}
if input =
	{
	ans_wrong++
	guicontrol,, wrong, %ans_wrong%
	guicontrol,, input, %nothing%
	msgbox, 16, Wrong!!!, You didn't answer!`nTry again dumbass., 2
	sleep, 1000
	goto, MainGenerate
	return
	}
else
	{
	ans_wrong++
	guicontrol,, wrong, %ans_wrong%
	guicontrol,, input, %nothing%
	msgbox, 16, Wrong!!!, The answer is %show%`nYou answered %input%`n....idiot, 5
	
	sleep, 1000
	goto, MainGenerate
	return
	}
return

;###################################################
MainGenerate:
Gui, submit, nohide
if displaytype = integer
	{
	controlfocus, Edit1, Random Memory Tester
	random, 1, 0, 9
	random, 2, 0, 9
	random, 3, 0, 9
	random, 4, 0, 9
	random, 5, 0, 9
	random, 6, 0, 9
	random, 7, 0, 9
	
	if value = 2
	{
	show = %1%%2%
	guicontrol,, textshow, %show%
	sleep, %timeoutsleep%
	guicontrol,, textshow, %nothing%
	return
	}
	if value = 3
	{
	show = %1%%2%%3%
	guicontrol,, textshow, %show%
	sleep, %timeoutsleep%
	guicontrol,, textshow, %nothing%
	return
	}
	if value = 4
	{
	show = %1%%2%%3%%4%
	guicontrol,, textshow, %show%
	sleep, %timeoutsleep%
	guicontrol,, textshow, %nothing%
	return
	}
	if value = 5
	{
	show = %1%%2%%3%%4%%5%
	guicontrol,, textshow, %show%
	sleep, %timeoutsleep%
	guicontrol,, textshow, %nothing%
	return
	}
	if value = 6
	{
	show = %1%%2%%3%%4%%5%%6%
	guicontrol,, textshow, %show%
	sleep, %timeoutsleep%
	guicontrol,, textshow, %nothing%
	return
	}
	if value = 7
	{
	show = %1%%2%%3%%4%%5%%6%%7%
	guicontrol,, textshow, %show%
	sleep, %timeoutsleep%
	guicontrol,, textshow, %nothing%
	return
	}
	}
if displaytype = alpha
	{
	controlfocus, Edit1, Random Memory Tester
	Random, a, 1, 26
	Random, b, 1, 26
	Random, c, 1, 26
	Random, d, 1, 26
	Random, e, 1, 26
	Random, f, 1, 26
	Random, g, 1, 26
	filereadline, 1, %a_scriptdir%\alpha_list.txt, %a%
	filereadline, 2, %a_scriptdir%\alpha_list.txt, %b%
	filereadline, 3, %a_scriptdir%\alpha_list.txt, %c%
	filereadline, 4, %a_scriptdir%\alpha_list.txt, %d%
	filereadline, 5, %a_scriptdir%\alpha_list.txt, %e%
	filereadline, 6, %a_scriptdir%\alpha_list.txt, %f%
	filereadline, 7, %a_scriptdir%\alpha_list.txt, %g%
	if value = 2
	{
	show = %1%%2%
	guicontrol,, textshow, %show%
	sleep, %timeoutsleep%
	Guicontrol,, textshow, %nothing%
	return
	}
	if value = 3
	{
	show = %1%%2%%3%
	guicontrol,, textshow, %show%
	sleep, %timeoutsleep%
	Guicontrol,, textshow, %nothing%
	return
	}
	if value = 4
	{
	show = %1%%2%%3%%4%
	guicontrol,, textshow, %show%
	sleep, %timeoutsleep%
	Guicontrol,, textshow, %nothing%
	return
	}
	if value = 5
	{
	show = %1%%2%%3%%4%%5%
	guicontrol,, textshow, %show%
	sleep, %timeoutsleep%
	guicontrol,, textshow, %nothing%
	return
	}
	if value = 6
	{
	show = %1%%2%%3%%4%%5%%6%
	guicontrol,, textshow, %show%
	sleep, %timeoutsleep%
	guicontrol,, textshow, %nothing%
	return
	}
	if value = 7
	{
	show = %1%%2%%3%%4%%5%%6%%7%
	guicontrol,, textshow, %show%
	sleep, %timeoutsleep%
	guicontrol,, textshow, %nothing%
	return
	}
}
if displaytype = phrase
	{
	controlfocus, Edit1, Random Memory Tester
	Random, a, 1, 103
	Random, b, 1, 103
	Random, c, 1, 103
	Random, d, 1, 103
	Random, e, 1, 103
	Random, f, 1, 103
	Random, g, 1, 103
	filereadline, 1, %a_scriptdir%\phrase_list.txt, %a%
	filereadline, 2, %a_scriptdir%\phrase_list.txt, %b%
	filereadline, 3, %a_scriptdir%\phrase_list.txt, %c%
	filereadline, 4, %a_scriptdir%\phrase_list.txt, %d%
	filereadline, 5, %a_scriptdir%\phrase_list.txt, %e%
	filereadline, 6, %a_scriptdir%\phrase_list.txt, %f%
	filereadline, 7, %a_scriptdir%\phrase_list.txt, %g%
	if value = 2
	{
	show = %1% %2%
	guicontrol,, textshow, %show%
	sleep, %timeoutsleep%
	Guicontrol,, textshow, %nothing%
	return
	}
	if value = 3
	{
	show = %1% %2% %3%
	guicontrol,, textshow, %show%
	sleep, %timeoutsleep%
	Guicontrol,, textshow, %nothing%
	return
	}
	if value = 4
	{
	show = %1% %2% %3% %4%
	guicontrol,, textshow, %show%
	sleep, %timeoutsleep%
	Guicontrol,, textshow, %nothing%
	return
	}
	if value = 5
	{
	show = %1% %2% %3% %4% %5%
	guicontrol,, textshow, %show%
	sleep, %timeoutsleep%
	guicontrol,, textshow, %nothing%
	return
	}
	if value = 6
	{
	show = %1% %2% %3% %4% %5% %6%
	guicontrol,, textshow, %show%
	sleep, %timeoutsleep%
	guicontrol,, textshow, %nothing%
	return
	}
	if value = 7
	{
	show = %1% %2% %3% %4% %5% %6% %7%
	guicontrol,, textshow, %show%
	sleep, %timeoutsleep%
	guicontrol,, textshow, %nothing%
	return
	}
}
return
;###################################################
submit:
gui, submit, nohide
gui, 2: hide
iniwrite, %Opt_Displaytype%, %a_scriptdir%\settings.ini, options, type
iniwrite, %Opt_value%, %a_scriptdir%\settings.ini, options, value
iniwrite, %Opt_displaytimeout%, %a_scriptdir%\settings.ini, options, timeout
gui, 2: destroy
reload
return
;###################################################
options:
Gui, 2: Show, h276 w165, Options
return
;###################################################
about:
msgbox Something here soon
return
;###################################################
help:
msgbox Something here soon
return
;###################################################
GuiClose:
ExitApp


#5 Jex

Jex
  • Members
  • 101 posts

Posted 31 January 2009 - 07:27 PM

:shock: this is so neat, i think i'm addicted to playing it...

#6 godsstigma

godsstigma
  • Members
  • 222 posts

Posted 31 January 2009 - 09:26 PM

Awesome!
Good to know someone actually likes something I wrote.
thanks.

#7 godsstigma

godsstigma
  • Members
  • 222 posts

Posted 31 January 2009 - 09:50 PM

updated...

new sounds when entering an empty string and getting answer wrong.
also gives you warning before showing the next value after getting an answer wrong or starting the game.

also it doesn't download the files every time it runs.

#notrayicon
setbatchlines, -1
ifnotexist, %a_scriptdir%\ALPHA_LIST.txt
	{
	urldownloadtofile, http://www.autohotkey.net/~godsstigma/ALPHA_LIST.txt, %a_scriptdir%\ALPHA_LIST.txt
	}
ifnotexist, %a_scriptdir%\PHRASE_LIST.txt
	{
	urldownloadtofile, http://www.autohotkey.net/~godsstigma/PHRASE_LIST.txt, %a_scriptdir%\PHRASE_LIST.txt
	}
ifnotexist, %a_scriptdir%\correct.wav
	{
	urldownloadtofile, http://www.autohotkey.net/~godsstigma/correct.wav, %a_scriptdir%\correct.wav
	}
ifnotexist, %a_scriptdir%\wrong.wav
	{
	urldownloadtofile, http://www.autohotkey.net/~godsstigma/Wrong.wav, %a_scriptdir%\wrong.wav
	}
ifnotexist, %a_scriptdir%\Attention.wav
	{
	urldownloadtofile, http://www.autohotkey.net/~godsstigma/Attention.wav, %a_scriptdir%\Attention.wav
	}
nothing = 
iniread, displaytype, %a_scriptdir%\settings.ini, options, type
iniread, value, %a_scriptdir%\settings.ini, options, value
iniread, timeout, %a_scriptdir%\settings.ini, options, timeout
if timeout = 0.25
	{
	timeoutsleep = 250
	}
if timeout = 0.5
	{
	timeoutsleep = 500
	}
if timeout = 0.75
	{
	timeoutsleep = 750
	}
if timeout = 1
	{
	timeoutsleep = 1000
	}
menu, optionmenu, add, &Settings, options
menu, optionmenu, add, &Exit, guiclose
menu, aboutmenu, add, &About, about
menu, aboutmenu, add, &Help, help

menu, menubar1, add, &Game, :optionmenu
menu, menubar1, add, &?, :aboutmenu

gui, menu, menubar1
gui, font, s12
Gui, Add, Text, x36 y97 w250 h45 +Center +Border vtextshow, Press "Test Me" to begin.
gui, font, s8
Gui, Add, Edit, x36 y217 w250 h20 +Center vinput, 
Gui, Add, Text, x36 y197 w90 h20 +Center, Answer
Gui, Add, Button, x106 y257 w100 h30 gbegin, Test me
Gui, Add, Text, x116 y27 w40 h20 , Right =
Gui, Add, Text, x116 y47 w50 h20 , Wrong =
Gui, Add, Text, x176 y27 w40 h20 vRight, 
Gui, Add, Text, x176 y47 w40 h20 vWrong, 
ans_right = 0
ans_wrong = 0
guicontrol,, right, %ans_right%
guicontrol,, wrong, %ans_wrong%
Gui, Show, h315 w330, Random Memory Tester
Gui, 2: Add, DropDownList, x26 y47 w110 h200 vOpt_Displaytype, Integer|Alpha|Phrase
Gui, 2: Add, DropDownList, x26 y107 w110 h200 VOpt_Value, 2|3|4|5|6|7
Gui, 2: Add, Text, x26 y27 w110 h20 +Center, Display Type
Gui, 2: Add, Text, x26 y87 w110 h20 +Center, Number of Values
Gui, 2: Add, DropDownList, x26 y167 w110 h200 vOpt_Displaytimeout, 0.25|0.5|0.75|1
Gui, 2: Add, Text, x26 y147 w110 h20 +Center, Display Timeout
Gui, 2: Add, Button, x26 y217 w110 h30 gsubmit, Submit
Return
;###################################################
begin:
	gui,submit,nohide
	guicontrol,, textshow, %nothing%
	SetTitleMatchMode, 2
	controlfocus, Edit1, Random Memory Tester
	soundplay, %a_scriptdir%\attention.wav
	guicontrol,, textshow, Get Ready!
		sleep, 1000
		guicontrol,, textshow, Go!
		sleep, 1000
		guicontrol,, textshow, %nothing%
		sleep, 500
	goto, MainGenerate
	return
;###################################################
numpadenter::
enter::
	gui, submit, nohide
	if input = %show%
		{
		ans_right++
		guicontrol,, right, %ans_right%
		soundplay, %a_scriptdir%\correct.wav
		sleep, 1000
		guicontrol,, input, %nothing%
		goto, MainGenerate
		return
		}
	if input =
		{
		soundplay, %a_scriptdir%\Wrong.wav
		ans_wrong++
		guicontrol,, wrong, %ans_wrong%
		guicontrol,, input, %nothing%
		msgbox, 16, Wrong!!!, You didn't enter anything!!!, 2
		sleep, 1000
		soundplay, %a_scriptdir%\attention.wav
		guicontrol,, textshow, Get Ready!
		sleep, 1000
		guicontrol,, textshow, Go!
		sleep, 1000
		guicontrol,, textshow, %nothing%
		sleep, 500
		goto, MainGenerate
		return
		}
	else
		{
		soundplay, %a_scriptdir%\Wrong.wav
		ans_wrong++
		guicontrol,, wrong, %ans_wrong%
		guicontrol,, input, %nothing%
		msgbox, 16, Wrong!!!, The correct string was "%show%"`nYou answered "%input%", 5
		sleep, 1000
		soundplay, %a_scriptdir%\attention.wav
		guicontrol,, textshow, Get Ready!
		sleep, 1000
		guicontrol,, textshow, Go!
		sleep, 1000
		guicontrol,, textshow, %nothing%
		sleep, 500
		goto, MainGenerate
		return
		}
	return
;###################################################
MainGenerate:
	Gui, submit, nohide
	if displaytype = integer
		{
		controlfocus, Edit1, Random Memory Tester
		random, 1, 0, 9
		random, 2, 0, 9
		random, 3, 0, 9
		random, 4, 0, 9
		random, 5, 0, 9
		random, 6, 0, 9
		random, 7, 0, 9
		
		if value = 2
		{
		show = %1%%2%
		guicontrol,, textshow, %show%
		sleep, %timeoutsleep%
		guicontrol,, textshow, %nothing%
		return
		}
		if value = 3
		{
		show = %1%%2%%3%
		guicontrol,, textshow, %show%
		sleep, %timeoutsleep%
		guicontrol,, textshow, %nothing%
		return
		}
		if value = 4
		{
		show = %1%%2%%3%%4%
		guicontrol,, textshow, %show%
		sleep, %timeoutsleep%
		guicontrol,, textshow, %nothing%
		return
		}
		if value = 5
		{
		show = %1%%2%%3%%4%%5%
		guicontrol,, textshow, %show%
		sleep, %timeoutsleep%
		guicontrol,, textshow, %nothing%
		return
		}
		if value = 6
		{
		show = %1%%2%%3%%4%%5%%6%
		guicontrol,, textshow, %show%
		sleep, %timeoutsleep%
		guicontrol,, textshow, %nothing%
		return
		}
		if value = 7
		{
		show = %1%%2%%3%%4%%5%%6%%7%
		guicontrol,, textshow, %show%
		sleep, %timeoutsleep%
		guicontrol,, textshow, %nothing%
		return
		}
		}
	if displaytype = alpha
		{
		controlfocus, Edit1, Random Memory Tester
		Random, a, 1, 26
		Random, b, 1, 26
		Random, c, 1, 26
		Random, d, 1, 26
		Random, e, 1, 26
		Random, f, 1, 26
		Random, g, 1, 26
		filereadline, 1, %a_scriptdir%\alpha_list.txt, %a%
		filereadline, 2, %a_scriptdir%\alpha_list.txt, %b%
		filereadline, 3, %a_scriptdir%\alpha_list.txt, %c%
		filereadline, 4, %a_scriptdir%\alpha_list.txt, %d%
		filereadline, 5, %a_scriptdir%\alpha_list.txt, %e%
		filereadline, 6, %a_scriptdir%\alpha_list.txt, %f%
		filereadline, 7, %a_scriptdir%\alpha_list.txt, %g%
		if value = 2
		{
		show = %1%%2%
		guicontrol,, textshow, %show%
		sleep, %timeoutsleep%
		Guicontrol,, textshow, %nothing%
		return
		}
		if value = 3
		{
		show = %1%%2%%3%
		guicontrol,, textshow, %show%
		sleep, %timeoutsleep%
		Guicontrol,, textshow, %nothing%
		return
		}
		if value = 4
		{
		show = %1%%2%%3%%4%
		guicontrol,, textshow, %show%
		sleep, %timeoutsleep%
		Guicontrol,, textshow, %nothing%
		return
		}
		if value = 5
		{
		show = %1%%2%%3%%4%%5%
		guicontrol,, textshow, %show%
		sleep, %timeoutsleep%
		guicontrol,, textshow, %nothing%
		return
		}
		if value = 6
		{
		show = %1%%2%%3%%4%%5%%6%
		guicontrol,, textshow, %show%
		sleep, %timeoutsleep%
		guicontrol,, textshow, %nothing%
		return
		}
		if value = 7
		{
		show = %1%%2%%3%%4%%5%%6%%7%
		guicontrol,, textshow, %show%
		sleep, %timeoutsleep%
		guicontrol,, textshow, %nothing%
		return
		}
	}
	if displaytype = phrase
		{
		controlfocus, Edit1, Random Memory Tester
		Random, a, 1, 103
		Random, b, 1, 103
		Random, c, 1, 103
		Random, d, 1, 103
		Random, e, 1, 103
		Random, f, 1, 103
		Random, g, 1, 103
		filereadline, 1, %a_scriptdir%\phrase_list.txt, %a%
		filereadline, 2, %a_scriptdir%\phrase_list.txt, %b%
		filereadline, 3, %a_scriptdir%\phrase_list.txt, %c%
		filereadline, 4, %a_scriptdir%\phrase_list.txt, %d%
		filereadline, 5, %a_scriptdir%\phrase_list.txt, %e%
		filereadline, 6, %a_scriptdir%\phrase_list.txt, %f%
		filereadline, 7, %a_scriptdir%\phrase_list.txt, %g%
		if value = 2
		{
		show = %1% %2%
		guicontrol,, textshow, %show%
		sleep, %timeoutsleep%
		Guicontrol,, textshow, %nothing%
		return
		}
		if value = 3
		{
		show = %1% %2% %3%
		guicontrol,, textshow, %show%
		sleep, %timeoutsleep%
		Guicontrol,, textshow, %nothing%
		return
		}
		if value = 4
		{
		show = %1% %2% %3% %4%
		guicontrol,, textshow, %show%
		sleep, %timeoutsleep%
		Guicontrol,, textshow, %nothing%
		return
		}
		if value = 5
		{
		show = %1% %2% %3% %4% %5%
		guicontrol,, textshow, %show%
		sleep, %timeoutsleep%
		guicontrol,, textshow, %nothing%
		return
		}
		if value = 6
		{
		show = %1% %2% %3% %4% %5% %6%
		guicontrol,, textshow, %show%
		sleep, %timeoutsleep%
		guicontrol,, textshow, %nothing%
		return
		}
		if value = 7
		{
		show = %1% %2% %3% %4% %5% %6% %7%
		guicontrol,, textshow, %show%
		sleep, %timeoutsleep%
		guicontrol,, textshow, %nothing%
		return
		}
	}
	return
;###################################################
submit:
	gui, submit, nohide
	gui, 2: hide
	iniwrite, %Opt_Displaytype%, %a_scriptdir%\settings.ini, options, type
	iniwrite, %Opt_value%, %a_scriptdir%\settings.ini, options, value
	iniwrite, %Opt_displaytimeout%, %a_scriptdir%\settings.ini, options, timeout
	gui, 2: destroy
	reload
	return
;###################################################
options:
	Gui, 2: Show, h276 w165, Options
	return
;###################################################
about:
	msgbox Something here soon
	return
;###################################################
help:
	msgbox Something here soon
	return
;###################################################
GuiClose:
	ExitApp