#Theoretically, this file should help enhance suggestability
#Modified by w_w_x_x_y_y_z_z March 2006

# Setup Master Loop Counter
<set 15> 1

# Top of outermost loop giving three shots at the suggestions
TOP:
<speak> \Pau=4000\
<speak> %name%... Listen very carefully to my voice... I am now going to give you a suggestion...
<speak> First, place your wrist above the space bar on the keyboard, so that it can easily fall onto it...
<speak> During this session %name%... Whenever I say the word... sleep... your arm will drop and your hand will fall onto the space bar... and you will go deeper and deeper into trance... after your hand falls, lift it back up...
<speak> When you hear that word %name%... don't consciously try... just let your subconscious do the work...
<speak> During this session %name%... Whenever I say the word... sleep... your arm will drop and your hand will fall onto the space bar... and you will go deeper and deeper into trance... after your hand falls, lift it back up...
<speak> When you hear that word %name%... don't consciously try... just let your subconscious do the work...

# Setup Variables
<set 12> 0
<set 13> 0
<Set 14> 0

# top of outer loop running 15 repetitions
LOOPAGAIN:
<speak> \pau=7000\
<set 12> (%12% + 1)
<keybuffer>
<speak> sleep... \pau=4000\
<getkey>

# test if space key is hit and increment that counter
<if key=> Space
<set 13> (%13% + 1)

# test if loop versus key hits are close, if not goto error condition
<set 14> (%12% - %13%)
<if> %14% > 3
<gotolabel> NOTRESPONDING

#test to see if 15 outer loop repetitions have occurred
<if> %12% < 15
<gotolabel> LOOPAGAIN
<gotolabel> FINALCHECK

# test that the number of hand drops was at least 8 out of 15 sleeps, if not goto error condition
FINALCHECK:
<if> %13% > 8
<gotolabel> PASSED

# key hits version loop repetitions way off start over
NOTRESPONDING:
# check to see how many restarts
<if> %15% < 3
<set 15> (%15% + 1)
<gotolabel> FAILED

<speak> You seem to not be responding correctly. That's ok. Let's try it again...
<gotolabel> TOP

# Failed to respond 3 times
FAILED:
<speak> You seem to not be responding correctly. That's ok. You can try again another time...
<gotolabel> BOTTOM

# Passed hand drop test
PASSED:
<speak> Well done. You have responded well to my suggestion.
<gotolabel> BOTTOM

# Wrap up
BOTTOM
<speak> \Pau=5000\
<speak> %name%... Listen very carefully to my voice...

# End of File