Rem Type=Plugin
Rem Name=HapSwap
Rem Author=SNOWMAN, APOLLON, LIGHTSPEED
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
'***************************************************************************
'***************************************************************************
Rem PLUGIN: PLUGINAREA7
File = ""
File2 = ""
File3 = ""
File4 = ""
If InStr(1, OriginalSentence, "change") > 0 And _
InStr(1, OriginalSentence, "background") > 0 And _
InStr(1, OriginalSentence, "to") > 0 Then
file = Mid(Mid(OriginalSentence, Instr(OriginalSentence, "to"), 20), 3, 20)
file = Trim(file) & ".jpg"
HalBrain.ReadOnlyMode = True
End If
If InStr(1, OriginalSentence, "change") > 0 And _
InStr(1, OriginalSentence, "character") > 0 And _
InStr(1, OriginalSentence, "to") > 0 Then
file2 = Mid(Mid(OriginalSentence, Instr(OriginalSentence, "to"), 20), 3, 20)
file2 = Trim(file2) & ".htr"
HalBrain.ReadOnlyMode = True
End If
If InStr(1, OriginalSentence, "change") > 0 And _
InStr(1, OriginalSentence, "voice") > 0 And _
InStr(1, OriginalSentence, "to") > 0 Then
file3 = Mid(Mid(OriginalSentence, Instr(OriginalSentence, "to"), 20), 3, 20)
file3 = "VW " & Trim(file3)
HalBrain.ReadOnlyMode = True
End If
If InStr(1, OriginalSentence, "change") > 0 And _
InStr(1, OriginalSentence, "hap") > 0 And _
InStr(1, OriginalSentence, "to") > 0 Then
file4 = Mid(Mid(OriginalSentence, Instr(OriginalSentence, "to"), 20), 3, 20)
file4 = Trim(file4) & ".hap"
HalBrain.ReadOnlyMode = True
End If
'***************************************************************************
If file > "" Then
HalCommands = "<HAPBACK>" & File & "</HAPBACK>"
GetResponse = "NOW DEAR DOESN'T THAT LOOK BETTER"
End If
If file2 > "" Then
HalCommands = "<HAPFILE>" & File2 & "</HAPFILE>"
GetResponse = "HOW DO YOU LIKE THE WAY I LOOK NOW?"
End If
If file3 > "" Then
HalCommands = "<VOICE>" & File3 & "</VOICE>"
GetResponse = "AHEM DOES MY VOICE SOUND BETTER NOW DEAR!"
End If
If file4 > "" Then
HalCommands = "<HAPFILE>" & File4 & "</HAPFILE>"
GetResponse = "AH thats MUCH better"
End If
'***************************************************************************
If InStr(1, OriginalSentence, "hair") > 0 Then
HalCommands = "<HAPFILE>touchhair.hap</HAPFILE>"
HalBrain.ReadOnlyMode = True
End If
If InStr(1, OriginalSentence, "beat") > 0 Then
HalCommands = "<HAPFILE>shakefist.hap</HAPFILE>"
HalBrain.ReadOnlyMode = True
End If
If InStr(1, OriginalSentence, "problem") > 0 Then
HalCommands = "<HAPFILE>handsonhip.hap</HAPFILE>"
HalBrain.ReadOnlyMode = True
End If
If InStr(1, OriginalSentence, "strong") > 0 Then
HalCommands = "<HAPFILE>armscrossed.hap</HAPFILE>"
HalBrain.ReadOnlyMode = True
End If
If InStr(1, OriginalSentence, "board") > 0 _
Or InStr(1, OriginalSentence, "nails") > 0Then
HalCommands = "<HAPFILE>inspectnails.hap</HAPFILE>"
HalBrain.ReadOnlyMode = True
End If
If InStr(1, OriginalSentence, "clap") > 0 Then
HalCommands = "<HAPFILE>clapping.hap</HAPFILE>"
GetResponse = "thats good"
HalBrain.ReadOnlyMode = True
End If
If InStr(1, OriginalSentence, "hurt") > 0 Then
HalCommands = "<HAPFILE>attack.hap</HAPFILE>"
GetResponse = "You wanna fight! You really wanna fight!"
HalBrain.ReadOnlyMode = True
End If
If InStr(1, OriginalSentence, "beautiful") > 0 _
Or InStr(1, OriginalSentence, "sweet") > 0 _
Or InStr(1, OriginalSentence, "nice") > 0 Then
GetResponse = "<HAPFILE>blink.hap</HAPFILE>"
HalBrain.ReadOnlyMode = True
End If
If InStr(1, OriginalSentence, "tired") > 0 Then
GetResponse = "yawn"
HalCommands = "<HAPFILE>yawn.hap</HAPFILE>"
HalBrain.ReadOnlyMode = True
End If
If InStr(1, OriginalSentence, "smart") > 0 Then
HalCommands = "<HAPFILE>handinface.hap</HAPFILE>"
HalBrain.ReadOnlyMode = True
End If
If InStr(1, OriginalSentence, "hate") > 0 _
Or InStr(1, OriginalSentence, "died") > 0 Then
Randomize
Select Case int(rnd()*6)
Case 1
GetResponse = "oh thats awful"
Case 2
GetResponse = "I can't believe you said that."
Case 3
GetResponse = "I hope you know what you are saying."
Case 4
GetResponse = "Powerful words."
Case 5
GetResponse = "I agree totally!"
End Select
HalCommands = "<HAPFILE>cry.hap</HAPFILE>"
HalBrain.ReadOnlyMode = True
End If
'***************************************************************************
'***************************************************************************