Author Topic: Using VA for streaming chatbot...  (Read 1549 times)

GMRod

  • Newbie
  • *
  • Posts: 7
    • My portfolio!
Using VA for streaming chatbot...
« on: June 13, 2021, 03:00:12 PM »
Hey guys!
So, I want to have VA do a couple things:
- First, I want to ask it to type a command for my bot to respond to.
- Second, I want audio confirmation (things like, "right away sir", "yes sir" etc)
- Third, I need this to not be seen by the chat, that VA is actually just typing out the commands in chat just as they would.

I already got parts of this to work, but I have a problem...
The way I'm doing it now is, the voice command triggers these:
 - Move mouse to specific position in application window (the chatbot app in this case)
- Click the chat input field
- Type in command
- Press enter

Now, I'm using Streamlabs Chatbot, the offline version because it accepts Python scripts.

This bot has a feature to choose from where the bot accepts commands. I have it set to "Stream Both".
That means the bot will work and respond to commands, whether they're typed in open chat, or whispered to the bot.
And, it'll respond in the same way it was triggered, as in, if you type in chat, response is in chat. If you whisper, it whispers back to you.
All dandy, but if I'm voicing commands and I don't want my chat to see the command was actually just typed, I have to whisper the bot. Which then would make the bot whisper the response back to me and the chat won't see it, thus defeating the whole thing.
But, this bot has a "/me" option. This, colors the bot's response in the same color as the bot's nickname, AND it forces the bot's response to display in chat. Voila! I can now whisper it, and it responds in chat, no matter what. The downside is, if a viewer wanted to get the response in a whisper, they can't. It'll always respond in chat.

But, here's the reason I'm posting here:
The way I have this being done now, obviously, involves moving the mouse and clicking in the bot's screen.
This means I'm technically alt-tabbing from whatever game I'm playing, and it'll take control of my mouse and screw up whatever it is that I'm doing in the game.

To make sure the keystrokes only go where they're supposed to go, I have each command target the specific bot application too.

But, I still need a way to do this without having to simulate mouse behavior to go and type the commands in the application window.
The other possibility would be to use the bot's macro hotkeys for each command, and have VA trigger the macros via F13-F24.
Problem there is, the bot only offers 7 macros. I'm going to need a LOT more.

Help?

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4758
  • RTFM
Re: Using VA for streaming chatbot...
« Reply #1 on: June 13, 2021, 03:09:19 PM »
You mention this "bot" can run Python scripts; can you execute the commands you mention using that interface?

Do you have that application running on a local machine?

GMRod

  • Newbie
  • *
  • Posts: 7
    • My portfolio!
Re: Using VA for streaming chatbot...
« Reply #2 on: June 13, 2021, 03:33:50 PM »
The bot is running local, yes. On the same machine as VoiceAttack.
I don't think I can do the commands via python interface because the bot is specifically "looking" at twitch chat to see commands...
That said, the bot does have a built-in console where I type commands when I want to. But the viewers don't have that option, they have to use the chat.
Since these commands are (for the most part) the same ones the viewers/mods can use, I can't run things local because then only I would be able to run them.
The python thing is because certain commands I use, for example chat games like rock/paper/scissors or jenga, are python scripts that need to be installed and present in the local machine.
This also means anyone with some python knowledge can make custom scripts to get the bot to do pretty much anything they want, and there's a large userbase doing this so I always find what I need... cloud bots don't offer this.

If it helps, here's the chatbot's documentation:
https://cdn.streamlabs.com/chatbot/Documentation_Twitch.pdf

GMRod

  • Newbie
  • *
  • Posts: 7
    • My portfolio!
Re: Using VA for streaming chatbot...
« Reply #3 on: June 13, 2021, 03:38:22 PM »
Also, the audio confirmation part...
What's the best way to do this? Include a sound with the VA commands to play when the command is executed? If I do it this way, does VA offer the option to pick between a random list of sounds each time it executes each command?
Or is it better to have the bot itself play the sound when the command actually gets run? Cuz it'd be weird for the bot to audibly confirm that it's doing something, and then for it to not work, right.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4758
  • RTFM
Re: Using VA for streaming chatbot...
« Reply #4 on: June 13, 2021, 03:51:03 PM »
Have you taken a moment to look through the "Other >" button's context menu on the "Add a Command"/"Edit a Command" window, to get a feel for the actions that are available?

You can also press F1 while VoiceAttack has focus to open VoiceAttackHelp.pdf in your default PDF viewer, which contains information on VoiceAttack's features.


There does appear to be a set of functions that can be called from a Python script, allowing you to send a message to the chat, including whispers.

Have you checked whether a message sent from such a script can function as a trigger for other scripts or "bot" functions?
If so, a potential option could be to have a Python script run a TCP (or UDP) server, and using an inline function (or plugin) in VoiceAttack to connect to that server to send commands, provided you are familiar with setting something like that up in Python and C# (or VB.NET).

GMRod

  • Newbie
  • *
  • Posts: 7
    • My portfolio!
Re: Using VA for streaming chatbot...
« Reply #5 on: June 13, 2021, 08:06:07 PM »
Actually, I did!
I saw that and suspected that might be a thing.
But my thought process was, how to "send a command" to the app when the app wasn't designed to expect to be sent a command?
I had a feeling the answer -was- going to be through python like you're suggesting, but I was still hoping to find a more... GUI-enabled, non-coding user friendly way to do it.
Guess not, then, eh?

Thanks, though! I at least know what to look for now. Namely, a coder who understands python AND Twitch. :-)