Sign in to follow this  
Followers 0
FinalVersion

StarCraft II Mouse Trap

5 posts in this topic

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

Share this post


Link to post
Share on other sites



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.

Share this post


Link to post
Share on other sites

#3 ·  Posted (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 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]

Share this post


Link to post
Share on other sites

Worth a try, thanks!

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0