1
Guides, Tutorials & Demo Videos / Re: Tricks with Deepbot Commands
« on: September 17, 2016, 09:54:38 AM »
While I didn't use this guide for my bot, I do have a couple of really absurd commands on my channel. I wanted to mention a few here (in simplified form) as they are similar to what is in the opening post. (essentially an expanded version).
I use triggered commands (Command Chaining) a lot and VIP variables a lot! While these commands don't necessarily need VIP variables, they make things much easier.
(Should be mod only, on my channel, VIP gold have access to this)
This is a form of command splitting, which is part of command chaining. (turning one command into multiple commands. The other commands are still available directly, but this command makes it so they only have to remember one command, not that important here, but for more complicated commands...)
!ChaoticAirs (This triggers another command. The importance of this command is less now, but before, this was the only way I knew how to chain without using custom JSON api, this has changed a bit, but I still keep it this way for this command).
This uses the Command Chaining Command: (I have this run as bot and admin access. One thing to note is that @counter@ here actually uses ChaoticRule's counter)
This command has actual flavor text, but that is not important here.
(This randomizes the value from the counter and then gives it to the randomuser selected earlier. It should be noted that in ver2 @randomuser@ and @counter@ are used here instead).
This was mainly to give an example of chaining commands, usually to add flavor text.
!Atropos (This has to be used with a value after)
Condensed version:
Now, this likely looks complicated. As this allows the user to specify the amount of points that they want to use, what it does is first checks if the user has enough points.
If the user has enough points, then it works to activate the commands, otherwise, it gives an error message. (The more complicated version would also do a check to see if the target value is high enough)
When activating the command, it first removes the points using editpoints (so the amount doesn't actually show up in chat) by using a -@target@, turning the target into a negative number (this technically can be circumvented, hence why the more complicated version checks that the target value is above a certain amount first, this code looks complicated enough without an extra nested @if@).
(VIP Gold only on my channel, super expensive) Lets my viewers vent a bit and unmod a mod (cooldown is super long so that only one person gets unmodded each day and they can be remodded later, but automating the remodding would be under advanced commands).
This is a form of user selection (or in this case, deselection (I could've also refunded the points and potentially even undid the cooldown in this case)). With this, you can make it so that a command only gets sent if the person is who you want them to be (using @user@ instead of @target@, for example) You can use various function such as @lookupinfo@ and @readfile@ and depending on how you set things up, @userinfo3@.
(Cooldown is about 30 minutes and costs 44444 points on my channel, I don't use @streamermsg@ on my channel, but whether you have to or not may depend on settings.
Similarly, you can enable turning on/off your stream with !startstream !stopstream (obs remote). You can give this function to a trusted editor through chaining and user selection!
Now I'll go into what I was going to show.
Simple enough. What it does is a fallback system. IF there is no target chosen, it falls back to the user that used this. This is useful for SINGLE target commands.
With all that said, a few things that I would've done with the opening post
This would make it so that if you did !vp Streamer, it would add 100, but if you did !vp Streamer 200, it would add 200.
Another thing that could be done is that the amount added could be based on the user (if each user has a different value that they add).
Finally, a different way of approaching the console change
Essentially, !console would display the current streaming system while !console PS4 would change the current system to PS4 and !console XB1 would change the current system to XB1.
There are other ways of doing this, including 'toggle' type commands, but we'd be talking about stuff that are way too complicated.
I use triggered commands (Command Chaining) a lot and VIP variables a lot! While these commands don't necessarily need VIP variables, they make things much easier.
(Should be mod only, on my channel, VIP gold have access to this)
Code: [Select]
!AutoHost -> @if@[@target@[1]||On||!startautohost||@if@[@target@[1]||Off||!stopautohost|| ]]
What this does is it checks if the word after the AutoHost is On or Off and activates a command depending on which one was chosen.This is a form of command splitting, which is part of command chaining. (turning one command into multiple commands. The other commands are still available directly, but this command makes it so they only have to remember one command, not that important here, but for more complicated commands...)
!ChaoticAirs (This triggers another command. The importance of this command is less now, but before, this was the only way I knew how to chain without using custom JSON api, this has changed a bit, but I still keep it this way for this command).
This uses the Command Chaining Command: (I have this run as bot and admin access. One thing to note is that @counter@ here actually uses ChaoticRule's counter)
Code: [Select]
!ChaoticAirs -> text + Command Chaining Command: -> !ChaoticRule @counter@ @randomuser@
OR ver2Code: [Select]
!ChaoticAirs -> text + Command Chaining Command: -> !ChaoticRule
This command has actual flavor text, but that is not important here.
(This randomizes the value from the counter and then gives it to the randomuser selected earlier. It should be noted that in ver2 @randomuser@ and @counter@ are used here instead).
Code: [Select]
!ChaoticRule -> !add @rand@[1|@target@[1] ] @target@[2]
OR ver2Code: [Select]
!ChaoticRule -> !add @rand@[1|@counter@ ] @randomuser@
This was mainly to give an example of chaining commands, usually to add flavor text.
!Atropos (This has to be used with a value after)
Condensed version:
Code: [Select]
!Atropos -> @if@[>||@intpoints@||@target@||@editpoints@[@user@|-@target@[1] ] @exec@[1,!rebirtha @target@[1] ] @user@ spent @target@[1] Airs to give viewers Airs with the Atropos spell! || @user@ does not have enough Airs to cast Atropos!]
Now, this likely looks complicated. As this allows the user to specify the amount of points that they want to use, what it does is first checks if the user has enough points.
If the user has enough points, then it works to activate the commands, otherwise, it gives an error message. (The more complicated version would also do a check to see if the target value is high enough)
When activating the command, it first removes the points using editpoints (so the amount doesn't actually show up in chat) by using a -@target@, turning the target into a negative number (this technically can be circumvented, hence why the more complicated version checks that the target value is above a certain amount first, this code looks complicated enough without an extra nested @if@).
Code: [Select]
!rebirtha -> !add @rand@[1|@calc@[/|@target@|4] ] all
(VIP Gold only on my channel, super expensive) Lets my viewers vent a bit and unmod a mod (cooldown is super long so that only one person gets unmodded each day and they can be remodded later, but automating the remodding would be under advanced commands).
Code: [Select]
!unmod -> @if@[@target@[1]||<bot name>||Bot has resisted unmod||@sendstreamermsg@[/unmod @target@[1]] ]
This is a form of user selection (or in this case, deselection (I could've also refunded the points and potentially even undid the cooldown in this case)). With this, you can make it so that a command only gets sent if the person is who you want them to be (using @user@ instead of @target@, for example) You can use various function such as @lookupinfo@ and @readfile@ and depending on how you set things up, @userinfo3@.
(Cooldown is about 30 minutes and costs 44444 points on my channel, I don't use @streamermsg@ on my channel, but whether you have to or not may depend on settings.
Code: [Select]
!HostMe -> @sendstreamermsg@[/host @target@ @user@]
Similarly, you can enable turning on/off your stream with !startstream !stopstream (obs remote). You can give this function to a trusted editor through chaining and user selection!
Now I'll go into what I was going to show.
Code: [Select]
!LicenseUser -> !permit @target@ @user@
Simple enough. What it does is a fallback system. IF there is no target chosen, it falls back to the user that used this. This is useful for SINGLE target commands.
With all that said, a few things that I would've done with the opening post
Code: [Select]
!vp -> !pointadd @target@[1] @target@[2] 100
Code: [Select]
!pointadd -> !add @target@[2] @target@[1]
This would make it so that if you did !vp Streamer, it would add 100, but if you did !vp Streamer 200, it would add 200.
Another thing that could be done is that the amount added could be based on the user (if each user has a different value that they add).
Finally, a different way of approaching the console change
Code: [Select]
!console -> @if@[@user@||<Streamer>||@if@[@target@[1]||XB1||@savefile@[console.txt, <Streamer> is currently streaming on the Xbox One.]||@if@[@target@[1]||PS4||@savefile@[console.txt, <Streamer> is currently streaming on the PS4.]||@readfile@[console.txt]]||@readfile@[console.txt]]
Essentially, !console would display the current streaming system while !console PS4 would change the current system to PS4 and !console XB1 would change the current system to XB1.
There are other ways of doing this, including 'toggle' type commands, but we'd be talking about stuff that are way too complicated.