Sitelet https://github.com/aichaos/rivescript-python/issues/122
Skip to content

! var definition is ignored #122

Description

@oakandsage

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.

Activity

kirsle commented on Jun 14, 2018

@kirsle
Member

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>

oakandsage commented on Jun 14, 2018

@oakandsage
Author

snoopyjc commented on Mar 22, 2020

@snoopyjc
Contributor

I agree naming the command "! var" to set them and to get them is confusing. Same applies to the other types of variables.

johnnymast commented on Feb 13, 2022

@johnnymast

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions