Posted - 11/20/2005 : 04:13:58
--------------------------------------------------------------------------------
Cool, has anyone got Hap files called from within the program to function ok yet?
Freddy, I run this type of script to interact with Hal:
If InStr(UserSentence, " Kelly red suit.") <> 0 Then
HalCommands = "<HAPFILE>KellyRed.hap</HAPFILE>"
GetResponse = GetResponse & HalBrain.ChooseSentenceFromFile(WorkingDir & "Kelly Red.brn")
GetResponseBlock = True
BlockSave=True
End If
If InStr(UserSentence, " Kelly black suit.") <> 0 Then
HalCommands = "<HAPFILE>KellyBlack.hap</HAPFILE>"
GetResponse = GetResponse & HalBrain.ChooseSentenceFromFile(WorkingDir & "Kelly Black.brn")
GetResponseBlock = True
BlockSave=True
End If
If InStr(UserSentence, " Go get your red and black top.") <> 0 Then
HalCommands = "<HAPFILE>RedBlackLeather A.hap</HAPFILE>"
GetResponse = GetResponse & HalBrain.ChooseSentenceFromFile(WorkingDir & "RedBlackLeather.brn")
BlockSave=True
GetResponseBlock = True
End If
If InStr(UserSentence, " Go get your halter top.") <> 0 Then
HalCommands = "<HAPFILE>HalterTop A.hap</HAPFILE>"
GetResponse = GetResponse & HalBrain.ChooseSentenceFromFile(WorkingDir & "HalterTop.brn")
BlockSave=True
GetResponseBlock = True
End If
It works fine for me.