FinalVersion Posted April 3, 2010 Share Posted April 3, 2010 Simple script that keeps your mouse in the window of StarCraft II, obviously this would be pointless for fullscreen. #cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.5.6 (beta) Author: Final Version Script Function: Trap mouse in StarCraft II Beta's window, useful when playing in windowed mode. #ce ---------------------------------------------------------------------------- #include <Misc.au3> Opt("MouseCoordMode", 2) Local $sTitle = "StarCraft II Beta", $Coords If Not WinExists($sTitle) Then Exit EndIf WinActivate($sTitle) $Coords = WinGetPos($sTitle) _MouseTrap($Coords[0] +4, $Coords[1] +30, $Coords[0] + $Coords[2] -4, $Coords[1] + $Coords[3] -4) ; Should work for all window sizes, 4:3 and 16:9. While WinExists($sTitle) Sleep(100) WEnd [center][+] Steam GUI [+][+] Clipboard Tool [+][+] System :: Uptime [+][+] StarCraft II Mouse Trap [+][/center] Link to comment Share on other sites More sharing options...
martin Posted April 3, 2010 Share Posted April 3, 2010 Simple script that keeps your mouse in the window of StarCraft II, obviously this would be pointless for fullscreen. #cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.5.6 (beta) Author: Final Version Script Function: Trap mouse in StarCraft II Beta's window, useful when playing in windowed mode. #ce ---------------------------------------------------------------------------- #include <Misc.au3> Opt("MouseCoordMode", 2) Local $sTitle = "StarCraft II Beta", $Coords If Not WinExists($sTitle) Then Exit EndIf WinActivate($sTitle) $Coords = WinGetPos($sTitle) _MouseTrap($Coords[0] +4, $Coords[1] +30, $Coords[0] + $Coords[2] -4, $Coords[1] + $Coords[3] -4) ; Should work for all window sizes, 4:3 and 16:9. While WinExists($sTitle) Sleep(100) WEnd I am prepared to believe that this is useful, but whoever gave it five stars is a little sad, but then they probably think I am too. Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
adik2dmax666 Posted April 3, 2010 Share Posted April 3, 2010 (edited) works with warcraft too #include <Misc.au3> Opt("MouseCoordMode", 2) Local $sTitle = "Warcraft III", $Coords Run($sTitle,@ScriptDir) WinWaitActive($sTitle,"",1) WinActivate($sTitle) $Coords = WinGetPos($sTitle) _MouseTrap($Coords[0] +4, $Coords[1] +30, $Coords[0] + $Coords[2] -4, $Coords[1] + $Coords[3] -4) While WinExists($sTitle) Sleep(100) WEnd Edited April 3, 2010 by adik2dmax666 First learn computer science and all the theory. Next develop a programming style. Then forget all that and just hack. -George Carrette[sub]GD Keylogger Creator (never released)[/sub][sub]Garena Autojoin v3.0[/sub] Link to comment Share on other sites More sharing options...
FinalVersion Posted April 3, 2010 Author Share Posted April 3, 2010 Well really it should work with any window, provided they use a default window. [center][+] Steam GUI [+][+] Clipboard Tool [+][+] System :: Uptime [+][+] StarCraft II Mouse Trap [+][/center] Link to comment Share on other sites More sharing options...
DeanHiggins Posted April 4, 2010 Share Posted April 4, 2010 Worth a try, thanks! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now