Processing Ajax...

Title
Close Dialog

Message

Confirm
Close Dialog

Confirm
Close Dialog

Confirm
Close Dialog

User Image
Rafferty3231
5 discussion posts
Hi! So I've been using VBPro to help automate some of my work this summer, and while it has been EXTREMELY helpful, there's one feature I wish it had.. and that's a 'reset mouse position' step. Something that would send the pointer back to where it was before a command was run (the macros I'm using send the mouse all over the place). OR, is there a way to do this with the current build? I haven't been able to figure it out.

Anyway, cool program! It hasn't made the summer busywork any faster (due to limitations outside of VoiceBot), but it sure has made it easier. o7
Jul 9, 2019  • #1
Jon Tackabury (BFS)'s profile on WallpaperFusion.com
There isn't a pre-built way to do this, but you can easily do this using the scripts. If you create a script to read and save the mouse position, then run your actions, then create a script to read the saved position and set the mouse back again. If you need some help with the script creation just let us know. Thanks!
Jul 9, 2019  • #2
User Image
Rafferty3231
5 discussion posts
Awesome. I'll try to figure it out, but I may ask for help in the future.

Next question.. should I put this here or make a new thread? Anyway, is there a way to have multiple push-to-talk / push-to-ignore keys? E.g. in Arma 3, I use 2 different buttons as PTT, Insert and Caps Lock. I got Insert to work as push-to-ignore, but I'd also like to add Caps Lock to that list. Is this possible?

Loving this program. Thanks!
Jul 10, 2019  • #3
Jon Tackabury (BFS)'s profile on WallpaperFusion.com
Sorry, VoiceBot only supports one PTT hotkey right now. :)
Jul 11, 2019  • #4
User Image
Rafferty3231
5 discussion posts
Bummer. Ah well, I'll survive. :)

So, about that mouse positioning.. I'm not sure I know where to start. Basically, what I'm doing is clicking on each item in a list of things (in Firefox), running a voice command/script (often including copy/paste, typing text, moving the mouse, clicking other things, etc.), and then when that's done, moving on to the next item in the list. What I need is a first step that records the position of the mouse at the start of the script, and then returns the mouse to the same position once all the actions are complete.

I gave it a shot, but knowing nothing about C#, it didn't work out so well. Is there a pre-made macro somewhere I can copy and/or reference? Thx for all the help!
Jul 12, 2019  • #5
User Image
Rainbowsaur
4 discussion posts
I really recommend making AutoHotKey scripts! Then attaching those AHK scripts to run from a custom voice command, this is what I do when I want to run a script since I don't know how to use c#/provided scipting method. But I do use the provided scripting feature for a few things but I know much more about AutoHotKey than whatever c#/c? whatever it uses.

I bet AutoHotKey will help you make a mouse respositioning/saving script and theres likely alot of code out there on the web you can save/copy and use to make your own.
Jul 13, 2019  • #6
Keith Lammers (BFS)'s profile on WallpaperFusion.com
This Macro code would save the mouse position, run some other stuff, then restore the mouse position:

Code

using System;
using System.Drawing;

public static class VoiceBotScript
{
    public static void Run(IntPtr windowHandle)
    {
        SaveMousePosition();
        
        // Run your other stuff here
        
        RestoreMousePosition();                   
    }
    
    private static void SaveMousePosition()
    {
        BFS.ScriptSettings.WriteValueInt("SavedMousePositionX", BFS.Input.GetMousePositionX());
        BFS.ScriptSettings.WriteValueInt("SavedMousePositionY", BFS.Input.GetMousePositionY());
    }
    
    private static void RestoreMousePosition()
    {
        BFS.Input.SetMousePosition(BFS.ScriptSettings.ReadValueInt("SavedMousePositionX"), BFS.ScriptSettings.ReadValueInt("SavedMousePositionY"));
    }
}


Alternatively, you could break those "SaveMousePosition" and "RestoreMousePosition" functions out into two separate Macro Scripts. You could then call the Save script as your first action in VoiceBot, add all of the other actions, then call the Restore script as the last action.

Hope that helps!
Jul 15, 2019 (modified Jul 16, 2019)  • #7
User Image
Rafferty3231
5 discussion posts
Hi Keith!

Okay, so I tried pasting that code into a new macro just to play around with it and see what I could figure out.. but when I compile, I get an error:

Could not find a public static class named 'VoiceBotScript'.

I looked as closely as I could, and I don't even see any mention of "VoiceBotScript" in the code you provided.. did I miss something?

Thanks for all the help, you guys rock.
Jul 15, 2019  • #8
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Ah sorry, my bad! I've edited the code in the previous post, could you try copying it again?
Jul 16, 2019  • #9
User Image
Rafferty3231
5 discussion posts
Sweet! Seems to be working just fine. Thanks again!
Jul 16, 2019  • #10
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Excellent, glad to hear it!
Jul 17, 2019  • #11
Subscribe to this discussion topic using RSS
Was this helpful?  Login to Vote(-)  Login to Vote(-)