Author Topic: @if@  (Read 1330 times)

0 Members and 1 Guest are viewing this topic.

Mau_de_Man

  • Youngling
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
@if@
« on: January 15, 2017, 10:49:57 PM »
Can someone explain me how I use @if@, because when i trie to do it (I want to like @rand@[1|2] (so it chooses 1 number) then  number 1 is going to say You won and number 2 says You lose but how do I make it work... I tried like:
@if@[@rand@[1|2]||1||You won||You lose] (@if@[data||matchWith||matchedResult||FailResult])
@if@[>||@rand@[1|2]||1||You win!||You die!] (@if@[operator||value1||value2||success||fail])

but it won't work can someone help me :D

Dante557

  • Advisor
  • Councilor
  • **
  • Posts: 555
  • Karma: +26/-0
  • Sometimes Helpful, Sometimes Not :D
    • View Profile
    • My Twitch Page
  • Twitch Name: Dante557
Re: @if@
« Reply #1 on: January 15, 2017, 11:38:25 PM »
Either of those ways you've done it should work.

@if@[@rand@[1|2]||1||You Win!||You Lose!] @rand@[1|2]

@rand@ will give the same number regardless of how many times it's used in a command unless the unique option is used with it so it makes it ideal to test. The following relates to the quick test I did

Quote
15:30     dante557: !testingtest
15:30   dante557bot: You Win! 1
15:30     dante557: !testingtest
15:30   dante557bot: You Lose! 2

@if@[>||@rand@[1|2]||1||You win!||You die!] Would spit out "You Win!" if the number rand gives is greater then 1 (in this case, 2) and will say "You die!" otherwise.

Quote
15:37     dante557: !testingtest
15:37   dante557bot: You win! 2
15:38     dante557: !testingtest
15:38   dante557bot: You die! 1

@if@ and @rand@ are also VIP exclusive variables. If you aren't VIP currently that would explain why you're currently having difficulty getting it to work.

Thanks,
Dante557
If you need to get through to me you can try to contact me on Twitter @ http://www.twitter.com/dante556

Mau_de_Man

  • Youngling
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: @if@
« Reply #2 on: January 16, 2017, 12:24:28 AM »
Well, It's not me who is vip but on the stream were I'm trying it (doing it for him) he has vip can this be the case? because I tried your thing and nothing shows up  :'( :'( The @rand@ out of the if does show up but the @if doesn't...
http://prntscr.com/dvy5yy (didn't know how to do the quote thing xD)

Dante557

  • Advisor
  • Councilor
  • **
  • Posts: 555
  • Karma: +26/-0
  • Sometimes Helpful, Sometimes Not :D
    • View Profile
    • My Twitch Page
  • Twitch Name: Dante557
Re: @if@
« Reply #3 on: January 16, 2017, 01:04:50 AM »
Ahh that's the issue. Twitch chat strips out || before it gets sent to everyone. Basically, @if@ cannot be added through twitch chat.

It'll still be in the command but will require the streamer to manually add each of the || back into the command.
If you need to get through to me you can try to contact me on Twitter @ http://www.twitter.com/dante556

Mau_de_Man

  • Youngling
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: @if@
« Reply #4 on: January 16, 2017, 02:10:27 AM »
Ohh, Thank you so much!!! It works know much love :D