AI Zone Admin Forum Add your forum

NEWS: Chatbots.org survey on 3000 US and UK consumers shows it is time for chatbot integration in customer service!read more..

Calling :reset command from script
 
 

Hi Bruce,
I would like to call the :reset command, from simplecontrol.top.

Is this possible? If so, how is it done?

 

 
  [ # 1 ]

I have tried using

^system( ^reset() )

and

^system( reset )

But it says, it is not recognized as an internal or external command etc.

 

 
  [ # 2 ]

:reset is a testing command. Such commands can be attempted from script using ^execute

 

 
  [ # 3 ]

Thanks for replying Bruce.

I have this code to reset the user, as per the manual

^reset ( what ? ) – what can be user or topic or factset. If user, the system drops all history and starts the user afresh from first meeting.

u: ("restart xxx"
 :
execute ^reset($login

But I get the following text

output:
result code: 2

Then it triggers my catch all responder at the bottom of the topic, so it must be a failure of some kind.

 

 

 
  [ # 4 ]

I haven’t been able to make any other syntax work.

^execute(^reset()) won’t compile.

It says call to function not yet defined ^execute

 

 
  [ # 5 ]

What I need is a way to reset everything to the point when a new user is created.

The reason for this is I am copying facts to ChatScript when I talk to a bot and I am copying facts back to the client, when I stop talking to the bot.

The facts can also be changed by the client, while it is not talking to the bot.

 

 
  [ # 6 ]

Okay I got it to work with the following.

u: ("restart xxx"
 :
reset($login

It said, We start anew.

 

 
  [ # 7 ]

Turns out I already have code to reset indivdual topics. So all I need is to destroy unwanted facts and this code does it:

#Destroy facts by subject
 
@= ^query(direct_s ^subject_name)
 if (@
0)
 
{
  
^delete(@0)
 
 

 
  [ # 8 ]

then I guess you don’t need me…

 

 
  [ # 9 ]

In this instance, perhaps not, but we’ll always need you around. smile

 

 
  [ # 10 ]

Indeed we will. smile

 

 
  [ # 11 ]

RIght.

The general answer is you can call script functions from command as :evaluate ^fn()
and you can call command functions from script as ^eval( :trace all)

 

 
  [ # 12 ]

Nice. That will be very useful. Thanks Bruce.

Something I noticed about my ChatScript version is ^eval() creates compile errors, if it is called from within an outputmacro. Don’t know if that is a bug, or it is intentional.

 

 
  login or register to react