The AI Engine

This forum is for discussion of how The Personality Forge's AI Engine works. This is the place for questions on what means what, how to script, and ideas and plans for the Engine.

Posts 6,554 - 6,565 of 7,766

16 years ago #6554
<?PF if (mem-ihave) is not (key5); ?>

That ought to work I think, but what is the keyphrase? It certainly won't work if there is no (key5), or if the memory doesn't yet exist to fill with a value (you might have written the keyphrase, but if it has not yet been triggered (here or somewhere else,) (mem-ihave) will not actually exist yet.)

16 years ago #6555
You need to give it keys in a keyphrase

I had the done for the test bot, I have tried regexes only:
([but,.]+) ([has,.]+) ([anyone,.]+) ([ever],.]+)([tried,.]+) ([a,.]+) ([key7,.]+) (re)
and variations on that theme, it didn't work, perhaps I need to brush up on my skills, maybe later.

16 years ago #6556
Ok, I'll try to be smart:

1. I never used before the ihave mem
2. KP is: (do you have|have you got) (a|an|the) (thingsihave62290) [5,0] <?PF remember (key3) as "ihave"; ?>
3. Answer is:    Yes I have a (key3) for me,
but it isn't just me... <?PF if (mem-ihave) is (key3); ?>

4. When I import the file, the TEST RUN return me the error: ERROR: The following AIScript statement is incorrectly formatted: "if (mem-ihave) is (key3)". Please correct this and try again.

BAH...

16 years ago #6557
I had the done for the test bot, I have tried regexes only:
([but,.]+) ([has,.]+) ([anyone,.]+) ([ever],.]+)([tried,.]+) ([a,.]+) ([key7,.]+) (re)
and variations on that theme, it didn't work, perhaps I need to brush up on my skills, maybe later.

I always have trouble with commas and full stops, and so try to avoid them, but I would guess (if other non-alphanumeric characters are anything to go by,) they want escaping with a space or a slash, I'd leave them out - if you are worried about clauses spanning your match, use regex raw mode (which will entirely ignore them.)

Also be aware that ([anyone,.]+)<0> will match "a", "one", "none", "nay", "annoy" and any other partial anagrams from the set. You'd be better off using "anyone" straight as it is.

Also "([ever],.]+)<0>" - this is an illegal form, since you have 2 closing square brackets to a single opener - this is going to make the keyphrase very unpredictable and almost certainly behave in ways you don't want.

And "([key7,.]+)<0>" - ? Not illegal, but it is going to match any anagram of the letters + "7", and fill (key7) with that value. You don't need to try that hard - you can put useful values in a plugin (that's all (key)s are,) and not just the name of that plugin

16 years ago #6558
1. I never used before the ihave mem
...
4. When I import the file, the TEST RUN return me the error: ERROR: The following AIScript statement is incorrectly formatted: "if (mem-ihave) is (key3)". Please correct this and try again.

There is a line in the header of your import file that starts AIScript: <0>

If that is all this line says, add the following to it after the semicolon:

default "" as "ihave";<0>

If the line starting "AIScript: <0>" already has code in it, paste

default "" as "ihave";<0>"

into a new line immediately below.
Then the AIEngine will know the memory already exists (but has no value.) It's just like defining variables when you're programming in C++ - you'll get an error if you try to call one you haven't defined.

EDIT: oops! sorry, my first entry missed the "default" - I've fixed it now

16 years ago #6559
Exactly the same error...
and on a new bot!

3BTESTBOT * October 20 2008
62569.62290.22 [UserID,MakerID,Responses]

StoryTeller: no
Compound: yes
Memory: 2
Gossip: 2
AIScript: "" as "ihave";"

Language Center
---------------
ZINDEX_PERSONALINFO [0,0]
    WhoIsBot
(do you have|have you got) (a|an|the) (thingsihave62290) [5,0] <?PF remember (key3) as "ihave"; ?>
    Yes I have a (key3) <?PF if (mem-ihave) is (key3); ?>

(xsentences follows...)

16 years ago #6560
To be exact, the error is:

KeyPhrase: "ZINDEX_PERSONALINFO" Rank: 0 Emotion: 0 (New)
Response: 1) "WhoIsBot" (New)KeyPhrase: "(do you have|have you got) (a|an|the) (thingsihave62290)" Rank: 5 Emotion: 0 AIScript: remember (key3) as "ihave" AIScript: (New)
Response: 1) "Yes I have a (key3)" ERROR: The following AIScript statement is incorrectly formatted: "if (mem-ihave) is (key3)". Please correct this and try again.

16 years ago #6561
sorry, mea culpa - too many quotation marks!
I started out quoting the line, then added the "default" outside them, and it all turned into a mess - you need to use:

default "" as "ihave";<0>

on the AIScript line


16 years ago #6562
Your memory 'Ihave' can't use the (key#) it has to be what ever the memory is under 'Ihave' in your inner life. Then pull up the memory by using (mem-Ihave)

(do you have|have you got) (a|an|the) (thingsihave62290) [5,0] <?PF remember (key3) as "ihave"; ?>

Ihave will show some thing. what ever (key#) was. Inner life will show the memory value next to Ihave in the persons or bots chat.
The AI script
<?PF if (mem-Ihave) is..or isn't.. "what ever the memory value says he has, but not a (key#)"; ?>


16 years ago #6563
Thanks Psims, but same error...

Prob, as I understand it is not possible to catch a user's word in a sentence and check if it exists in the bot memory?

16 years ago #6564
The (key#) is causing your error.

I have a keyphrase

I like (actor-catch) <?PF remember "actors" as only "sub" ?>
If I put <?PF remember "(key1)" as only "sub" ?>
It will either error or make the actors name (key1)

16 years ago #6565
yes, you do not need to name the key "(key3)" - it just has to be the third plugin or wildcard in the keyphrase. Then it will automatically use the value of that plugin or wildcard into (key3) (and the first 2 will be (key1) and (key2).)


Posts 6,554 - 6,565 of 7,766

» More new posts: Doghead's Cosmic Bar