<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:media="http://search.yahoo.com/mrss/">
<channel>
<title>VoiceBot RSS: way to get mouse position?</title>
<atom:link href="https://www.voicebot.net/Discussions/RSS/?TopicID=a92515f9-8f35-4492-9eba-614228d8f00b" rel="self" type="application/rss+xml" />
<link>https://www.voicebot.net/Discussions/RSS/?TopicID=a92515f9-8f35-4492-9eba-614228d8f00b</link>
<description>VoiceBot RSS: way to get mouse position?</description>
<lastBuildDate>Sun, 13 Sep 2026 23:33:09 GMT</lastBuildDate>
<language>en</language>
<sy:updatePeriod>hourly</sy:updatePeriod>
<sy:updateFrequency>1</sy:updateFrequency>
<generator>https://www.voicebot.net/Discussions/RSS/?TopicID=a92515f9-8f35-4492-9eba-614228d8f00b</generator>
<item>
<title>RE: way to get mouse position?</title>
<link>https://www.voicebot.net/Discussions/View/way-to-get-mouse-position/?ID=a92515f9-8f35-4492-9eba-614228d8f00b#3</link>
<pubDate>Wed, 29 Aug 2018 13:17:41 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.voicebot.net/Discussions/View/way-to-get-mouse-position/?ID=a92515f9-8f35-4492-9eba-614228d8f00b#3</guid>
<category>VoiceBot</category>
<description><![CDATA[Well, just in case, a clean script.
Code
Copy
Select All
using System;&#xA;using System.Drawing;&#xA;&#xA;public static class VoiceBotScript&#xA;{&#xA;    public static void Run(IntPtr windowHandle)&#xA;    {&#xA;        // Save current position&#xA;        var posX = BFS.Input.GetMousePositi...]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
Well, just in case, a clean script.<br/>
<div class="col-md-12 BoxWrap"><div class="Box table-responsive"><a name="code" style="width:0; height:0;"></a><h2 class="TableTitle" style="border:0"><div class="TableTitleText">Code</div><div class="TitleButtons"><div class="TableTitleButton"><a href="#" onclick="return false;" data-clipboard-target="#code01a09d1e16a677db8c250aedea4e0bdd" class="ClipboardCopyControl"><img src="https://www.voicebot.net/MediaCommon/SVGs/FontAwesome/clone.blue.svg" style="box-sizing:border-box;position:relative;overflow:hidden;width:auto;max-width:16px;height:16px;" /><span class="Text">Copy</span></a></div><div class="TableTitleButton"><a href="#" onclick="bfs.util.codeEditorSelectAll('code01a09d1e16a677db8c250aedea4e0bddJs'); return false;"><img src="https://www.voicebot.net/MediaCommon/SVGs/FontAwesome/square-check.blue.svg" style="box-sizing:border-box;position:relative;overflow:hidden;width:auto;max-width:16px;height:16px;" /><span class="Text">Select All</span></a></div></div></h2><div class="TableTitleContent table-responsive"><div class="AceEditorWrapper" style="border-top:solid 1px var(--color-default-border);padding:0"><pre id="code01a09d1e16a677db8c250aedea4e0bddJs" name="code01a09d1e16a677db8c250aedea4e0bddJs" contenteditable="true" spellcheck="true" class="skiptranslate" style="width:100%;min-height:75px">using System;&#xA;using System.Drawing;&#xA;&#xA;public static class VoiceBotScript&#xA;{&#xA;    public static void Run(IntPtr windowHandle)&#xA;    {&#xA;        // Save current position&#xA;        var posX = BFS.Input.GetMousePositionX();&#xA;        var posY = BFS.Input.GetMousePositionY();&#xA;        &#xA;        // Call method with mouse actions&#xA;        MouseActions();&#xA;        &#xA;        // Restore saved position&#xA;        BFS.Input.SetMousePosition(posX, posY);&#xA;    }&#xA;    public static void MouseActions()&#xA;    {&#xA;        // Here your can make all mouse actions.&#xA;    }&#xA;}</pre><textarea id="code01a09d1e16a677db8c250aedea4e0bdd" name="code01a09d1e16a677db8c250aedea4e0bdd" style="position:absolute;top:0;left:-999999px;width:1px;height:1px"></textarea></div>
</div></div></div>
</div>
]]></content:encoded>
</item>
<item>
<title>RE: way to get mouse position?</title>
<link>https://www.voicebot.net/Discussions/View/way-to-get-mouse-position/?ID=a92515f9-8f35-4492-9eba-614228d8f00b#2</link>
<pubDate>Wed, 29 Aug 2018 12:59:47 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.voicebot.net/Discussions/View/way-to-get-mouse-position/?ID=a92515f9-8f35-4492-9eba-614228d8f00b#2</guid>
<category>VoiceBot</category>
<description><![CDATA[What causes the use of 3 scripts? Of course, their launch and works takes a long time. Everything is solved much easier.
For example this test script with 50 clicks, is executed in ~6 seconds. And 99% of this time is spent on clicks. Without clicks, but with 10ms delay it's performed for ~550ms....]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
What causes the use of 3 scripts? Of course, their launch and works takes a long time. Everything is solved much easier.<br/>
For example this test script with 50 clicks, is executed in ~6 seconds. And 99% of this time is spent on clicks. Without clicks, but with 10ms delay it's performed for ~550ms.<br/>
<div class="col-md-12 BoxWrap"><div class="Box table-responsive"><a name="code" style="width:0; height:0;"></a><h2 class="TableTitle" style="border:0"><div class="TableTitleText">Code</div><div class="TitleButtons"><div class="TableTitleButton"><a href="#" onclick="return false;" data-clipboard-target="#code01a09d1e16b3716fae788a52e767beb5" class="ClipboardCopyControl"><img src="https://www.voicebot.net/MediaCommon/SVGs/FontAwesome/clone.blue.svg" style="box-sizing:border-box;position:relative;overflow:hidden;width:auto;max-width:16px;height:16px;" /><span class="Text">Copy</span></a></div><div class="TableTitleButton"><a href="#" onclick="bfs.util.codeEditorSelectAll('code01a09d1e16b3716fae788a52e767beb5Js'); return false;"><img src="https://www.voicebot.net/MediaCommon/SVGs/FontAwesome/square-check.blue.svg" style="box-sizing:border-box;position:relative;overflow:hidden;width:auto;max-width:16px;height:16px;" /><span class="Text">Select All</span></a></div></div></h2><div class="TableTitleContent table-responsive"><div class="AceEditorWrapper" style="border-top:solid 1px var(--color-default-border);padding:0"><pre id="code01a09d1e16b3716fae788a52e767beb5Js" name="code01a09d1e16b3716fae788a52e767beb5Js" contenteditable="true" spellcheck="true" class="skiptranslate" style="width:100%;min-height:75px">using System;&#xA;using System.Drawing;&#xA;using System.Linq;&#xA;using System.Diagnostics;&#xA;&#xA;public static class VoiceBotScript&#xA;{&#xA;    public static void Run(IntPtr windowHandle)&#xA;    {&#xA;        // Calculate execution time&#xA;        var watch = Stopwatch.StartNew();&#xA;        &#xA;        // Save current position&#xA;        var pos = new int[] {BFS.Input.GetMousePositionX(), BFS.Input.GetMousePositionY()};&#xA;        &#xA;        // Call method with mouse actions&#xA;        MouseActions();&#xA;        &#xA;        // Restore saved position&#xA;        BFS.Input.SetMousePosition(pos[0], pos[1]);&#xA;        &#xA;        watch.Stop();&#xA;        BFS.Dialog.ShowMessageInfo(&quot;Total time elapsed: &quot; &#x2B; watch.Elapsed);&#xA;    }&#xA;    &#xA;    public static void MouseActions()&#xA;    {&#xA;        // Here your can make all mouse actions.&#xA;        &#xA;        // For example, 50 clicks with the initial coordinates of X=300, Y=500 and X offset by &#x2B;10 pixels to 500.&#xA;        var posList = Enumerable.Range(300, 500).Where(x =&amp;gt; x % 10 == 0).ToList();&#xA;        foreach (var pos in posList)&#xA;        {&#xA;            BFS.Input.SetMousePosition(pos, 500);&#xA;            //BFS.General.ThreadWait(10);&#xA;            BFS.Input.LeftClickMouse();&#xA;        }&#xA;    }&#xA;}</pre><textarea id="code01a09d1e16b3716fae788a52e767beb5" name="code01a09d1e16b3716fae788a52e767beb5" style="position:absolute;top:0;left:-999999px;width:1px;height:1px"></textarea></div>
</div></div></div>
</div>
]]></content:encoded>
</item>
<item>
<title>way to get mouse position?</title>
<link>https://www.voicebot.net/Discussions/View/way-to-get-mouse-position/?ID=a92515f9-8f35-4492-9eba-614228d8f00b</link>
<pubDate>Tue, 28 Aug 2018 20:47:37 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.voicebot.net/Discussions/View/way-to-get-mouse-position/?ID=a92515f9-8f35-4492-9eba-614228d8f00b</guid>
<category>VoiceBot</category>
<description><![CDATA[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 secon...]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
Is there a quick way to get the current mouse position?<br/>
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.<br/>
<br/>
1. Macro Script to get/store the mouse position<br/>
=============================================<br/>
<div class="col-md-12 BoxWrap"><div class="Box table-responsive"><a name="code" style="width:0; height:0;"></a><h2 class="TableTitle" style="border:0"><div class="TableTitleText">Code</div><div class="TitleButtons"><div class="TableTitleButton"><a href="#" onclick="return false;" data-clipboard-target="#code01a09d1e16bf763fbf667dc727e83c43" class="ClipboardCopyControl"><img src="https://www.voicebot.net/MediaCommon/SVGs/FontAwesome/clone.blue.svg" style="box-sizing:border-box;position:relative;overflow:hidden;width:auto;max-width:16px;height:16px;" /><span class="Text">Copy</span></a></div><div class="TableTitleButton"><a href="#" onclick="bfs.util.codeEditorSelectAll('code01a09d1e16bf763fbf667dc727e83c43Js'); return false;"><img src="https://www.voicebot.net/MediaCommon/SVGs/FontAwesome/square-check.blue.svg" style="box-sizing:border-box;position:relative;overflow:hidden;width:auto;max-width:16px;height:16px;" /><span class="Text">Select All</span></a></div></div></h2><div class="TableTitleContent table-responsive"><div class="AceEditorWrapper" style="border-top:solid 1px var(--color-default-border);padding:0"><pre id="code01a09d1e16bf763fbf667dc727e83c43Js" name="code01a09d1e16bf763fbf667dc727e83c43Js" contenteditable="true" spellcheck="true" class="skiptranslate" style="width:100%;min-height:75px">using System;&#xA;using System.Drawing;&#xA;&#xA;public static class VoiceBotScript&#xA;{&#xA;    public static void Run(IntPtr windowHandle)&#xA;    {&#xA;    int mouseX = BFS.Input.GetMousePositionX();&#xA;    int mouseY = BFS.Input.GetMousePositionY();&#xA;    BFS.ScriptSettings.WriteValueInt(&quot;MouseX&quot;, mouseX);&#xA;    BFS.ScriptSettings.WriteValueInt(&quot;MouseY&quot;, mouseY);&#xA;    }&#xA;}</pre><textarea id="code01a09d1e16bf763fbf667dc727e83c43" name="code01a09d1e16bf763fbf667dc727e83c43" style="position:absolute;top:0;left:-999999px;width:1px;height:1px"></textarea></div>
</div></div></div><br/>
=============================================<br/>
<br/>
2. Multiple "move/click here" commands.<br/>
3. Macro Script to restore the mouse position to previously saved coordinates:<br/>
=============================================<br/>
<div class="col-md-12 BoxWrap"><div class="Box table-responsive"><a name="code" style="width:0; height:0;"></a><h2 class="TableTitle" style="border:0"><div class="TableTitleText">Code</div><div class="TitleButtons"><div class="TableTitleButton"><a href="#" onclick="return false;" data-clipboard-target="#code01a09d1e16c772cfbec102dfdbe1687f" class="ClipboardCopyControl"><img src="https://www.voicebot.net/MediaCommon/SVGs/FontAwesome/clone.blue.svg" style="box-sizing:border-box;position:relative;overflow:hidden;width:auto;max-width:16px;height:16px;" /><span class="Text">Copy</span></a></div><div class="TableTitleButton"><a href="#" onclick="bfs.util.codeEditorSelectAll('code01a09d1e16c772cfbec102dfdbe1687fJs'); return false;"><img src="https://www.voicebot.net/MediaCommon/SVGs/FontAwesome/square-check.blue.svg" style="box-sizing:border-box;position:relative;overflow:hidden;width:auto;max-width:16px;height:16px;" /><span class="Text">Select All</span></a></div></div></h2><div class="TableTitleContent table-responsive"><div class="AceEditorWrapper" style="border-top:solid 1px var(--color-default-border);padding:0"><pre id="code01a09d1e16c772cfbec102dfdbe1687fJs" name="code01a09d1e16c772cfbec102dfdbe1687fJs" contenteditable="true" spellcheck="true" class="skiptranslate" style="width:100%;min-height:75px">using System;&#xA;using System.Drawing;&#xA;&#xA;public static class VoiceBotScript&#xA;{&#xA;    public static void Run(IntPtr windowHandle)&#xA;    {&#xA;    int mouseX = BFS.ScriptSettings.ReadValueInt(&quot;MouseX&quot;);&#xA;    int mouseY = BFS.ScriptSettings.ReadValueInt(&quot;MouseY&quot;);&#xA;    BFS.Input.SetMousePosition(mouseX , mouseY); //Moves the mouse cursor to the earlier stored values.&#xA;    }&#xA;}</pre><textarea id="code01a09d1e16c772cfbec102dfdbe1687f" name="code01a09d1e16c772cfbec102dfdbe1687f" style="position:absolute;top:0;left:-999999px;width:1px;height:1px"></textarea></div>
</div></div></div><br/>
=============================================<br/>
<br/>
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?<br/>
<br/>
Please advise.<br/>
<br/>
Thanks,<br/>
<br/>
Van
</div>
]]></content:encoded>
</item>
</channel>
</rss>