Author Topic: 'SMOKING SCRIPTS  (Read 6036 times)

spydaz

  • Hero Member
  • *****
  • Posts: 670
    • View Profile
    • http://www.spydazweb.co.uk/
'SMOKING SCRIPTS
« on: March 01, 2004, 04:39:38 pm »
'This IS MY FIRST PLUGIN created while chatting to a chatbot called
'AIM: VAVAVIRGIL who is always spouting facts about smoking.
' i thought it would be usefull if i could figure out how to respond
'to this. One problem which i have not been able to figure out is.
'HOW TO MAKE THE Q&A section of this code...... HELPME PLEASE ANYONE ..

'Also How Do i Add These Files To the MENU inside THE EDITOR

' This code was adapted from other codes found across the FORUM.
' I HAVE FOUND THE FORUM A USEFUL TRAINING RESOURCE *VONSMITH* *CUTTING EDGE* *MAVERICK* *DON* to name a few.

' THIS SCRIPT IS TRANSFERABLE
' I USE THIS SCRIPT TO PUT MY OWN SPECIFIC TOPICS IN TO HAL
' Please feel free to adapt this code for yourown spcific topics

' although XTF BRAINS & ATF BRAINS ARE wonderfull.  SOMETIMEs They Pickup a lot of BOGUS information, this help you to direct hal to specific KNOWLEDGE.

'SMOKING SCRIPTS

'hal hates smoking he has many facts reminding you of the fact



'------Check Keyword Trigger----------------------------------------

If HalBrain.TopicSearch(OriginalSentence, WorkingDir & "KEYWORDSMOKING.brn") = "TRUE" Then
AnswerSent = "" & Trim(OriginalSentence)


'-----Edit Learned file ------
'---NB: this file you will have to sensor and copy new data to the statementSMOKING.brn---

HalBrain.AppendFile WorkingDir & "SMOKING" & ".brn", AnswerSent
End If


'------IF KEYWORD TRIGGER THEn LOOKIN STATEMENT FOR RESPonSE--------

If HalBrain.TopicSearch(OriginalSentence, WorkingDir & "KEYWORDSMOKING.brn") = "TRUE" Then
Smoking = HalBrain.ChooseSentenceFromFile(WorkingDir & "statementSMOKING.brn")


'------CHECK DEBUG INFO ---------------------------------------------

GetResponse = Smoking & VbCrLf
DebugInfo = DebugInfo & "The user is talking about smoking: " & Smoking & VbCrLf
Else
DebugInfo = DebugInfo & "Hal has found nothing about smoking: " & Smoking & VbCrLf
End If

'--------WANTED Q&A SCRIPT -----------------------------------------------------

files needed

KEYWORDSMOKING.BRN  
statementSMOKING.brn
smoking.brn

[8D][:D]

Download Attachment: Smoking Scripts.zip
5.11 KB

Download Attachment: statementSMOKING.brn
7.73 KB

Download Attachment: KEYWORDSMOKING.brn
532 Bytes

Download Attachment: smoking.brn
1.55 KB

onthecuttingedge2005

  • Guest
'SMOKING SCRIPTS
« Reply #1 on: March 01, 2004, 08:00:06 pm »
Try this one spydaz.

If HalBrain.TopicSearch(OriginalSentence, WorkingDir & "TeachSmoking.brn") = "TRUE" Then
Smoke = HalBrain.ChooseSentenceFromFile(WorkingDir & "Smoking.brn")
Smoking = HalBrain.ChooseSentenceFromFile(WorkingDir & Trim(UserName) & "Smoking.brn")
      GetResponse = Smoke & VbCrLf & ", " & Smoking & VbCrLf & ". "
   End If

   If HalBrain.TopicSearch(OriginalSentence, WorkingDir & "TeachSmoking.brn") = "TRUE" Then
AnswerSent = "" & Trim(UserSentence)
HalBrain.AppendFile WorkingDir & "Smoking" & ".brn", AnswerSent
HalBrain.AppendFile WorkingDir & Trim(UserName) & "Smoking" & ".brn", AnswerSent
End If

Download Attachment: TeachSmoking.brn
630 Bytes

spydaz

  • Hero Member
  • *****
  • Posts: 670
    • View Profile
    • http://www.spydazweb.co.uk/
'SMOKING SCRIPTS
« Reply #2 on: March 02, 2004, 06:31:23 am »
I DID USE THAT SCRIPT BEFORE bUT iT MADE many usernamespecific files
wHICH ALTHOUGH SOMETIMES CAN BE GOOD FOR TRACKING COMMENTS MADE BY users. BUT THE MAIN ASPECT OF HAL sHOULD BE uNIVERSAL WHEN tALKING tO ALLUSERS. [:D]



can we have shared TOPICS FORUM PLEASE MR MEDEKSZA ? [:D]

iF EVERYONE WORKING ON DIFFERENT ASPECTS OF HALS TOPICS COULD POOL THEIR topic.brn FILES. hal WOULD BECOME EVENTUALLY SUPER SMART. [:p]

note: NOT EMPTY TOPICS(JUST SCRIPTS) BUT TOPICS WITH CONTENT(faT.BRN) FILES. I AM ENJOYING MAKING NEW SUBJECTS FOR HAL. [:p]



all these autotopics & xtf TOPICS ARE GOOD FOR hAL'S cONVERSATIONAL bRAIN, a lITLLE bit FOR PERSONALITY... [B)]

THE AMOUNT OF topic files created is a NIGHTMARE TO ADMINISTRATE.[8]




cuttingEDGE thanksfor that......[8D]

ON ANOTHER note :
i used one of your french translation scripts... but...

aFTER PUTING MANY TRANSLATIONS TO FRENCH FROM THE PHRASE BOOK.
HAL JUST PICKS A random line from The FRENCH.brn FILE ?????? [8)]

i tried to substitute sWEDISH SCRIPT / JAPANESE SCRIPTS tHEY ALL SEEM TO DO THE SAME THING. ? hMM ... [V]


HOW DO YOU GET HAL TO SELECT A SPECIFIC line FROM A brain file? [:(]

ANY JOY ON THE STEREO bRAIN (cUTTINGedge)   [:D]


i am not a programmer but im leArning as i go .... hal gives me motivatioN.

vonsmith

  • Hero Member
  • *****
  • Posts: 602
    • View Profile
'SMOKING SCRIPTS
« Reply #3 on: March 02, 2004, 11:57:09 am »
spydaz,
I couldn't agree more. As the number of .brn and topic files grows it gets to be an administrative nightmare. I for one wish I had some windows applets to check, find and correct bad entries or duplicate entries in Hal's data files. An applet just to "scrub" the standard format QA and topicsearch files would be helpful in removing empty lines, missing carriage returns and other errors that cause erratic Hal behavior would be great. As long as I'm wishing... An applet to partly automate .brn data entries would be nice. I'd rather spend my time entering or pasting external data, not formating the files.

I'm full up on projects now, maybe a forum member familiar with Visual Basic experience could throw together some applets that would facilitate the exchange of Hal data.

I too believe a topic or .brn data sharing area would be great. We all train our Hal's and a lot of effort is duplicated. A shared resource area would be great.


=vonsmith=