Is there a quick way to get the current mouse position?
I have a command that moves the mouse and does some clicks, then returns the mouse to the position prio to any of the moves/clicks. The problem is that the script macro for getting and storing the mouse position is extremely slow (3-5 seconds for just getting/storing the mouse position, and then another 3-5 seconds to have the follow-up script return the mouse to its previous coordinates). Add to it that it pretty much opens another window.
1. Macro Script to get/store the mouse position
=============================================
using System;
using System.Drawing;
public static class VoiceBotScript
{
public static void Run(IntPtr windowHandle)
{
int mouseX = BFS.Input.GetMousePositionX();
int mouseY = BFS.Input.GetMousePositionY();
BFS.ScriptSettings.WriteValueInt("MouseX", mouseX);
BFS.ScriptSettings.WriteValueInt("MouseY", mouseY);
}
}
=============================================
2. Multiple "move/click here" commands.
3. Macro Script to restore the mouse position to previously saved coordinates:
=============================================
using System;
using System.Drawing;
public static class VoiceBotScript
{
public static void Run(IntPtr windowHandle)
{
int mouseX = BFS.ScriptSettings.ReadValueInt("MouseX");
int mouseY = BFS.ScriptSettings.ReadValueInt("MouseY");
BFS.Input.SetMousePosition(mouseX , mouseY); //Moves the mouse cursor to the earlier stored values.
}
}
=============================================
Unfortunately, using these macro scripts are just too damn slow (it works, but takes up to 10 seconds just for 3 steps (get position, move mouse, and move mouse back to previous position. Other voice command software has a simpler (and much quicker) way to grab the mouse coordinates, and then recall those variables/values later-on. Is there an easier way to do this in Voicebot?
Please advise.
Thanks,
Van