I want the spotter to tell me my time at the end of each lap. The code below does that. It uses either Laptime or LastLaptime with S3 as the trigger. Laptime/LastLaptime contains the number of seconds to do the lap so it has to be converted from seconds to minutes/seconds. Fro example, if you run the lap in 2 minutes and 20 seconds, Laptime will contain 140 seconds.
This will give a time as "Your time for that lap was three one four point one five nine." You will need a rule rule calling it and a wav/mp3 file for the "Your time for that lap was" and for "point."
Event=MyLap
{
// Event properties (note that these are not applied if this event is played by another event)
Detail=1
Spacing=0.0
Priority=1
Probability=1.0
TTL=10.0
Break=0.25
// Repeat until duration ends
Repeat=Off
Duration=0.0
// Play introduction to laptime
//I need to set the volume really high because my wav file of the "Your time...." was way too low
Volume=10
File=Your_time_for_that_lap_was.wav
//Set the volume back to 1 for the numbers
Volume=1.0
// Incoming is time in seconds so 3:14.159 = 194.159
Variable=Input1IntFunc,1,60,10 // This gives me the minute
{
Value=1 { File=1.wav }
Value=2 { File=2.wav }
Value=3 { File=3.wav }
Value=4 { File=4.wav }
Value=5 { File=5.wav }
Value=6 { File=6.wav }
Value=7 { File=7.wav }
Value=8 { File=8.wav }
Value=9 { File=9.wav }
Value=0 { File=0.wav }
}
Variable=Input1IntFunc,1,10,6 // This gives 10 seconds
{
Value=1 { File=1.wav }
Value=2 { File=2.wav }
Value=3 { File=3.wav }
Value=4 { File=4.wav }
Value=5 { File=5.wav }
Value=6 { File=6.wav }
Value=7 { File=7.wav }
Value=8 { File=8.wav }
Value=9 { File=9.wav }
Value=0 { File=0.wav }
}
Variable=Input1IntFunc,1,1,10 // This gives the unit second
{
Value=1 { File=1.wav }
Value=2 { File=2.wav }
Value=3 { File=3.wav }
Value=4 { File=4.wav }
Value=5 { File=5.wav }
Value=6 { File=6.wav }
Value=7 { File=7.wav }
Value=8 { File=8.wav }
Value=9 { File=9.wav }
Value=0 { File=0.wav }
}
//This say the word "point" for the decimal point
File=point.wav
Variable=Input1IntFunc,10,1,10 // This gives tenth of second
(
Value=1 { File=1.wav }
Value=2 { File=2.wav }
Value=3 { File=3.wav }
Value=4 { File=4.wav }
Value=5 { File=5.wav }
Value=6 { File=6.wav }
Value=7 { File=7.wav }
Value=8 { File=8.wav }
Value=9 { File=9.wav }
Value=0 { File=0.wav }
}
Variable=Input1IntFunc,100,1,10 // hundredth
{
Value=1 { File=1.wav }
Value=2 { File=2.wav }
Value=3 { File=3.wav }
Value=4 { File=4.wav }
Value=5 { File=5.wav }
Value=6 { File=6.wav }
Value=7 { File=7.wav }
Value=8 { File=8.wav }
Value=9 { File=9.wav }
Value=0 { File=0.wav }
}
Variable=Input1IntFunc,1000,1,10 // 3141 x 1000 / thousandth
{
Value=1 { File=1.wav }
Value=2 { File=2.wav }
Value=3 { File=3.wav }
Value=4 { File=4.wav }
Value=5 { File=5.wav }
Value=6 { File=6.wav }
Value=7 { File=7.wav }
Value=8 { File=8.wav }
Value=9 { File=9.wav }
Value=0 { File=0.wav }
}
}