Was just writing some code for a code timer, enjoy!
'Rem Type=Plugin
'Rem Name=Timer
'Rem Author=Gerald L. Blakley A.K.A OnTheCuttingEdge2005
'Rem Host=Assistant
'This sub setups the plug-ins option panel in Hal's options dialog
Sub OptionsPanel()
lblPlugin(0).Caption = "This is a delay timer of a few seconds only. to be used for plugin sleep, Script code: 'Sleep' Like If Sleep = 5 Then do something. or for entertainment by saying: Go to sleep."
lblPlugin(0).Move 120, 10, 3300, 1000
lblPlugin(0).WordWrap = True
lblPlugin(0).Visible = True
End Sub
Rem PLUGIN: PLUGINAREA1
'The preceding comment is actually a plug-in directive for
'the Ultra Hal host application. It allows for code snippets
'to be inserted here on-the-fly based on user configuration.
'THIS TIMER IS MENT FOR PLUGIN SCRIPTS THAT REQUIRE A SLEEP FUNCTION
'OR FOR EDUCATIONAL EXPERIENCE.
HalBrain.ReadOnlyMode = True
TimeResponse = UserSentence
If InStr(1, TimeResponse, " GO TO SLEEP ", vbTextCompare) > 0 Then
T_Minus_Start = Time()
For i = 1 To 800000 '2 seconds
T_Minus_End = Time()
Sleep = DateDiff("s", T_Minus_Start, T_Minus_End)
If Sleep = 2 Then Exit For
Next
GetResponse = "I had " & Sleep & " seconds of sleep. "
Exit Function
End If
HalBrain.ReadOnlyMode = False
Just say: go to sleep.
educational purposes.
It is sufficient I guess.
Jerry