dupa

Author Topic: FUNCTION : ADD ALICE to ANY BRAIN  (Read 3926 times)

spydaz

  • Hero Member
  • *****
  • Posts: 670
    • View Profile
    • http://www.spydazweb.co.uk/
FUNCTION : ADD ALICE to ANY BRAIN
« on: April 30, 2004, 11:14:52 am »
After reading all the posts on alice I think I CRACKED IT.

The script i wrote & TESTED SEEMS TOO WORK FINE.

I wanted to turn ALICE into A FUNCTION. So that when We are Building CUSTOM brains ALICE could be added To all.

FIRST:


    'PROCESS: CREATE HALBRAIN ACTIVEX OBJECT
    'These ActiveX controls contain many functions
   'needed for the script to process a sentence.

   Set HalBrain = CreateObject("UltraHalAsst.Brain")
        Set WN = CreateObject("UltraHalAsst.WordNet")
        Set Alice = CreateObject("HalAlice.PlugIn")
   Set Alice = Nothing

THAT BIT IS NEEDED TO SET UP ALICE :


THEN When YOU wish to call ALICE (check for response) in the BRAIN *.UHP Insert script .... :


'--------------------------------------------
'RESPOND: CALL CheckALICEBRAIN FUNCTION
'--------------------------------------------
   'This function will check for insults and swearing and respond to them. It is built into this script,
   'so you can edit it.
   CheckALICEBRAIN = Trim(ALICEBRAIN(UserSentence,UserName,ComputerName,LearningLevel,WorkingDir,Hate,Swear,Insults,Compliment,PrevSent,LastResponseTime,PrevUserSent))
   If Len(CheckALICEBRAIN) > 4 And GetResponseBlock <> True Then
      GetResponse = GetResponse & CheckALICEBRAIN & VbCrLf
      AvoidBeingFlag = True
      DebugInfo = DebugInfo & "The user has CheckALICEBRAIN  : " & CheckALICEBRAIN & VbCrLf
       Else
        DebugInfo = DebugInfo & "hal has not used the alice brain: " & CheckALICEBRAIN & VbCrLf
   End If


'--------------------------------------------


THEN AT THE END OF THE SCRIPT : After the getreponse Function is CLOSED.

'--------------------------------------------
' ALICEBRAIN FUNCTION
'--------------------------------------------
Function ALICEBRAIN(ByVal UserSentence, ByVal UserName, ByVal ComputerName, ByVal LearningLevel, ByRef WorkingDir, ByRef Hate, ByRef Swear, ByRef Insults, ByRef Compliment, ByRef PrevSent, ByRef LastResponseTime, ByRef PrevUserSent)
    'CREATE HALBRAIN ACTIVEX OBJECT
   'This ActiveX control contains many functions
   'needed for the script to proccess a sentence.
    Set Alice = CreateObject("HalAlice.PlugIn")
'GET RESPONSE
        ALICEBRAIN = Alice.Respond(UserSentence, UserName, WorkingDir, "data\bot.ini", "loglocaluser.txt")
    Set Alice = Nothing
End Function

'--------------------------------------------


This way you can choose where the script is called by placing the 'RESPOND: CALL CheckALICEBRAIN FUNCTION, Earlier or later.


SEE HOW IT GOES...

I HAVE DONE ONE INSIDE THE BLANK SLATE BRAIN AS AN EXAMPLE :

It works in all the brains ive tried so far EVEN All the FAMOUS COMBO's.

GOOD LUCK
SPYDAZ



[:)][:D][8D][:I][:p][}:)][;)][:o)][B)][8][:(][8)][:0][:(!][xx(][|)][:X][^][V][?]

MIXED FEELINGS

Download Attachment: VITAL_2004_AliceBrain.txt
10 KB