-
Notifications
You must be signed in to change notification settings - Fork 209
Functions Reference
Back to Plugins and Functions
The ^respond("topic_name")
function is used in the reply it takes the current input and check it against the selected topic more matches. Once it gets to the end of the topic it will unwind its way back and continue checking in the normal path.
> topic random
+ * i *
- ^respond("i_topic")
+ * you *
- ^respond("you_topic")
< topic
> topic i_topic
+ i am not *
- No, you aren’t!
+ i am *1
- Yes, you are!
< topic
> topic you_topic
+ you are not *
- No, I am not!
+ you are *1
- Yes, I am!
< topic
When the user says I am not a robot!
the system will match it with the * i *
rule and look first for a reply in gambits in the i_topic
topic
^topicRedirect("topic","trigger")
is used in the reply and is very similar to reply redirects except they redirect you to a reply in a specific topic.
> topic random
+ say something random
- ^topicRedirect("something_random","__say__")
< topic
> topic something_random
+ __say__
- Wind on the face is not good for you.
- I watched Mr. Dressup as a kid.
< topic
Since the trigger is just like any other match, we use a double underbar to indicate it is special. This notation is not required in your scripts.
Saves a user variable, let's say the first name:
+ [my name is] *1
- Hello <cap>! ^save("firstName",<cap>)
Returns a saved user variable. If in the previous example the user said My name is Rob
and the bot defined a user variable firstName
with the value Rob
, then this example will recall it and the bot will reply Hello Rob. Nice to see you again!
+ hello *
- Hello ^get("firstName"). Nice to see you again!
Additional details & examples needed.
Returns season (spring, summer, fall, winter)
Returns date 3, January 2015
Returns tommorrow's date (4, January 2015)
Returns The time is 9:00
Returns morning, afternoon or night
Returns day of week (Monday, Tuesday)
Returns month (January)
Allows performing various math functions
Returns I think it is (answer) or What do I look like, a computer? if not valid.
Returns I think it is (the roman number)
Returns I think it is (hex equivalent)
Returns I think it is (binary equivalent)
Returns I think it is (number) for a trigger like What number is missing from 1, 3, 5, 7
Returns "I think it is N" to find a number missing from an arithmetic or geometric sequence
Additional details & examples needed.
Back to Plugins and Functions