|
|
Member
Total posts: 19
Joined: Apr 16, 2015
|
How do I allow a response to be repeated?
I have looked at ^noerase() ^keep() ^repeat. I need a working example.
|
|
|
|
|
Posted: Apr 23, 2015 |
[ # 1 ]
|
|
Moderator
Total posts: 2372
Joined: Jan 12, 2010
|
Depends on your intent.
^repeat() and the REPEAT topic control flag, allow an output to be issued even if it was issued recently.
^keep() prevents a top level rule from being erased when used and the KEEP topic control flag prevents responders from being erased when used.
topic: ~test keep repeat(test)
u: (test) this can be output any number of times when test is said
topic: ~test1 (test1)
u: (test1) ^repeat() this is test1
u: (test1) ^repeat() this is test1
The above would allow “this is test1” to be issued in succession, but it would come from different rules.
topic: ~test2 (test2)
u: (test2) ^keep() ^repeat() This is test2 issuable any number of times
|
|
|
|
|
Posted: Apr 23, 2015 |
[ # 2 ]
|
|
Moderator
Total posts: 2372
Joined: Jan 12, 2010
|
where are you seeing noerase in documentation?
|
|
|
|
|
Posted: Apr 23, 2015 |
[ # 3 ]
|
|
Member
Total posts: 19
Joined: Apr 16, 2015
|
thanks for the reply… trying it now.
noerase was in a google search, not in docs
|
|
|
|
|
Posted: Apr 23, 2015 |
[ # 4 ]
|
|
Moderator
Total posts: 2372
Joined: Jan 12, 2010
|
right. was OLD form, renamed to ^keep() a while back
|
|
|
|
|
Posted: Jan 24, 2016 |
[ # 5 ]
|
|
Member
Total posts: 23
Joined: Oct 28, 2015
|
Quick follow up to this.
If the system monitors itself, and is able to repeat itself after 20 outputs, how can I disable a gambit after its first use, so it isn’t reused, even >20 volleys later?
Thanks in advance, for the quick tip!
|
|
|
|
|
Posted: Jan 24, 2016 |
[ # 6 ]
|
|
Moderator
Total posts: 2372
Joined: Jan 12, 2010
|
the question is better asked how do you repeat one, since Gambits automatically disable themselves after use
|
|
|
|
|
Posted: Jan 24, 2016 |
[ # 7 ]
|
|
Member
Total posts: 23
Joined: Oct 28, 2015
|
Ah perhaps my issue is I am using KEEP as a topic flag.
If I want all my rules in a topic file to have KEEP applied to them, except the gambits, what do you recommend is the best approach?
|
|
|
|
|
Posted: Jan 24, 2016 |
[ # 8 ]
|
|
Moderator
Total posts: 2372
Joined: Jan 12, 2010
|
do what you did. KEEP as a topic flag has no effect on a gambit. ^keep() on a gambit does.
|
|
|
|
|
Posted: Jan 24, 2016 |
[ # 9 ]
|
|
Member
Total posts: 23
Joined: Oct 28, 2015
|
hmm. I am noticing that after ~20 volleys, if I input a keyword that triggers this topic, the gambit that has already fired (and has no ^keep() on it) will fire again.
Any thoughts on what else I might be missing here?
|
|
|
|
|
Posted: Jan 24, 2016 |
[ # 10 ]
|
|
Member
Total posts: 23
Joined: Oct 28, 2015
|
Oh jeez, Bruce. I’ve messed up here. I completely forgot I had modified that gambit into a u: responder. Sorry for the confusion!
My question is, then, how do I disable a single rule after it fires once, when the rest of the topic has a KEEP flag on it?
Sorry again for the confusion!
|
|
|
|
|
Posted: Jan 24, 2016 |
[ # 11 ]
|
|
Moderator
Total posts: 2372
Joined: Jan 12, 2010
|
AH… You have finally named the implied problem you were having, rather than requesting how to do things. But in the absence of almost any data, I don’t know, since your experience is contrary to chatscript design. Can you show me the code of the topic that has this issue? Ultimately, I probably need you to do :trace all and then repeat your problem and email me the log.
|
|
|
|
|
Posted: Jan 24, 2016 |
[ # 12 ]
|
|
Member
Total posts: 23
Joined: Oct 28, 2015
|
Here’s what the topic looks like:
topic: ~femaleromance keep (relationship love ~female_role_romantic)
u: (~female_romantic_subject) Is there anything troubling you about your relationship right now?
a: (~yesanswer) $relationshipissue = yes ^gambit(~)
My issue is that >20 volleys later, if the user inputs anything to do with their girlfriend (part of the ~female_romantic_subject concept I have created), this u: responder will fire again. I’d like to somehow “kill” the rule once it’s been used once.
Let me know if you’d still prefer me to send a copy of the trace.
Thanks Bruce!
|
|
|
|
|
Posted: Jan 24, 2016 |
[ # 13 ]
|
|
Moderator
Total posts: 2372
Joined: Jan 12, 2010
|
RIght now, of course, the rule is saved because of the keep flag on the topic. Assuming you want that for most responders BUT want this ONE rule to not follow that, then add this to the rule:
u: (~female_romantic_subject) ^disable(RULE ~) Is there anything troubling you about your relationship right now?
^disable(RULE is the inverse of ^keep()
|
|
|
|
|
Posted: Jan 24, 2016 |
[ # 14 ]
|
|
Member
Total posts: 23
Joined: Oct 28, 2015
|
Ah! Wonderful. I was trying this but failed to use “~” in the call. Thanks Bruce. I really appreciate your help here.
Things around coming together on my first chat bot, and I can’t tell you how thrilled I am to be learning and using this technology you have created. It’s fascinating. Thank you, again.
|
|
|
|