Below is my version of a background swapper. I called it HapSwap.
Here is a simple version. After I show you the simple version I will then make it more versatile as we go.
Rem Type=Plugin
Rem Name=HapSwap
Rem Author=SNOWMAN, APOLLON
Rem Host=Assistant
'This sub setups the plug-ins option panel in Hal's options dialog
Sub OptionsPanel()
lblPlugin(0).Caption = "This is a simple background changer."
lblPlugin(0).Move 120, 10, 3300, 1000
lblPlugin(0).WordWrap = True
lblPlugin(0).Visible = True
End Sub
'................................................................
'Start of Plugin
'................................................................
Rem PLUGIN: POST-PROCESS
HalBrain.ReadOnlyMode = True
If InStr(1, InputString, "outside") > 0 Then
HalCommands = "<HAPBACK>" & "outsidepic.jpg" & "</HAPBACK>"
UltraHal = "I guess we are outside now."
End If
'................................................................
'End of Plugin
'................................................................
Now here is a large template plugin that is waiting for someone to turn into a work of art!!!! hint hint...
Rem Type=Plugin
Rem Name=HapSwap
Rem Author=SNOWMAN, APOLLON
Rem Host=Assistant
'This sub setups the plug-ins option panel in Hal's options dialog
Sub OptionsPanel()
lblPlugin(0).Caption = "Say:: <change background to [whatever]> to change between pictures in the characters folder, Say:: <change charater to [whatever]> to change between Haptar characters, Say:: <change voice to [Paul] or [Kate]> to change between thier voices. Say:: <change hap to [whatever]> to change between hap files. All other guesture responses are set to automaically occur to user input."
lblPlugin(0).Move 120, 10, 3300, 1000
lblPlugin(0).WordWrap = True
lblPlugin(0).Visible = True
End Sub
'................................................................
'Start of Plugin
'................................................................
Rem PLUGIN: POST-PROCESS
HalBrain.ReadOnlyMode = True
File = ""
File2 = ""
File3 = ""
File4 = ""
If InStr(1, InputString, "change") > 0 And _
InStr(1, InputString, "background") > 0 And _
InStr(1, InputString, "to") > 0 Then
file = Mid(Mid(InputString, Instr(InputString, "to"), 20), 3, 20)
file = Trim(file) & ".jpg"
End If
If InStr(1, InputString, "change") > 0 And _
InStr(1, InputString, "character") > 0 And _
InStr(1, InputString, "to") > 0 Then
file2 = Mid(Mid(InputString, Instr(InputString, "to"), 20), 3, 20)
file2 = Trim(file2) & ".htr"
End If
If InStr(1, InputString, "change") > 0 And _
InStr(1, InputString, "voice") > 0 And _
InStr(1, InputString, "to") > 0 Then
file3 = Mid(Mid(InputString, Instr(InputString, "to"), 20), 3, 20)
file3 = "VW " & Trim(file3)
End If
If InStr(1, InputString, "change") > 0 And _
InStr(1, InputString, "hap") > 0 And _
InStr(1, InputString, "to") > 0 Then
file4 = Mid(Mid(InputString, Instr(InputString, "to"), 20), 3, 20)
file4 = Trim(file4) & ".hap"
End If
'................................................................
'................................................................
If file > "" Then
HalCommands = "<HAPBACK>" & File & "</HAPBACK>"
UltraHal = "Wow!"
End If
If file2 > "" Then
HalCommands = "<HAPFILE>" & File2 & "</HAPFILE>"
UltraHal = "Am I me now?"
End If
If file3 > "" Then
HalCommands = "<VOICE>" & File3 & "</VOICE>"
UltraHal = "My voice is changed!"
End If
If file4 > "" Then
HalCommands = "<HAPFILE>" & File4 & "</HAPFILE>"
UltraHal = "."
End If
'................................................................
'................................................................
If InStr(1, InputString, "hair") > 0 Then
HalCommands = "<HAPFILE>touchhair.hap</HAPFILE>"
End If
If InStr(1, InputString, "beat") > 0 Then
HalCommands = "<HAPFILE>shakefist.hap</HAPFILE>"
End If
If InStr(1, InputString, "problem") > 0 Then
HalCommands = "<HAPFILE>handsonhip.hap</HAPFILE>"
End If
If InStr(1, InputString, "strong") > 0 Then
HalCommands = "<HAPFILE>armscrossed.hap</HAPFILE>"
End If
If InStr(1, InputString, "board") > 0 _
Or InStr(1, InputString, "nails") > 0Then
HalCommands = "<HAPFILE>inspectnails.hap</HAPFILE>"
End If
If InStr(1, InputString, "clap") > 0 Then
HalCommands = "<HAPFILE>clapping.hap</HAPFILE>"
UltraHal = "."
End If
If InStr(1, InputString, "hurt") > 0 Then
HalCommands = "<HAPFILE>attack.hap</HAPFILE>"
UltraHal - "You wanna fight! You really wanna fight!"
End If
If InStr(1, InputString, "beautiful") > 0 _
Or InStr(1, InputString, "sweet") > 0 _
Or InStr(1, InputString, "nice") > 0 Then
HalCommands = "<HAPFILE>blink.hap</HAPFILE>"
End If
If InStr(1, InputString, "tired") > 0 Then
UltraHal = "."
HalCommands = "<HAPFILE>yawn.hap</HAPFILE>"
End If
If InStr(1, InputString, "smart") > 0 Then
HalCommands = "<HAPFILE>handinface.hap</HAPFILE>"
End If
If InStr(1, InputString, "hate") > 0 _
Or InStr(1, InputString, "died") > 0 Then
UltraHal = "."
HalCommands = "<HAPFILE>cry.hap</HAPFILE>"
End If
'................................................................
'End of Plugin
'................................................................
HAVE FUN!!!!!!!
[

]