There is a function ^poptopic. The Chatscript-system-functions-manual says:
ˆpoptopic( topicname )
Removes the named topic as a pending topic. The intent is not to automatically
return here in future conversation. If topicname is omitted, removes the current
topic AND makes the current topic fail execution at this point.
You can force a topic with:
ˆaddtopic( topicname )
adds the named topic as a pending topic at the head of the list. Typically you
don’t need to do this, because finding a reaction from a topic which is not a
system, disabled, or nostay topic will automatically add the topic to the pending
list. Never returns a fail code even if the topic name is bad.
Also there are topic control flags described in the chatscript-advanced-user-manual.
There is a “random” flag to randomly search the rules.
There is a “nostay” flag to not stay in the current topic which seems to be what you need.
topic: ~test random nostay ( test president stupidity stupid name )
u: (you are stupid) that is mean
u：(who is the president) Donald Trump
u：(what is your name) I told you my name, it is Harry
Also, Chatscript will not reuse the same rules once they have been used at least for awhile so if you are testing and it works the first time but not the second then that is why.
You can use “keep” and “repeat” on a topic if you want to test it repeatedly:
topic: ~test random nostay keep repeat ( test president stupidity )