Author Topic: Variables Check  (Read 1683 times)

0 Members and 2 Guests are viewing this topic.

RDBGaming

  • Youngling
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
  • Twitch Name: RDBGaming
Variables Check
« on: January 24, 2017, 05:16:28 PM »
Hi everybody,

So i want some custom commands in my bot, but i need to check on some things.
If the target is not empty and after that is the user exist.

Now i have some setup but it fails after the user exist check.
If the target is empty it gives the message fine, but after that it should check if the user exist but its not.

!hug
Code: [Select]
@if@[@target@||||@user@ You must name a target for you to hug!||!hug_2 @target@]
!hug_2
Code: [Select]
@if@[@target@||User not found||@user@ sorry but that is not a valid user||!hug_3 @target@]
!hug_3
Code: [Select]
GivePLZ @user@ Gives @target@ a BIG HUG TakeNRG
Can anyone help me with this ?

Regards,
RDBGaming

TheNumbLock

  • Advisor
  • Councilor
  • **
  • Posts: 4776
  • Karma: +137/-5
    • View Profile
  • Twitch Name: TheNumbLock
Re: Variables Check
« Reply #1 on: January 25, 2017, 10:00:02 AM »
!hug_2, will not be able to check if the user is a user. There really is no variable to grab/see if a user exists.

Basically how !hug_2 works, is it will check if @target@ is "User not found", meaning if Username=User Not found, then send message @user@ sorry but that is not a valid user.

My guess is you are trying to see @target@ from !hug is a real user, and if they are a real user, go to !hug_3. If not, say @user@ sorry but that is not a valid user.

What you could do is this for !hug_2:

@if@[@lookupinfo@[@l_lastseen@,@target@]||@l_lastseen@||@user@ sorry but that is not a valid user||!hug_3 @target@]



In case you want to import what I have, here is the Commands Import JSON code:

