Deep Bot - Twitch Streamer Assistant

Deep Bot => Help/Support => Topic started by: Nazo on December 11, 2015, 04:41:07 AM

Title: How do I use @if@ variables with Deepbot?
Post by: Nazo on December 11, 2015, 04:41:07 AM
So, basically, what the title says. I am not entirely sure on how to use @if@ when making a command. Can someone give me a more detailed explanation on how @if@ works? (The Deepbot wiki does not do a very good job at explaining this.)

This is kinda sad 'cause I've been modding for multiple streamers and I still don't know how to use @if@.  :-[
Title: Re: How do I use @if@ variables with Deepbot?
Post by: emrerocky on December 11, 2015, 10:41:12 AM
Hello, may I ask how you have access to DeepBot?
Title: Re: How do I use @if@ variables with Deepbot?
Post by: Nazo on December 12, 2015, 05:01:12 AM
I don't have access to the program itself, but I have access to it in chat channels (where I'm a mod). I just make commands for streamers that use Deepbot. (I'm sorta like a Bot wiz, but not really LOL)
Title: Re: How do I use @if@ variables with Deepbot?
Post by: TheNumbLock on December 12, 2015, 06:03:47 AM
This is from another user from another post, which can be found here: http://deepbot.deep.sg/forums/index.php?topic=4931.msg25982#msg25982


Function: Checks two values. If they match, display some sample text. If they mismatch, display different sample text.

Arguments: @if@[data||matchWith||matchedResult||FailResult]

Possible Uses: You could use this for a coin flip to rewrite the RNG roll as "Heads" or "Tails".

Example command:

Code: [Select]
!coin
[Coin Flip!] Result: @if@[@rand@[1,2]||1||Heads||Tails]

If a user invokes this command and a "2" is rolled, they will see this:

Code: [Select]
[Coin Flip!] Result: Tails
Note that if you leave out the last argument (In this case, ||Tails) the @if@ statement will display the input data instead of any user-specified text if it mismatches.

Example:

Code: [Select]
!coin
[Coin Flip!] Result: @if@[@rand@[1,2]||1||Heads]

If a user invoked this command and a "2" was rolled instead of a "1", this text would be displayed:

Code: [Select]
[Coin Flip!] Result: 2
Title: Re: How do I use @if@ variables with Deepbot?
Post by: Nazo on December 15, 2015, 02:14:34 AM
(Sorry for the late response.) Thank you for the detailed explanation! :)