Author Topic: Help with If Command  (Read 1281 times)

0 Members and 1 Guest are viewing this topic.

MrSirViking

  • Youngling
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
  • Twitch Name: MrSirViking
Help with If Command
« on: April 30, 2018, 05:16:04 AM »
Hey good people

I am trying to make a command for Xsgtpepperx. What i am trying to use is the: @if@[data||matchWith||matchedResult||FailResult]. So what i have done is this: !addcom !nap @if@[@target@||@target@||@target@ have a good nap ResidentSleeper|| @user@ have a good nap ResidentSleeper] 

what this should do is that if i do !nap horse it will display horse have a good nap but if i dont do a @target@ it should do @user@ so then display mrsirviking have a good nap. And it works.. It just dosent grab the @user@. if i do target it does @target@ have a good nap. if i dont do @target@ it just does have a good nap. It skips the @user@. Anyway to not get it to skip the @user@?

Thanks :)

TheNumbLock

  • Advisor
  • Councilor
  • **
  • Posts: 4776
  • Karma: +137/-5
    • View Profile
  • Twitch Name: TheNumbLock
Re: Help with If Command
« Reply #1 on: April 30, 2018, 09:50:22 PM »
Basically you reverse the @if@. So in the below one I posted, it will look for a target after the command, if no target, then it will do @user@ one, and if you put something after the command, it will do the @target@. Here you go:

!addcom !nap @if@[@target@||||@user@ have a good nap ResidentSleeper||@target@ have a good nap ResidentSleeper] 
Old Name: RepentGamingTV
Twitch: Here

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

MrSirViking

  • Youngling
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
  • Twitch Name: MrSirViking
Re: Help with If Command
« Reply #2 on: May 01, 2018, 12:02:52 AM »
Thanks! i almost had it. So thanks for the help :)