Author Topic: How do I use @if@ variables with Deepbot?  (Read 2861 times)

0 Members and 1 Guest are viewing this topic.

Nazo

  • Padawan
  • **
  • Posts: 70
  • Karma: +2/-0
  • Expert on Twitch Bots
    • View Profile
  • Twitch Name: OverlordNazo
How do I use @if@ variables with Deepbot?
« 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@.  :-[
★ Twitch Bot Expert ★


YouTube: Lord Nazo
Twitch: OverlordNazo
Twitter: @Lord_Nazo

emrerocky

  • Advisor
  • Councilor
  • **
  • Posts: 1240
  • Karma: +163/-8
    • View Profile
    • emrerocky's Website
  • Twitch Name: emrerocky
Re: How do I use @if@ variables with Deepbot?
« Reply #1 on: December 11, 2015, 10:41:12 AM »
Hello, may I ask how you have access to DeepBot?

Nazo

  • Padawan
  • **
  • Posts: 70
  • Karma: +2/-0
  • Expert on Twitch Bots
    • View Profile
  • Twitch Name: OverlordNazo
Re: How do I use @if@ variables with Deepbot?
« Reply #2 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)
« Last Edit: December 12, 2015, 05:35:32 AM by LordNazo »
★ Twitch Bot Expert ★


YouTube: Lord Nazo
Twitch: OverlordNazo
Twitter: @Lord_Nazo

TheNumbLock

  • Advisor
  • Councilor
  • **
  • Posts: 4776
  • Karma: +137/-5
    • View Profile
  • Twitch Name: TheNumbLock
Re: How do I use @if@ variables with Deepbot?
« Reply #3 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
Old Name: RepentGamingTV
Twitch: Here

Need help ASAP?
Join Deepbot's Discord: Discord.Deepbot.tv
Deepbot's Twitter: @DeepSupport

Nazo

  • Padawan
  • **
  • Posts: 70
  • Karma: +2/-0
  • Expert on Twitch Bots
    • View Profile
  • Twitch Name: OverlordNazo
Re: How do I use @if@ variables with Deepbot?
« Reply #4 on: December 15, 2015, 02:14:34 AM »
(Sorry for the late response.) Thank you for the detailed explanation! :)
★ Twitch Bot Expert ★


YouTube: Lord Nazo
Twitch: OverlordNazo
Twitter: @Lord_Nazo