rivescript-python
rivescript-python copied to clipboard
! var definition is ignored
Using version 1.14.9, with the following begin.rive
! version = 2.0
! var myvar = hello
+ print
- myvar is <get myvar>
I expect that the user input print
will result in myvar is hello
but instead, it results in myvar is undefined
I also tried putting the print
trigger into a different file titled hello.rive but this didn't change the behavior.
Hi
! var myvar = hello
sets a bot variable named myvar
and you'd retreive it with <bot myvar>
User variables are set with <set>
and retrieved with <get>
.
! version = 2.0
! var myvar = hello
+ print
- myvar is <bot myvar>
Oh, that makes sense. Thanks... Sorry for the bad issue. My problem was that I was going off the code snippets in the tutorial, which briefly mentions bot variables and then goes back to discussing user variables with the same name, so I didn’t correctly identify which code snippets were related to ! var. I guess it doesn’t even make sense to initialize user variables that way, since that would create issues in a multi-user environment.
On Jun 14, 2018, at 8:43 AM, Noah Petherbridge [email protected] wrote:
Hi
! var myvar = hello sets a bot variable named myvar and you'd retreive it with
User variables are set with
and retrieved with . ! version = 2.0
! var myvar = hello
- myvar is
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.
I agree naming the command "! var" to set them and
Hi, Author of Rivescript-PHP here, This is kind of off-topic but the Rivescript specs also dictate you can set bot variables in responses. This is something I missed while implementing the bot command.
+ init
- <bot name=Johnny>done.
+ what is your name
- my name is <bot name>
I know this is off the topic of this issue but I assume not many developers know of this ability.