' ----------------------------------------------
'  Commands to Theremino_WebAI
' ----------------------------------------------

Variable Numeric Slot_Commands = 85
Variable Numeric Slot_Responses = 86

Button 1 Label Stop_

Button 3 Label SetPlatformGemini
Button 4 Label SetPlatformClaude
Button 5 Label SetPlatformGrok
Button 6 Label SetPlatformDeepSeek
Button 7 Label SetPlatformKimi
Button 8 Label SetPlatformQwen

Button 10 Label OpenGeminiPage
Button 11 Label OpenGeminiActivityPage
Button 12 Label OpenGeminiSavedInfoPage

Button 17 Label NewChat

Button 19 Label SendMessage1
Button 20 Label SendMessage2
Button 21 Label SendMessage3

Controls OpenTextBox
Loop
Stop

Label Loop
	If SlotText(Slot_Responses) <> ""
		s1 = SlotText(Slot_Responses)
		If Not StringContains(s1, "<<<END>>>")
			Controls ClearTextBox
			Print s1
			SlotText(Slot_Responses) = ""
		EndIf
	EndIf
Goto Loop

' =============================================================
'  SEND COMMAND (default timeout = 0.5 Sec)
' =============================================================
Label SendCommand
	Variable Numeric SC1       '<-- Parameter Destinat.-Slot
	Variable String  SC2       '<-- Parameter Command-String
	Variable Numeric SC3 = 0.5 '<-- The timeout in seconds
	Variable Numeric SC4
	SlotText SC1 = SC2
	For SC4 = 0.1 To SC3 Step 0.1
		If SlotText(SC1) = ""
			Exit
		EndIf
		Wait Seconds 0.1
	Next
Return

Label Stop_
	SendCommand(Slot_Commands)("Stop")
Return

Label SetPlatformGemini
	SendCommand(Slot_Commands)("SetPlatform Gemini")
Return
Label SetPlatformClaude
	SendCommand(Slot_Commands)("SetPlatform Claude")
Return
Label SetPlatformGrok
	SendCommand(Slot_Commands)("SetPlatform Grok")
Return
Label SetPlatformDeepSeek
	SendCommand(Slot_Commands)("SetPlatform DeepSeek")
Return
Label SetPlatformKimi
	SendCommand(Slot_Commands)("SetPlatform KIMI")
Return
Label SetPlatformQwen
	SendCommand(Slot_Commands)("SetPlatform Qwen")
Return

Label OpenGeminiPage
	SendCommand(Slot_Commands)("OpenGeminiPage")
Return
Label OpenGeminiActivityPage
	SendCommand(Slot_Commands)("OpenGeminiActivityPage")
Return
Label OpenGeminiSavedInfoPage
	SendCommand(Slot_Commands)("OpenGeminiSavedInfoPage")
Return


Label NewChat
	Controls ClearTextBox
	SendCommand(Slot_Commands)("NewChat")
Return

Label SendMessage1
	SendCommand(Slot_Commands)("SendPrompt" + " How are you ?")
Return
Label SendMessage2
	SendCommand(Slot_Commands)("SendPrompt" + " What time is it ?")
Return
Label SendMessage3
	SendCommand(Slot_Commands)("SendPrompt" + " What is your name ?")
Return


'BOOKMARKS 

'EDITEDLINES -1 1 -1 4 -1 7 -1 8 -1 9 105 10 