Code: [Select]
[{
  "command": "!hug",
  "group": "Hug",
  "status": true,
  "runAsBot": false,
  "runAsUserElevated": true,
  "startsWithEx": false,
  "message": "@if@[@target@||||@user@ You must name a target for you to hug!||!hug_2 @target@]",
  "description": "",
  "lastUsed": "2017-01-24T19:00:46.272097-07:00",
  "cooldown": 0,
  "accessLevel": 1,
  "soundFile": "",
  "costEnabled": false,
  "minPoints": 0,
  "minHours": 0,
  "costAll": 0,
  "costVIPViewer": 0,
  "costVIPB": 0,
  "costVIPS": 0,
  "costVIPG": 0,
  "costVIPMod": 0,
  "costVIPStreamer": 0,
  "OnScreenWidgetEnabled": false,
  "OnScreenWidgetName": "",
  "OnScreenWidgetTitle": "",
  "OnScreenWidgetMessage": "",
  "OnScreenWidgetImageLink": "",
  "OnScreenWidgetAnimMode": 0,
  "OBSRemoteEnabled": false,
  "OBSRemoteAction": 0,
  "OBSRemoteSceneName": "",
  "CommandChaningCmdName": "",
  "CommandChaningRunAfter": 0,
  "CommandChaningRunAsAdmin": false,
  "VIPModEnabled": false,
  "VIPModIfViewer": 0,
  "VIPModIfVIPB": 0,
  "VIPModIfVIPS": 0,
  "VIPModIfVIPG": 0,
  "VIPModAddDays": 30,
  "countdown": "2017-01-24T18:50:01.2537606-07:00",
  "counter": 9,
  "APITarget": false,
  "hideFromCmdList": false,
  "accessDeniedMsg": "",
  "noPointsMsg": "",
  "disableChanAccess": false,
  "disableWhisperAccess": false,
  "disableDiscordAccess": false,
  "isSoundVolumeSet": true,
  "soundVolume": 100
},
{
  "command": "!hug_2",
  "group": "Hug",
  "status": true,
  "runAsBot": false,
  "runAsUserElevated": true,
  "startsWithEx": false,
  "message": "@if@[@lookupinfo@[@l_lastseen@,@target@]||@l_lastseen@||@user@ sorry but that is not a valid user||!hug_3 @target@]",
  "description": "",
  "lastUsed": "2017-01-24T19:00:46.272097-07:00",
  "cooldown": 0,
  "accessLevel": 1,
  "soundFile": "",
  "costEnabled": false,
  "minPoints": 0,
  "minHours": 0,
  "costAll": 0,
  "costVIPViewer": 0,
  "costVIPB": 0,
  "costVIPS": 0,
  "costVIPG": 0,
  "costVIPMod": 0,
  "costVIPStreamer": 0,
  "OnScreenWidgetEnabled": false,
  "OnScreenWidgetName": "",
  "OnScreenWidgetTitle": "",
  "OnScreenWidgetMessage": "",
  "OnScreenWidgetImageLink": "",
  "OnScreenWidgetAnimMode": 0,
  "OBSRemoteEnabled": false,
  "OBSRemoteAction": 0,
  "OBSRemoteSceneName": "",
  "CommandChaningCmdName": "",
  "CommandChaningRunAfter": 0,
  "CommandChaningRunAsAdmin": false,
  "VIPModEnabled": false,
  "VIPModIfViewer": 0,
  "VIPModIfVIPB": 0,
  "VIPModIfVIPS": 0,
  "VIPModIfVIPG": 0,
  "VIPModAddDays": 30,
  "countdown": "2017-01-24T18:50:10.2652557-07:00",
  "counter": 3,
  "APITarget": false,
  "hideFromCmdList": false,
  "accessDeniedMsg": "",
  "noPointsMsg": "",
  "disableChanAccess": false,
  "disableWhisperAccess": false,
  "disableDiscordAccess": false,
  "isSoundVolumeSet": true,
  "soundVolume": 100
},
{
  "command": "!hug_3",
  "group": "Hug",
  "status": true,
  "runAsBot": false,
  "runAsUserElevated": true,
  "startsWithEx": false,
  "message": "GivePLZ @user@ Gives @target@ a BIG HUG TakeNRG",
  "description": "",
  "lastUsed": "2017-01-24T19:00:46.272097-07:00",
  "cooldown": 0,
  "accessLevel": 1,
  "soundFile": "",
  "costEnabled": false,
  "minPoints": 0,
  "minHours": 0,
  "costAll": 0,
  "costVIPViewer": 0,
  "costVIPB": 0,
  "costVIPS": 0,
  "costVIPG": 0,
  "costVIPMod": 0,
  "costVIPStreamer": 0,
  "OnScreenWidgetEnabled": false,
  "OnScreenWidgetName": "",
  "OnScreenWidgetTitle": "",
  "OnScreenWidgetMessage": "",
  "OnScreenWidgetImageLink": "",
  "OnScreenWidgetAnimMode": 0,
  "OBSRemoteEnabled": false,
  "OBSRemoteAction": 0,
  "OBSRemoteSceneName": "",
  "CommandChaningCmdName": "",
  "CommandChaningRunAfter": 0,
  "CommandChaningRunAsAdmin": false,
  "VIPModEnabled": false,
  "VIPModIfViewer": 0,
  "VIPModIfVIPB": 0,
  "VIPModIfVIPS": 0,
  "VIPModIfVIPG": 0,
  "VIPModAddDays": 30,
  "countdown": "2017-01-24T18:50:20.4773355-07:00",
  "counter": 2,
  "APITarget": false,
  "hideFromCmdList": false,
  "accessDeniedMsg": "",
  "noPointsMsg": "",
  "disableChanAccess": false,
  "disableWhisperAccess": false,
  "disableDiscordAccess": false,
  "isSoundVolumeSet": true,
  "soundVolume": 100
}]

Guide on Importing commands: http://wiki.deepbot.tv/import_and_export_commands

Old Name: RepentGamingTV
Twitch: Here

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

RDBGaming

  • Youngling
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
  • Twitch Name: RDBGaming
Re: Variables Check
« Reply #2 on: January 25, 2017, 10:12:47 AM »
@RepentGamingTV

Works great, that was the thing i ment.