aichaos / rivescript-js

A RiveScript interpreter for JavaScript. RiveScript is a scripting language for chatterbots.
https://www.rivescript.com/
MIT License
377 stars 144 forks source link

Capturing macro responses in % #322

Open hark444 opened 5 years ago

hark444 commented 5 years ago

Capture macro response in previous(%) commands. Can someone help me out in this.?

Rivescript Playground session: https://play.rivescript.com/s/tMGU7WYB1m

image

kirsle commented 5 years ago

The <call> tag is always the last one processed and its output can't mix with other tags.

As an alternative, try setting the user variable inside the object macro.

> object test javascript
    rs.setUservar( rs.currentUser(), "rivescript");
< object
hark444 commented 5 years ago

Hey Kirsle,

Thanks for the help.