
Variable Numeric Slot_PollExternalCommands = 53'1

Label Loop1
	Poll_ExternalCommands
Goto Loop1
Stop


Label Poll_ExternalCommands
	Variable String PEC1
	PEC1 = SlotText(Slot_PollExternalCommands)
	' --------------------------------- Extract first word
	Select GetSeparatedString(PEC1, 0)
		Case ""
		' -------------------------
		Case "Beep"
			Beep 440 300
			ClearCommand
		' -------------------------
		Case "Beep_Multiple"
			ExecBeepMultiple
			ClearCommand
	    ' ------------------------- Commands with parameters
		Case "Say"
			TTS Speak Mid(PEC1, 5)
			Wait TTSready
			ClearCommand
	    ' ------------------------- Unrecognized command
		CaseElse
			Wait Seconds 0.5
			Beep 200 500
			Print "Unrecognized command: " + PEC1
			Wait Seconds 0.5
			ClearCommand
	EndSelect
Return

Label ClearCommand
	SlotText(Slot_PollExternalCommands) = ""
Return

Label ExecBeepMultiple
	For v1 = 1 To 3
		Beep 880 400
		Wait Seconds 0.5
	Next
Return


'BOOKMARKS 

'EDITEDLINES 

