<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; Отправка нажатий клавиш в неактивное окно World of Tanks]]></title>
	<link rel="self" href="http://forum.script-coding.com/extern.php?action=feed&amp;tid=9558&amp;type=atom" />
	<updated>2014-06-26T07:54:24Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.script-coding.com/viewtopic.php?id=9558</id>
		<entry>
			<title type="html"><![CDATA[Re: Отправка нажатий клавиш в неактивное окно World of Tanks]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=84228#p84228" />
			<content type="html"><![CDATA[<p>Меню приказов, лечения экипажа и ремонт модулей.</p>]]></content>
			<author>
				<name><![CDATA[kharlashkin]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=32183</uri>
			</author>
			<updated>2014-06-26T07:54:24Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=84228#p84228</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Отправка нажатий клавиш в неактивное окно World of Tanks]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=84225#p84225" />
			<content type="html"><![CDATA[<p>Итак выкладываю здесь свой, так сказать, окончательный скрипт для игры в танчики двумя геймпадами. Может конечно что-то со временем и придумается с отправкой перемещений мыши в неактивное окно, но надежды мало.<br /></p><div class="fancy_spoiler_switcher"><div class="fancy_spoiler_switcher_header" data-lang-open="открыть спойлер" data-lang-close="скрыть спойлер"><strong>+</strong>&nbsp;открыть спойлер</div><div class="fancy_spoiler"><div class="codebox"><pre><code>JoyMultiplier = 5
JoyThreshold = 5
JoyThresholdUpper := 50 + JoyThreshold
JoyThresholdLower := 50 - JoyThreshold
#Persistent
SetTimer, WatchAxisFirstJoyMoveForwardAndZoom, 10
SetTimer, WatchAxisFirstJoyMoveRotate, 10
SetTimer, WatchAxisFirstJoyCameraRotateVert, 10
SetTimer, WatchAxisFirstJoyCameraRotateHoriz, 10
SetTimer, WatchAxisFirstJoyShoot, 10
SetTimer, WatchFirstJoyPOV, 10
SetTimer, WatchAxisSecondJoyMoveForwardAndZoom, 10
SetTimer, WatchAxisSecondJoyMoveRotate, 10
SetTimer, WatchAxisSecondJoyCameraRotate, 10
SetTimer, WatchAxisSecondJoyShoot, 10
SetTimer, WatchSecondJoyPOV, 10
return


;;;;;;;;;;;;первый геймпад движение вперед/назад в неактивном окне и зум

WatchAxisFirstJoyMoveForwardAndZoom:
GetKeyState, 1JoyY, 1JoyY
GetKeyState, 1JoyZ, 1JoyZ
GetKeyState, 1Joy2, 1Joy2
GetKeyState, 1Joy3, 1Joy3
FirstJoyMoveForwardAndZoomPrev = %FirstJoyMoveForwardAndZoom%

if 1Joy2 = D
    GoSub, FirstJoyConsumables
else if 1Joy3 = D
    GoSub, FirstJoyConsumables
else 
{
if 1JoyZ &gt; 70
    {
    if 1JoyY &lt; 30
        FirstJoyMoveForwardAndZoom = PgDn
    else if 1JoyY &gt; 70
        FirstJoyMoveForwardAndZoom = PgUp
    else
        FirstJoyMoveForwardAndZoom =
    }
else if 1JoyY &lt; 30
    FirstJoyMoveForwardAndZoom = vk57
else if 1JoyY &gt; 70 
    FirstJoyMoveForwardAndZoom = vk53
else
    FirstJoyMoveForwardAndZoom =
}

if FirstJoyMoveForwardAndZoom = %FirstJoyMoveForwardAndZoomPrev%
    return

SetKeyDelay -1
if FirstJoyMoveForwardAndZoom
{
IfWinNotActive, WoT Client
    {
    SendMessage, 0x06, 1,,, WoT Client
    ControlSend,, {%FirstJoyMoveForwardAndZoom% down}, WoT Client
    }
}
if FirstJoyMoveForwardAndZoomPrev
{
IfWinNotActive, WoT Client
    {
    SendMessage, 0x06, 1,,, WoT Client
    ControlSend,, {%FirstJoyMoveForwardAndZoomPrev% up}, WoT Client
    }
}
return

;;;;;;;;;;;;первый геймпад движение влево/вправо в неактивном окне

WatchAxisFirstJoyMoveRotate:
GetKeyState, 1JoyX, 1JoyX
GetKeyState, 1Joy2, 1Joy2
GetKeyState, 1Joy3, 1Joy3
FirstJoyMoveRotatePrev = %FirstJoyMoveRotate%

if 1Joy2 = D
    GoSub, SecondJoyConsumables
else if 1Joy3 = D
    GoSub, SecondJoyConsumables
else
{
if 1JoyX &gt; 80
    FirstJoyMoveRotate = vk44
else if 1JoyX &lt; 20
    FirstJoyMoveRotate = vk41
else
    FirstJoyMoveRotate =
}

if FirstJoyMoveRotate = %FirstJoyMoveRotatePrev%
    return

SetKeyDelay -1
if FirstJoyMoveRotate
{
IfWinNotActive, WoT Client
    {
    SendMessage, 0x06, 1,,, WoT Client
    ControlSend,, {%FirstJoyMoveRotate% down}, WoT Client
    }
}
if FirstJoyMoveRotatePrev
{
IfWinNotActive, WoT Client
    {
    SendMessage, 0x06, 1,,, WoT Client
    ControlSend,, {%FirstJoyMoveRotatePrev% up}, WoT Client
    }
}
return

;;;;;;;;;;;;первый геймпад меню расходников в неактивном окне

FirstJoyConsumables:
FirstJoyConsumablesPrev = %FirstJoyConsumables%

if 1JoyX &lt; 20
    {
    if 1JoyY &lt; 20
    FirstJoyConsumables = vk38
    else if 1JoyY between 40 and 60
    FirstJoyConsumables = vk37
    else if 1JoyY &gt; 80
    FirstJoyConsumables = vk36
    else FirstJoyConsumables =
    }
else if 1JoyX between 40 and 60
    {
    if 1JoyY &lt; 10
    FirstJoyConsumables = vk31
    else if 1JoyY &gt; 90
    FirstJoyConsumables = vk35
    else FirstJoyConsumables =     
    }
else if 1JoyX &gt; 80
    {
    if 1JoyY &lt; 20
    FirstJoyConsumables = vk32
    else if 1JoyY between 40 and 60
    FirstJoyConsumables = vk33
    else if 1JoyY &gt; 80
    FirstJoyConsumables = vk34
    else FirstJoyConsumables =
    }
else FirstJoyConsumables =

if FirstJoyConsumables = %SFirstJoyConsumablesPrev%
return

SetKeyDelay -1
if FirstJoyConsumables
{
IfWinNotActive, WoT Client
    {
    SendMessage, 0x06, 1,,, WoT Client
    ControlSend,, {%FirstJoyConsumables% down}, WoT Client
    } 
}
if FirstJoyConsumablesPrev
{
IfWinNotActive, WoT Client
    {
    SendMessage, 0x06, 1,,, WoT Client
    ControlSend,, {%FirstJoyConsumablesPrev% up}, WoT Client
    } 
}
return

;;;;;;;;;;;;первый геймпад обзор влево/вправо в неактивном окне

WatchAxisFirstJoyCameraRotateVert:
GetKeyState, 1JoyU, 1JoyU
GetKeyState, 1Joy5, 1Joy5
FirstJoyCameraRotateVertPrev = %FirstJoyCameraRotateVert%

if 1Joy5 = D
    GoSub, FirstJoyCommandMenu
else
{
if 1JoyU &gt; 70
    FirstJoyCameraRotateVert = Right
else if 1JoyU &lt; 30
    FirstJoyCameraRotateVert = Left
else
    FirstJoyCameraRotateVert =
}

if FirstJoyCameraRotateVert = %FirstJoyCameraRotateVertPrev%
    return

SetKeyDelay -1
if FirstJoyCameraRotateVert
{
IfWinNotActive, WoT Client
    {
    SendMessage, 0x06, 1,,, WoT Client
    ControlSend,, {%FirstJoyCameraRotateVert% down}, WoT Client
    }
}
if FirstJoyCameraRotateVertPrev
{
IfWinNotActive, WoT Client
    {
    SendMessage, 0x06, 1,,, WoT Client
    ControlSend,, {%FirstJoyCameraRotateVertPrev% up}, WoT Client
    }
}
return

;;;;;;;;;;;;первый геймпад обзор вверх/вниз в неактивном окне

WatchAxisFirstJoyCameraRotateHoriz:
GetKeyState, 1JoyR, 1JoyR
GetKeyState, 1Joy5, 1Joy5
FirstJoyCameraRotateHorizPrev = %FirstJoyCameraRotateHoriz%

if 1Joy5 = D
    GoSub, FirstJoyCommandMenu
else
{
if 1JoyR &gt; 70
    FirstJoyCameraRotateHoriz = Down
else if 1JoyR &lt; 30
    FirstJoyCameraRotateHoriz = Up
else
    FirstJoyCameraRotateHoriz =
}

if FirstJoyCameraRotateHoriz = %FirstJoyCameraRotateHorizPrev%
    return

SetKeyDelay -1
if FirstJoyCameraRotateHoriz
{
IfWinNotActive, WoT Client
    {
    SendMessage, 0x06, 1,,, WoT Client
    ControlSend,, {%FirstJoyCameraRotateHoriz% down}, WoT Client
    }
}
if FirstJoyCameraRotateHorizPrev
{
IfWinNotActive, WoT Client
    {
    SendMessage, 0x06, 1,,, WoT Client
    ControlSend,, {%FirstJoyCameraRotateHorizPrev% up}, WoT Client
    }
}
return

;;;;;;;;;;;;первый геймпад меню приказов

FirstJoyCommandMenu:
FirstJoyCommandMenuPrev = %FirstJoyCommandMenu%

if 1JoyU &lt; 20
    {
    if 1JoyR &lt; 20
    FirstJoyCommandMenu = Numpad8
    else if 1JoyR between 40 and 60
    FirstJoyCommandMenu = Numpad7
    else if 1JoyR &gt; 80
    FirstJoyCommandMenu = Numpad6
    else FirstJoyCommandMenu =
    }
else if 1JoyU between 40 and 60
    {
    if 1JoyR &lt; 10
    FirstJoyCommandMenu = vk54
    else if 1JoyR &gt; 90
    FirstJoyCommandMenu = Numpad5
    else FirstJoyCommandMenu =     
    }
else if 1JoyU &gt; 80
    {
    if 1JoyR &lt; 20
    FirstJoyCommandMenu = Numpad2
    else if 1JoyR between 40 and 60
    FirstJoyCommandMenu = Numpad3
    else if 1JoyR &gt; 80
    FirstJoyCommandMenu = Numpad4
    else FirstJoyCommandMenu =
    }
else FirstJoyCommandMenu =

if FirstJoyCommandMenu = %FirstJoyCommandMenuPrev%
return

SetKeyDelay -1
if FirstJoyCommandMenu
{
IfWinNotActive, WoT Client
    {
    SendMessage, 0x06, 1,,, WoT Client
    ControlSend,, {%FirstJoyCommandMenu% down}, WoT Client
    } 
}
if FirstJoyCommandMenuPrev
{
IfWinNotActive, WoT Client
    {
    SendMessage, 0x06, 1,,, WoT Client
    ControlSend,, {%FirstJoyCommandMenuPrev% up}, WoT Client
    } 
}
return

;;;;;;;;;;;;первый геймпад выстрел в неактивном окне

WatchAxisFirstJoyShoot:
GetKeyState, 1JoyZ, 1JoyZ
FirstJoyShootPrev = %FirstJoyShoot%

if 1JoyZ &lt; 30
    FirstJoyShoot = LButton
else
    FirstJoyShoot =

if FirstJoyShoot = %FirstJoyShootPrev%
    return

SetKeyDelay -1
if FirstJoyShoot
{
IfWinNotActive, WoT Client
    {
    SendMessage, 0x201,,,, WoT Client
    }
}
if FirstJoyShootPrev
{
IfWinNotActive, WoT Client
    {
    SendMessage, 0x202,,,, WoT Client
    }
}
return

;;;;;;;;;;;;;первый геймпад крестовина в неактивном окне

WatchFirstJoyPOV:
GetKeyState, 1JoyPOV, 1JoyPOV
FirstJoyPOVPrev = %FirstJoyPOV%

 if 1JoyPOV = 0
    FirstJoyPOV = vk52
else if 1JoyPOV = 18000
    FirstJoyPOV = vk46
else if 1JoyPOV = 27000
    FirstJoyPOV = vk58
else if 1JoyPOV = 9000
    FirstJoyPOV = vk43
else FirstJoyPOV = 

if FirstJoyPOV = %FirstJoyPOVPrev%
return

SetKeyDelay -1
if FirstJoyPOV
{
IfWinNotActive, WoT Client
    {
    SendMessage, 0x06, 1,,, WoT Client
    ControlSend,, {%FirstJoyPOV% down}, WoT Client
    }
}
if FirstJoyPOVPrev
{
IfWinNotActive, WoT Client
    {
    SendMessage, 0x06, 1,,, WoT Client
    ControlSend,, {%FirstJoyPOVprev% up}, WoT Client
    }
}
return

;;;;;;;;;;;;первый геймпад LShift в неактивном окне

1Joy10::
{
IfWinNotActive, WoT Client
    {
    SendMessage, 0x06, 1,,, WoT Client
    ControlSend,, {vkA0 Down}, WoT Client
    KeyWait, 1Joy10
    ControlSend,, {vkA0 Up}, WoT Client
    }
}
return

;;;;;;;;;;;;первый геймпад Space в неактивном окне

1Joy9::
{
IfWinNotActive, WoT Client
    {
    SendMessage, 0x06, 1,,, WoT Client
    ControlSend,, {vk20 Down}, WoT Client
    KeyWait, 1Joy9
    ControlSend,, {vk20 Up}, WoT Client
    }
}
return

;;;;;;;;;;;;первый геймпад выбор снарядов в неактивном окне

1Joy1::
Gosub, FirstSubToggle
Return

FirstSubToggle:
FirstToggle++
If FirstToggle = 1
{
IfWinNotActive, WoT Client
    {
    SendMessage, 0x06, 1,,, WoT Client
    ControlSend,, {vk31 down}, WoT Client
    Sleep, 10
    ControlSend,, {vk31 up}, WoT Client
    Sleep, 10
    SendMessage, 0x06, 1,,, WoT Client
    ControlSend,, {vk31 down}, WoT Client
    Sleep, 10
    ControlSend,, {vk31 up}, WoT Client    
    }
}
If FirstToggle = 2
{
IfWinNotActive, WoT Client
    {
    SendMessage, 0x06, 1,,, WoT Client
    ControlSend,, {vk32 down}, WoT Client
    Sleep, 10
    ControlSend,, {vk32 up}, WoT Client
    Sleep, 10
    SendMessage, 0x06, 1,,, WoT Client
    ControlSend,, {vk32 down}, WoT Client
    Sleep, 10
    ControlSend,, {vk32 up}, WoT Client    
    }
}
If FirstToggle = 3
{
IfWinNotActive, WoT Client
    {
    SendMessage, 0x06, 1,,, WoT Client
    ControlSend,, {vk33 down}, WoT Client
    Sleep, 10
    ControlSend,, {vk33 up}, WoT Client
    Sleep, 10
    SendMessage, 0x06, 1,,, WoT Client
    ControlSend,, {vk33 down}, WoT Client
    Sleep, 10
    ControlSend,, {vk33 up}, WoT Client    
    }
FirstToggle = 0
}
return

;;;;;;;;;;;;первый геймпад огнетушитель в неактивном окне

1Joy4::
{
IfWinNotActive, WoT Client
    {
    SendMessage, 0x06, 1,,, WoT Client
    ControlSend,, {vk35 Down}, WoT Client
    KeyWait, 1Joy4
    ControlSend,, {vk35 Up}, WoT Client
    }
}
return

;;;;;;;;;;;;первый геймпад автоприцел в неактивном окне

1Joy6::
{
IfWinNotActive, WoT Client
    {
    SendMessage, 0x204, 1,,, WoT Client
    KeyWait, 1Joy6
    SendMessage, 0x205, 1,,, WoT Client
    }
}
return

;;;;;;;;;;;;первый геймпад меню в неактивном окне

1Joy8::
{
IfWinNotActive, WoT Client
    {
    SendMessage, 0x06, 1,,, WoT Client
    ControlSend,, {vk1B Down}, WoT Client
    KeyWait, 1Joy8
    ControlSend,, {vk1B Up}, WoT Client
    }
}
return

;;;;;;;;;;;;первый геймпад скрыть мини карту в неактивном окне

1Joy7::
{
IfWinNotActive, WoT Client
    {
    SendMessage, 0x06, 1,,, WoT Client
    ControlSend,, {vk4D Down}, WoT Client
    KeyWait, 1Joy7
    ControlSend,, {vk4D Up}, WoT Client
    }
}
return

;;;;;;;;;;;;первый геймпад ремонт в неактивном окне

1Joy3::
{
IfWinNotActive, WoT Client
    {
    SendMessage, 0x06, 1,,, WoT Client
    ControlSend,, {vk34 Down}, WoT Client
    KeyWait, 1Joy3
    ControlSend,, {vk34 Up}, WoT Client
    }   
}
return

;;;;;;;;;;;;первый геймпад лечение в неактивном окне

1Joy2::
{
IfWinNotActive, WoT Client
    {
    SendMessage, 0x06, 1,,, WoT Client
    ControlSend,, {vk36 Down}, WoT Client
    KeyWait, 1Joy2
    ControlSend,, {vk36 Up}, WoT Client
    }    
}
return

;;;;;;;;;;;;второй геймпад

;;;;;;;;;;;;второй геймпад движение вперед/назад в активном окне и зум

WatchAxisSecondJoyMoveForwardAndZoom:
GetKeyState, 2JoyY, 2JoyY
GetKeyState, 2JoyZ, 2JoyZ
GetKeyState, 2Joy2, 2Joy2
GetKeyState, 2Joy3, 2Joy3
SecondJoyMoveForwardAndZoomPrev = %SecondJoyMoveForwardAndZoom%

if 2Joy2 = D
    GoSub, SecondJoyConsumables
else if 2Joy3 = D
    GoSub, SecondJoyConsumables
else 
{
if 2JoyZ &gt; 70
    {
    if 2JoyY &lt; 30
        SecondJoyMoveForwardAndZoom = PgDn
    else if 2JoyY &gt; 70
        SecondJoyMoveForwardAndZoom = PgUp
    else
        SecondJoyMoveForwardAndZoom =
    }
else if 2JoyY &lt; 30
    SecondJoyMoveForwardAndZoom = vk57
else if 2JoyY &gt; 70 
    SecondJoyMoveForwardAndZoom = vk53
else
    SecondJoyMoveForwardAndZoom =
}

if SecondJoyMoveForwardAndZoom = %SecondJoyMoveForwardAndZoomPrev%
    return

SetKeyDelay -1
if SecondJoyMoveForwardAndZoom
{
    ControlSend,, {%SecondJoyMoveForwardAndZoom% down}, [#] WoT Client [#]
}
if SecondJoyMoveForwardAndZoomPrev
{
    ControlSend,, {%SecondJoyMoveForwardAndZoomPrev% up}, [#] WoT Client [#]
}
return

;;;;;;;;;;;;второй геймпад движение влево/вправо в активном окне

WatchAxisSecondJoyMoveRotate:
GetKeyState, 2JoyX, 2JoyX
GetKeyState, 2Joy2, 2Joy2
GetKeyState, 2Joy3, 2Joy3
SecondJoyMoveRotatePrev = %SecondJoyMoveRotate%

if 2Joy2 = D
    GoSub, SecondJoyConsumables
else if 2Joy3 = D
    GoSub, SecondJoyConsumables
else
{
if 2JoyX &gt; 80
    SecondJoyMoveRotate = vk44
else if 2JoyX &lt; 20
    SecondJoyMoveRotate = vk41
else
    SecondJoyMoveRotate =
}

if SecondJoyMoveRotate = %SecondJoyMoveRotatePrev%
    return

SetKeyDelay -1
if SecondJoyMoveRotate
{
    ControlSend,, {%SecondJoyMoveRotate% down}, [#] WoT Client [#]
}
if SecondJoyMoveRotatePrev
{
    ControlSend,, {%SecondJoyMoveRotatePrev% up}, [#] WoT Client [#]
}
return

;;;;;;;;;;;;второй геймпад меню расходников

SecondJoyConsumables:
SecondJoyConsumablesPrev = %SecondJoyConsumables%

if 2JoyX &lt; 20
    {
    if 2JoyY &lt; 20
    SecondJoyConsumables = vk38
    else if 2JoyY between 40 and 60
    SecondJoyConsumables = vk37
    else if 2JoyY &gt; 80
    SecondJoyConsumables = vk36
    else SecondJoyConsumables =
    }
else if 2JoyX between 40 and 60
    {
    if 2JoyY &lt; 10
    SecondJoyConsumables = vk31
    else if 2JoyY &gt; 90
    SecondJoyConsumables = vk35
    else SecondJoyConsumables =     
    }
else if 2JoyX &gt; 80
    {
    if 2JoyY &lt; 20
    SecondJoyConsumables = vk32
    else if 2JoyY between 40 and 60
    SecondJoyConsumables = vk33
    else if 2JoyY &gt; 80
    SecondJoyConsumables = vk34
    else SecondJoyConsumables =
    }
else SecondJoyConsumables =

if SecondJoyConsumables = %SecondJoyConsumablesPrev%
return

SetKeyDelay -1
if SecondJoyConsumables
{
    ControlSend,, {%SecondJoyConsumables% down}, [#] WoT Client [#]
}
if SecondJoyConsumablesPrev
{
    ControlSend,, {%SecondJoyConsumablesPrev% up}, [#] WoT Client [#] 
}
return

;;;;;;;;;;;;второй геймпад обзор и мышь в активном окне

WatchAxisSecondJoyCameraRotate:
MouseNeedsToBeMoved := false
SetFormat, float, 03
GetKeyState, 2JoyU, 2JoyU
GetKeyState, 2JoyR, 2JoyR
GetKeyState, 2Joy5, 2Joy5

if 2Joy5 = D
    GoSub, SecondJoyCommandMenu
else if 2Joy5 = U
{
if 2JoyU &gt; %JoyThresholdUpper%
{
    MouseNeedsToBeMoved := true
    DeltaU := 2JoyU - JoyThresholdUpper
}
else if 2JoyU &lt; %JoyThresholdLower%
{
    MouseNeedsToBeMoved := true
    DeltaU := 2JoyU - JoyThresholdLower
}
else
    DeltaU = 0
if 2JoyR &gt; %JoyThresholdUpper%
{
    MouseNeedsToBeMoved := true
    DeltaR := 2JoyR - JoyThresholdUpper
}
else if 2JoyR &lt; %JoyThresholdLower%
{
    MouseNeedsToBeMoved := true
    DeltaR := 2JoyR - JoyThresholdLower
}
else
    DeltaR = 0
}

SetKeyDelay -1
if MouseNeedsToBeMoved
{
        SetMouseDelay, -1  ; Makes movement smoother 
    x := (DeltaU/30) * (ABS(DeltaU)/30) * JoyMultiplier
        y := (DeltaR/30) * (ABS(DeltaR)/30) * JoyMultiplier 
        DllCall(&quot;mouse_event&quot;, uint, 1, int, x, int, y, uint, 0, int, 0)
}
return

;;;;;;;;;;;;второй геймпад меню приказов

SecondJoyCommandMenu:
SecondJoyCommandMenuPrev = %SecondJoyCommandMenu%

if 2JoyU &lt; 20
    {
    if 2JoyR &lt; 20
    SecondJoyCommandMenu = Numpad8
    else if 2JoyR between 40 and 60
    SecondJoyCommandMenu = Numpad7
    else if 2JoyR &gt; 80
    SecondJoyCommandMenu = Numpad6
    else SecondJoyCommandMenu =
    }
else if 2JoyU between 40 and 60
    {
    if 2JoyR &lt; 10
    SecondJoyCommandMenu = vk54
    else if 2JoyR &gt; 90
    SecondJoyCommandMenu = Numpad5
    else SecondJoyCommandMenu =     
    }
else if 2JoyU &gt; 80
    {
    if 2JoyR &lt; 20
    SecondJoyCommandMenu = Numpad2
    else if 2JoyR between 40 and 60
    SecondJoyCommandMenu = Numpad3
    else if 2JoyR &gt; 80
    SecondJoyCommandMenu = Numpad4
    else SecondJoyCommandMenu =
    }
else SecondJoyCommandMenu =

if SecondJoyCommandMenu = %SecondJoyCommandMenuPrev%
return

SetKeyDelay -1
if SecondJoyCommandMenu
{
    ControlSend,, {%SecondJoyCommandMenu% down}, [#] WoT Client [#]
}
if SecondJoyCommandMenuPrev
{
    ControlSend,, {%SecondJoyCommandMenuPrev% up}, [#] WoT Client [#] 
}
return

;;;;;;;;;;;;второй геймпад выстрел в активном окне

WatchAxisSecondJoyShoot:
GetKeyState, 2JoyZ, 2JoyZ
SecondJoyShootPrev = %SecondJoyShoot%

if 2JoyZ &lt; 30
    SecondJoyShoot = LButton
else
    SecondJoyShoot =

if SecondJoyShoot = %SecondJoyShootPrev%
    return

SetKeyDelay -1
if SecondJoyShoot
{
    Send, {%SecondJoyShoot% down} 
}
if SecondJoyShootPrev
{
    Send, {%SecondJoyShootPrev% up} 
}
return

;;;;;;;;;;;;;второй геймпад крестовина в активном окне

WatchSecondJoyPOV:
GetKeyState, 2JoyPOV, 2JoyPOV
SecondJoyPOVPrev = %SecondJoyPOV%

if 2JoyPOV = 0
    SecondJoyPOV = vk52
else if 2JoyPOV = 18000
    SecondJoyPOV = vk46
else if 2JoyPOV = 27000
    SecondJoyPOV = vk58
else if 2JoyPOV = 9000
    SecondJoyPOV = vk43
else SecondJoyPOV = 

if SecondJoyPOV = %SecondJoyPOVPrev%
return

SetKeyDelay -1
if SecondJoyPOV
{
    ControlSend,, {%SecondJoyPOV% down}, [#] WoT Client [#]
}
if SecondJoyPOVPrev
{
    ControlSend,, {%SecondJoyPOVprev% up}, [#] WoT Client [#]
}
return

;;;;;;;;;;;;второй геймпад LShift в активном окне

2Joy10::
{
    ControlSend,, {vkA0 Down}, [#] WoT Client [#]
    KeyWait, 2Joy10
    ControlSend,, {vkA0 Up}, [#] WoT Client [#]
}
return

;;;;;;;;;;;;второй геймпад Space в активном окне

2Joy9::
{
    ControlSend,, {vk20 Down}, [#] WoT Client [#]
    KeyWait, 2Joy9
    ControlSend,, {vk20 Up}, [#] WoT Client [#]
}
return

;;;;;;;;;;;;второй геймпад выбор снарядов в неактивном окне

2Joy1::
Gosub, SecondSubToggle
Return

SecondSubToggle:
SecondToggle++
If SecondToggle = 1
{
    ControlSend,, {vk31 down}, [#] WoT Client [#]
    Sleep, 10
    ControlSend,, {vk31 up}, [#] WoT Client [#]
    Sleep, 10
    ControlSend,, {vk31 down}, [#] WoT Client [#]
    Sleep, 10
    ControlSend,, {vk31 up}, [#] WoT Client [#]
}
If SecondToggle = 2
{
    ControlSend,, {vk32 down}, [#] WoT Client [#]
    Sleep, 10
    ControlSend,, {vk32 up}, [#] WoT Client [#]
    Sleep, 10
    ControlSend,, {vk32 down}, [#] WoT Client [#] 
    Sleep, 10
    ControlSend,, {vk32 up}, [#] WoT Client [#]
}
If SecondToggle = 3
{
    ControlSend,, {vk33 down}, [#] WoT Client [#]
    Sleep, 10
    ControlSend,, {vk33 up}, [#] WoT Client [#]
    Sleep, 10
    ControlSend,, {vk33 down}, [#] WoT Client [#]
    Sleep, 10
    ControlSend,, {vk33 up}, [#] WoT Client [#]
    SecondToggle = 0
}
return

;;;;;;;;;;;;второй геймпад огнетушитель в активном окне

2Joy4::
{
    ControlSend,, {vk35 Down}, [#] WoT Client [#]
    KeyWait, 2Joy4
    ControlSend,, {vk35 Up}, W[#] WoT Client [#]
}
return

;;;;;;;;;;;;второй геймпад автоприцел в активном окне

2Joy6::
{
    Send, {RButton Down}
    KeyWait, 2Joy6
    Send, {RButton up}
}
return

;;;;;;;;;;;;второй геймпад меню в неактивном окне

2Joy8::
{
    ControlSend,, {vk1B Down}, [#] WoT Client [#]
    KeyWait, 2Joy8
    ControlSend,, {vk1B Up}, [#] WoT Client [#]
}
return

;;;;;;;;;;;;второй геймпад скрыть мини карту в активном окне

2Joy7::
{
    ControlSend,, {vk4D Down}, [#] WoT Client [#]
    KeyWait, 2Joy7
    ControlSend,, {vk4D Up}, [#] WoT Client [#]    
}
return

;;;;;;;;;;;;второй геймпад скрыть мини карту в активном окне

2Joy5::
{
    ControlSend,, {vk5A Down}, [#] WoT Client [#]
    KeyWait, 2Joy5
    ControlSend,, {vk5A Up}, [#] WoT Client [#]    
}
return

;;;;;;;;;;;;второй геймпад ремонт

2Joy3::
{
    ControlSend,, {vk34 Down}, [#] WoT Client [#]
    KeyWait, 2Joy3
    ControlSend,, {vk34 Up}, [#] WoT Client [#]   
}
return

;;;;;;;;;;;;второй геймпад лечение

2Joy2::
{
    ControlSend,, {vk36 Down}, [#] WoT Client [#]
    KeyWait, 2Joy2
    ControlSend,, {vk36 Up}, [#] WoT Client [#]    
}
return</code></pre></div></div></div>]]></content>
			<author>
				<name><![CDATA[kharlashkin]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=32183</uri>
			</author>
			<updated>2014-06-26T07:08:52Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=84225#p84225</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Отправка нажатий клавиш в неактивное окно World of Tanks]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=84117#p84117" />
			<content type="html"><![CDATA[<p>Прошу прощения, вроде нашел ответ на свой вопрос.</p><div class="codebox"><pre><code>#Persistent
SetTimer, WatchAxisSecondJoy, 10

WatchAxisSecondJoy:
GetKeyState, 1JoyU, 1JoyU
GetKeyState, 1JoyR, 1JoyR
SecondJoyPrev = %SecondJoy%

if 1JoyU &lt; 20
    {
    if 1JoyR between 6 and 20
    SecondJoy = 8
    else if 1JoyR between 80 and 94
    SecondJoy = 6
    else SecondJoy =
    }
else if 1JoyU between 30 and 60
    {
    if 1JoyR &lt; 5
    SecondJoy = 1
    else if 1JoyR &gt; 95
    SecondJoy = 5
    else SecondJoy =     
    }
else SecondJoy =

if SecondJoy = %SecondJoyPrev%
    return

SetKeyDelay -1
if SecondJoy
{
    SendMessage, 0x06, 1,,, WoT Client        
    ControlSend,, {%SecondJoy% down}, WoT Client
}
if SecondJoyPrev
{
    SendMessage, 0x06, 1,,, WoT Client
    ControlSend,, {%SecondJoyPrev% up}, WoT Client
}
return</code></pre></div><p>Скрипт отправляет в неактивное окно игры правильно отклонения <img src="//forum.script-coding.com/img/smilies/wink.png" width="15" height="15" /></p>]]></content>
			<author>
				<name><![CDATA[kharlashkin]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=32183</uri>
			</author>
			<updated>2014-06-23T15:57:41Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=84117#p84117</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Отправка нажатий клавиш в неактивное окно World of Tanks]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=84113#p84113" />
			<content type="html"><![CDATA[<p>Нужна помощь, а то уже голову сломал. Не могу назначить кнопки на отклонения стиков. Вернее в моих предыдущих постах я назначал кнопки на отклонение (вверх или вниз), но нужно как бы часовое отклонение например вверх - 1, вверх и вправо - 2, вправо - 3 и т.д. подскажите как сделать проверку для такого варианта... Не могу ничего нагуглить.</p>]]></content>
			<author>
				<name><![CDATA[kharlashkin]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=32183</uri>
			</author>
			<updated>2014-06-23T13:56:29Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=84113#p84113</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Отправка нажатий клавиш в неактивное окно World of Tanks]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=83984#p83984" />
			<content type="html"><![CDATA[<p>Ложная тревога, практически сразу решилась проблема:<br /></p><div class="codebox"><pre><code>JoyMultiplier = 10

JoyThreshold = 5

#SingleInstance
#Persistent
JoyThresholdUpper := 50 + JoyThreshold
JoyThresholdLower := 50 - JoyThreshold

SetTimer, WatchJoystick, 10

WatchJoystick:
MouseNeedsToBeMoved := false
SetFormat, float, 03
GetKeyState, joyu, 1JoyX
GetKeyState, joyr, 1JoyY
if joyu &gt; %JoyThresholdUpper%
{
    MouseNeedsToBeMoved := true
    DeltaU := joyu - JoyThresholdUpper
}
else if joyu &lt; %JoyThresholdLower%
{
    MouseNeedsToBeMoved := true
    DeltaU := joyu - JoyThresholdLower
}
else
    DeltaU = 0
if joyr &gt; %JoyThresholdUpper%
{
    MouseNeedsToBeMoved := true
    DeltaR := joyr - JoyThresholdUpper
}
else if joyr &lt; %JoyThresholdLower%
{
    MouseNeedsToBeMoved := true
    DeltaR := joyr - JoyThresholdLower
}
else
    DeltaR = 0

if MouseNeedsToBeMoved
{
        SetMouseDelay, -1  ; Makes movement smoother 
        x := (DeltaU/30) * (ABS(DeltaU)/30) * JoyMultiplier
        y := (DeltaR/30) * (ABS(DeltaR)/30) * JoyMultiplier 
        DllCall(&quot;mouse_event&quot;, uint, 1, int, x, int, y, uint, 0, int, 0)
}
return</code></pre></div><p>Может кто подскажет - нельзя ли таким образом отправлять в неактивное окно перемещения мыши?</p>]]></content>
			<author>
				<name><![CDATA[kharlashkin]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=32183</uri>
			</author>
			<updated>2014-06-19T09:38:27Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=83984#p83984</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Отправка нажатий клавиш в неактивное окно World of Tanks]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=83983#p83983" />
			<content type="html"><![CDATA[<p>Пришла беда откуда не ждали... Не могу двигать мышью в бою, убил вечер на формулу движения мышкой через mousemove, в ангаре и в Windows двигается как надо, в игре прицел очень сильно дергается&nbsp; - в общем неиграбельно.<br /></p><div class="fancy_spoiler_switcher"><div class="fancy_spoiler_switcher_header" data-lang-open="открыть спойлер" data-lang-close="скрыть спойлер"><strong>+</strong>&nbsp;открыть спойлер</div><div class="fancy_spoiler"><div class="codebox"><pre><code>JoyMultiplier = 10

JoyThreshold = 5

InvertYAxis := false

#SingleInstance
#Persistent
JoyThresholdUpper := 50 + JoyThreshold
JoyThresholdLower := 50 - JoyThreshold
if InvertYAxis
    YAxisMultiplier = -1
else
    YAxisMultiplier = 1

SetTimer, WatchJoystick, 10

WatchJoystick:
MouseNeedsToBeMoved := false
SetFormat, float, 03
GetKeyState, joyu, 1JoyU
GetKeyState, joyr, 1JoyR
if joyu &gt; %JoyThresholdUpper%
{
    MouseNeedsToBeMoved := true
    DeltaU := joyu - JoyThresholdUpper
}
else if joyu &lt; %JoyThresholdLower%
{
    MouseNeedsToBeMoved := true
    DeltaU := joyu - JoyThresholdLower
}
else
    DeltaU = 0
if joyr &gt; %JoyThresholdUpper%
{
    MouseNeedsToBeMoved := true
    DeltaR := joyr - JoyThresholdUpper
}
else if joyr &lt; %JoyThresholdLower%
{
    MouseNeedsToBeMoved := true
    DeltaR := joyr - JoyThresholdLower
}
else
    DeltaR = 0

if MouseNeedsToBeMoved
{
        SetMouseDelay, -1  ; Makes movement smoother 
    MouseMove, (DeltaU/30) * (ABS(DeltaU)/30) * JoyMultiplier, (DeltaR/30) * (ABS(DeltaR)/30) * JoyMultiplier * YAxisMultiplier, 0, R
}
return</code></pre></div></div></div><p>Где-то встречал про &quot;глобальные перемещения&quot; мыши, для игр с прицелом. Может кто подскажет?</p>]]></content>
			<author>
				<name><![CDATA[kharlashkin]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=32183</uri>
			</author>
			<updated>2014-06-19T09:23:48Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=83983#p83983</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Отправка нажатий клавиш в неактивное окно World of Tanks]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=83903#p83903" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>kharlashkin пишет:</cite><blockquote><p>Если же кнопка &quot;Х&quot; не нажата то левый стик работает как обчно - то есть отправляет клавиши &quot;WASD&quot;.<br />Подскажите где посмотреть на пример.</p></blockquote></div><p>Вроде разобрался - этот код работает:<br /></p><div class="codebox"><pre><code>#Persistent
SetTimer, WatchAxisFirstSwitchAmmoTypes, 10
return

;;;;;;;;;;;;

WatchAxisFirstSwitchAmmoTypes:
GetKeyState, 1JoyX, 1JoyX
GetKeyState, 1Joy1, 1Joy1
FirstSwitchAmmoTypesPrev = %FirstSwitchAmmoTypes%

if (1Joy1 = &quot;D&quot;) &amp; (1JoyX &lt; 30)
    FirstSwitchAmmoTypes = vk32
else
    FirstSwitchAmmoTypes =

if FirstSwitchAmmoTypes = %FirstSwitchAmmoTypesPrev%
    return

SetKeyDelay -1
if FirstSwitchAmmoTypes
{
IfWinNotActive, WoT Client
    {
    SendMessage, 0x06, 1,,, WoT Client
    ControlSend,, {%FirstSwitchAmmoTypes% down}, WoT Client
    }
}
if FirstSwitchAmmoTypesPrev
{
IfWinNotActive, WoT Client
    {
    SendMessage, 0x06, 1,,, WoT Client
    ControlSend,, {%FirstSwitchAmmoTypesPrev% up}, WoT Client
    }
}
return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[kharlashkin]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=32183</uri>
			</author>
			<updated>2014-06-16T12:34:32Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=83903#p83903</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Отправка нажатий клавиш в неактивное окно World of Tanks]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=83900#p83900" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>serzh82saratov пишет:</cite><blockquote><div class="codebox"><pre><code>ControlSend,, {%FirstJoyMoveForward% down}, WoT Client</code></pre></div><p>А ahk_parent в этой команде не помогает?</p></blockquote></div><p>Специально проверил - эффект тот же, скрипт отправляет команды, но принимаются только после активации окна.<br /></p><div class="codebox"><pre><code>#Persistent
SetTimer, WatchAxisFirstJoyMoveForward, 10
return

;;;;;;;;;;;;

WatchAxisFirstJoyMoveForward:
GetKeyState, 1JoyY, 1JoyY
FirstJoyMoveForwardPrev = %FirstJoyMoveForward%

if 1JoyY &gt; 70
    FirstJoyMoveForward = vk53
else if 1JoyY &lt; 30
    FirstJoyMoveForward = vk57
else
    FirstJoyMoveForward =

if FirstJoyMoveForward = %FirstJoyMoveForwardPrev%
    return

SetKeyDelay -1
IfWinNotActive, WoT Client
if FirstJoyMoveForward
{
IfWinNotActive, WoT Client
    {
    ControlSend, ahk_parent, {%FirstJoyMoveForward% down}, WoT Client
    }
}
if FirstJoyMoveForwardPrev
{
IfWinNotActive, WoT Client
    {
    ControlSend, ahk_parent, {%FirstJoyMoveForwardPrev% up}, WoT Client
    }
}
return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[kharlashkin]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=32183</uri>
			</author>
			<updated>2014-06-16T10:32:30Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=83900#p83900</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Отправка нажатий клавиш в неактивное окно World of Tanks]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=83899#p83899" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>serzh82saratov пишет:</cite><blockquote><div class="codebox"><pre><code>ControlSend,, {%FirstJoyMoveForward% down}, WoT Client</code></pre></div><p>А ahk_parent в этой команде не помогает?</p></blockquote></div><p>Насколько я понимаю (если неправильно поправьте меня) - этот параметр отправляет команды непосредственно exe-шнику, т.е. WorldofTanks.exe.</p><p>Никаким способом кроме обмана (SendMessage, 0x06, 1,,, WoT Client) мне не удалось заставить игру принимать нажатия клавиш, пробовал и exe, и PID. Вернее даже не так, команды отправлялись и игра их принимала, но только лишь тогда когда окно становилось активным. Подробнее в этом <a href="http://forum.script-coding.com/viewtopic.php?pid=82511#p82511">сообщении</a>.</p>]]></content>
			<author>
				<name><![CDATA[kharlashkin]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=32183</uri>
			</author>
			<updated>2014-06-16T10:22:43Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=83899#p83899</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Отправка нажатий клавиш в неактивное окно World of Tanks]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=83898#p83898" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>ControlSend,, {%FirstJoyMoveForward% down}, WoT Client</code></pre></div><p>А ahk_parent в этой команде не помогает?</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2014-06-16T09:22:42Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=83898#p83898</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Отправка нажатий клавиш в неактивное окно World of Tanks]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=83897#p83897" />
			<content type="html"><![CDATA[<p>Хочу попросить помощи у сообщества в организации следующего алгоритма.<br />Сейчас на кнопки геймпада &quot;X&quot;, &quot;Y&quot; и &quot;B&quot; назначены просто цифры &quot;1, &quot;2&quot; и &quot;3&quot;, которые в игре служат для выбора типа снарядов.<br />Хочу на них повесить сочетание, например если нажата кнопка &quot;X&quot; и двигаешь левый стик влево, то в игру отправляется &quot;1&quot;, если нажата кнопка &quot;X&quot; и двигаешь левый стик вверх - отправляется &quot;2&quot;, если &quot;Х&quot; и вправо - то &quot;3&quot;.<br />Если же кнопка &quot;Х&quot; не нажата то левый стик работает как обчно - то есть отправляет клавиши &quot;WASD&quot;.<br />Подскажите где посмотреть на пример.</p>]]></content>
			<author>
				<name><![CDATA[kharlashkin]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=32183</uri>
			</author>
			<updated>2014-06-16T09:21:20Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=83897#p83897</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Отправка нажатий клавиш в неактивное окно World of Tanks]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=83896#p83896" />
			<content type="html"><![CDATA[<p>Не знаю правильно ли, но вроде работает &quot;защита&quot;:<br /></p><div class="codebox"><pre><code>#Persistent
SetTimer, WatchAxisFirstJoyMoveForward, 10
SetTimer, WatchAxisFirstJoyMoveRotate, 10
SetTimer, WatchAxisFirstJoyCameraRotateVert, 10
SetTimer, WatchAxisFirstJoyCameraRotateHoriz, 10
SetTimer, WatchAxisFirstJoyShoot, 10
SetTimer, WatchFirstJoyPOV, 10
return

;;;;;;;;;;;;

WatchAxisFirstJoyMoveForward:
GetKeyState, 1JoyY, 1JoyY
FirstJoyMoveForwardPrev = %FirstJoyMoveForward%

if 1JoyY &gt; 70
    FirstJoyMoveForward = vk53
else if 1JoyY &lt; 30
    FirstJoyMoveForward = vk57
else
    FirstJoyMoveForward =

if FirstJoyMoveForward = %FirstJoyMoveForwardPrev%
    return

SetKeyDelay -1
if FirstJoyMoveForward
{
IfWinNotActive, WoT Client
    {
    SendMessage, 0x06, 1,,, WoT Client
    ControlSend,, {%FirstJoyMoveForward% down}, WoT Client
    }
}
if FirstJoyMoveForwardPrev
{
IfWinNotActive, WoT Client
    {
    SendMessage, 0x06, 1,,, WoT Client
    ControlSend,, {%FirstJoyMoveForwardPrev% up}, WoT Client
    }
}
return

;;;;;;;;;;;;

WatchAxisFirstJoyMoveRotate:
GetKeyState, 1JoyX, 1JoyX
FirstJoyMoveRotatePrev = %FirstJoyMoveRotate%

if 1JoyX &gt; 80
    FirstJoyMoveRotate = vk44
else if 1JoyX &lt; 20
    FirstJoyMoveRotate = vk41
else
    FirstJoyMoveRotate =

if FirstJoyMoveRotate = %FirstJoyMoveRotatePrev%
    return

SetKeyDelay -1
if FirstJoyMoveRotate
{
IfWinNotActive, WoT Client
    {
    SendMessage, 0x06, 1,,, WoT Client
    ControlSend,, {%FirstJoyMoveRotate% down}, WoT Client
    }
}
if FirstJoyMoveRotatePrev
{
IfWinNotActive, WoT Client
    {
    SendMessage, 0x06, 1,,, WoT Client
    ControlSend,, {%FirstJoyMoveRotatePrev% up}, WoT Client
    }
}
return

;;;;;;;;;;;;

WatchAxisFirstJoyCameraRotateVert:
GetKeyState, 1JoyU, 1JoyU
FirstJoyCameraRotateVertPrev = %FirstJoyCameraRotateVert%

if 1JoyU &gt; 70
    FirstJoyCameraRotateVert = Right
else if 1JoyU &lt; 30
    FirstJoyCameraRotateVert = Left
else
    FirstJoyCameraRotateVert =

if FirstJoyCameraRotateVert = %FirstJoyCameraRotateVertPrev%
    return

SetKeyDelay -1
if FirstJoyCameraRotateVert
{
IfWinNotActive, WoT Client
    {
    SendMessage, 0x06, 1,,, WoT Client
    ControlSend,, {%FirstJoyCameraRotateVert% down}, WoT Client
    }
}
if FirstJoyCameraRotateVertPrev
{
IfWinNotActive, WoT Client
    {
    SendMessage, 0x06, 1,,, WoT Client
    ControlSend,, {%FirstJoyCameraRotateVertPrev% up}, WoT Client
    }
}
return

;;;;;;;;;;;;

WatchAxisFirstJoyCameraRotateHoriz:
GetKeyState, 1JoyR, 1JoyR
FirstJoyCameraRotateHorizPrev = %FirstJoyCameraRotateHoriz%

if 1JoyR &gt; 70
    FirstJoyCameraRotateHoriz = Down
else if 1JoyR &lt; 30
    FirstJoyCameraRotateHoriz = Up
else
    FirstJoyCameraRotateHoriz =

if FirstJoyCameraRotateHoriz = %FirstJoyCameraRotateHorizPrev%
    return

SetKeyDelay -1
if FirstJoyCameraRotateHoriz
{
IfWinNotActive, WoT Client
    {
    SendMessage, 0x06, 1,,, WoT Client
    ControlSend,, {%FirstJoyCameraRotateHoriz% down}, WoT Client
    }
}
if FirstJoyCameraRotateHorizPrev
{
IfWinNotActive, WoT Client
    {
    SendMessage, 0x06, 1,,, WoT Client
    ControlSend,, {%FirstJoyCameraRotateHorizPrev% up}, WoT Client
    }
}
return

;;;;;;;;;;;;

WatchAxisFirstJoyShoot:
GetKeyState, 1JoyZ, 1JoyZ
FirstJoyShootPrev = %FirstJoyShoot%

if 1JoyZ &lt; 30
    FirstJoyShoot = vk01
else
    FirstJoyShoot =

if FirstJoyShoot = %FirstJoyShootPrev%
    return

SetKeyDelay -1
if FirstJoyShoot
{
IfWinNotActive, WoT Client
    {
    SendMessage, 0x201,,,, WoT Client
    }
}
if FirstJoyShootPrev
{
IfWinNotActive, WoT Client
    {
    SendMessage, 0x202,,,, WoT Client
    }
}
return

;;;;;;;;;;;;;

WatchFirstJoyPOV:
GetKeyState, 1JoyPOV, 1JoyPOV
FirstJoyPOVPrev = %FirstJoyPOV%

if 1JoyPOV = 0
    FirstJoyPOV = vk52
else if 1JoyPOV = 18000
    FirstJoyPOV = vk46
else if 1JoyPOV = 27000
    FirstJoyPOV = vk58
else if 1JoyPOV = 9000
    FirstJoyPOV = vk43
else FirstJoyPOV = 


if FirstJoyPOV = %FirstJoyPOVPrev%
return

SetKeyDelay -1
if FirstJoyPOV
{
IfWinNotActive, WoT Client
    {
    SendMessage, 0x06, 1,,, WoT Client
    ControlSend,, {%FirstJoyPOV% down}, WoT Client
    }
}
if FirstJoyPOVPrev
{
IfWinNotActive, WoT Client
    {
    SendMessage, 0x06, 1,,, WoT Client
    ControlSend,, {%FirstJoyPOVprev% up}, WoT Client
    }
}
return

;;;;;;;;;;;;

1Joy10::
{
IfWinNotActive, WoT Client
    {
    SendMessage, 0x06, 1,,, WoT Client
    ControlSend,, {vkA0 Down}, WoT Client
    KeyWait, 1Joy10
    ControlSend,, {vkA0 Up}, WoT Client
    }
}
Return

;;;;;;;;;;;;

1Joy9::
{
IfWinNotActive, WoT Client
    {
    SendMessage, 0x06, 1,,, WoT Client
    ControlSend,, {vk20 Down}, WoT Client
    KeyWait, 1Joy9
    ControlSend,, {vk20 Up}, WoT Client
    }
}
Return

;;;;;;;;;;;;

1Joy1::
{
IfWinNotActive, WoT Client
    {
    SendMessage, 0x06, 1,,, WoT Client
    ControlSend,, {vk54 Down}, WoT Client
    KeyWait, 1Joy1
    ControlSend,, {vk54 Up}, WoT Client
    }
}
Return

;;;;;;;;;;;;

1Joy3::
{
IfWinNotActive, WoT Client
    {
    SendMessage, 0x06, 1,,, WoT Client
    ControlSend,, {vk31 Down}, WoT Client
    KeyWait, 1Joy3
    ControlSend,, {vk31 Up}, WoT Client
    }
}
Return

;;;;;;;;;;;;

1Joy4::
{
IfWinNotActive, WoT Client
    {
    SendMessage, 0x06, 1,,, WoT Client
    ControlSend,, {vk32 Down}, WoT Client
    KeyWait, 1Joy4
    ControlSend,, {vk32 Up}, WoT Client
    }
}
Return

;;;;;;;;;;;;

1Joy2::
{
IfWinNotActive, WoT Client
    {
    SendMessage, 0x06, 1,,, WoT Client
    ControlSend,, {vk33 Down}, WoT Client
    KeyWait, 1Joy2
    ControlSend,, {vk33 Up}, WoT Client
    }
}
Return

;;;;;;;;;;;;

1Joy6::
{
IfWinNotActive, WoT Client
    {
    SendMessage, 0x204, 1,,, WoT Client
    KeyWait, 1Joy6
    SendMessage, 0x205, 1,,, WoT Client
    }
}
Return

;;;;;;;;;;;;

1Joy8::
{
IfWinNotActive, WoT Client
    {
    SendMessage, 0x06, 1,,, WoT Client
    ControlSend,, {vk1B Down}, WoT Client
    KeyWait, 1Joy8
    ControlSend,, {vk1B Up}, WoT Client
    }
}
Return

;;;;;;;;;;;;

1Joy7::
{
IfWinNotActive, WoT Client
    {
    SendMessage, 0x06, 1,,, WoT Client
    ControlSend,, {vk4D Down}, WoT Client
    KeyWait, 1Joy7
    ControlSend,, {vk4D Up}, WoT Client
    }
}
Return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[kharlashkin]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=32183</uri>
			</author>
			<updated>2014-06-16T09:13:49Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=83896#p83896</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Отправка нажатий клавиш в неактивное окно World of Tanks]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=83889#p83889" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>kharlashkin пишет:</cite><blockquote><p>В том то и дело, что все что можно нагуглить - это отправка сообщений Control окна, но это мы с Вами уже пробовали. Кстати огромнейшее СПАСИБО Вам!!!</p></blockquote></div><p>Скорее всего разработчики игры используют RAW Input - это можно победить?</p><p>Допилил немного скрипт:<br /></p><div class="codebox"><pre><code>#Persistent
SetTimer, WatchAxisFirstJoyMoveForward, 10
SetTimer, WatchAxisFirstJoyMoveRotate, 10
SetTimer, WatchAxisFirstJoyCameraRotateVert, 10
SetTimer, WatchAxisFirstJoyCameraRotateHoriz, 10
SetTimer, WatchAxisFirstJoyShoot, 10
SetTimer, WatchFirstJoyPOV, 10
return

;;;;;;;;;;;;

WatchAxisFirstJoyMoveForward:
GetKeyState, 1JoyY, 1JoyY
FirstJoyMoveForwardPrev = %FirstJoyMoveForward%

if 1JoyY &gt; 70
    FirstJoyMoveForward = vk53
else if 1JoyY &lt; 30
    FirstJoyMoveForward = vk57
else
    FirstJoyMoveForward =

if FirstJoyMoveForward = %FirstJoyMoveForwardPrev%
    return

SetKeyDelay -1
if FirstJoyMoveForward
{
SendMessage, 0x06, 1,,, WoT Client
ControlSend,, {%FirstJoyMoveForward% down}, WoT Client
}
if FirstJoyMoveForwardPrev
{
SendMessage, 0x06, 1,,, WoT Client
ControlSend,, {%FirstJoyMoveForwardPrev% up}, WoT Client
}
return

;;;;;;;;;;;;

WatchAxisFirstJoyMoveRotate:
GetKeyState, 1JoyX, 1JoyX
FirstJoyMoveRotatePrev = %FirstJoyMoveRotate%

if 1JoyX &gt; 80
    FirstJoyMoveRotate = vk44
else if 1JoyX &lt; 20
    FirstJoyMoveRotate = vk41
else
    FirstJoyMoveRotate =

if FirstJoyMoveRotate = %FirstJoyMoveRotatePrev%
    return

SetKeyDelay -1
if FirstJoyMoveRotate
{
SendMessage, 0x06, 1,,, WoT Client
ControlSend,, {%FirstJoyMoveRotate% down}, WoT Client
}
if FirstJoyMoveRotatePrev
{
SendMessage, 0x06, 1,,, WoT Client
ControlSend,, {%FirstJoyMoveRotatePrev% up}, WoT Client
}
return

;;;;;;;;;;;;

WatchAxisFirstJoyCameraRotateVert:
GetKeyState, 1JoyU, 1JoyU
FirstJoyCameraRotateVertPrev = %FirstJoyCameraRotateVert%

if 1JoyU &gt; 70
    FirstJoyCameraRotateVert = Right
else if 1JoyU &lt; 30
    FirstJoyCameraRotateVert = Left
else
    FirstJoyCameraRotateVert =

if FirstJoyCameraRotateVert = %FirstJoyCameraRotateVertPrev%
    return

SetKeyDelay -1
if FirstJoyCameraRotateVert
{
SendMessage, 0x06, 1,,, WoT Client
ControlSend,, {%FirstJoyCameraRotateVert% down}, WoT Client
}
if FirstJoyCameraRotateVertPrev
{
SendMessage, 0x06, 1,,, WoT Client
ControlSend,, {%FirstJoyCameraRotateVertPrev% up}, WoT Client
}
return

;;;;;;;;;;;;

WatchAxisFirstJoyCameraRotateHoriz:
GetKeyState, 1JoyR, 1JoyR
FirstJoyCameraRotateHorizPrev = %FirstJoyCameraRotateHoriz%

if 1JoyR &gt; 70
    FirstJoyCameraRotateHoriz = Down
else if 1JoyR &lt; 30
    FirstJoyCameraRotateHoriz = Up
else
    FirstJoyCameraRotateHoriz =

if FirstJoyCameraRotateHoriz = %FirstJoyCameraRotateHorizPrev%
    return

SetKeyDelay -1
if FirstJoyCameraRotateHoriz
{
SendMessage, 0x06, 1,,, WoT Client
ControlSend,, {%FirstJoyCameraRotateHoriz% down}, WoT Client
}
if FirstJoyCameraRotateHorizPrev
{
SendMessage, 0x06, 1,,, WoT Client
ControlSend,, {%FirstJoyCameraRotateHorizPrev% up}, WoT Client
}
return

;;;;;;;;;;;;

WatchAxisFirstJoyShoot:
GetKeyState, 1JoyZ, 1JoyZ
FirstJoyShootPrev = %FirstJoyShoot%

if 1JoyZ &lt; 30
    FirstJoyShoot = vk01
else
    FirstJoyShoot =

if FirstJoyShoot = %FirstJoyShootPrev%
    return

SetKeyDelay -1
if FirstJoyShoot
{
SendMessage, 0x201,,,, WoT Client
}
if FirstJoyShootPrev
{
SendMessage, 0x202,,,, WoT Client
}
return

;;;;;;;;;;;;;

WatchFirstJoyPOV:
GetKeyState, 1JoyPOV, 1JoyPOV
FirstJoyPOVPrev = %FirstJoyPOV%

if 1JoyPOV = 0
    FirstJoyPOV = vk52
else if 1JoyPOV = 18000
    FirstJoyPOV = vk46
else if 1JoyPOV = 27000
    FirstJoyPOV = vk58
else if 1JoyPOV = 9000
    FirstJoyPOV = vk43
else FirstJoyPOV = 


if FirstJoyPOV = %FirstJoyPOVPrev%
return

SetKeyDelay -1
if FirstJoyPOV
{
SendMessage, 0x06, 1,,, WoT Client
ControlSend,, {%FirstJoyPOV% down}, WoT Client
}
if FirstJoyPOVPrev
{
SendMessage, 0x06, 1,,, WoT Client
ControlSend,, {%FirstJoyPOVprev% up}, WoT Client
}
return


;;;;;;;;;;;;

1Joy10::
SendMessage, 0x06, 1,,, WoT Client
ControlSend,, {vkA0 Down}, WoT Client
KeyWait, 1Joy10
ControlSend,, {vkA0 Up}, WoT Client
Return

;;;;;;;;;;;;

1Joy9::
SendMessage, 0x06, 1,,, WoT Client
ControlSend,, {vk20 Down}, WoT Client
KeyWait, 1Joy9
ControlSend,, {vk20 Up}, WoT Client
Return

;;;;;;;;;;;;

1Joy1::
SendMessage, 0x06, 1,,, WoT Client
ControlSend,, {vk54 Down}, WoT Client
KeyWait, 1Joy1
ControlSend,, {vk54 Up}, WoT Client
Return

;;;;;;;;;;;;

1Joy3::
SendMessage, 0x06, 1,,, WoT Client
ControlSend,, {vk31 Down}, WoT Client
KeyWait, 1Joy3
ControlSend,, {vk31 Up}, WoT Client
Return

;;;;;;;;;;;;

1Joy4::
SendMessage, 0x06, 1,,, WoT Client
ControlSend,, {vk32 Down}, WoT Client
KeyWait, 1Joy4
ControlSend,, {vk32 Up}, WoT Client
Return

;;;;;;;;;;;;

1Joy2::
SendMessage, 0x06, 1,,, WoT Client
ControlSend,, {vk33 Down}, WoT Client
KeyWait, 1Joy2
ControlSend,, {vk33 Up}, WoT Client
Return

;;;;;;;;;;;;

1Joy6::
SendMessage, 0x204, 1,,, WoT Client
KeyWait, 1Joy6
SendMessage, 0x205, 1,,, WoT Client
Return

;;;;;;;;;;;;

1Joy8::
SendMessage, 0x06, 1,,, WoT Client
ControlSend,, {vk1B Down}, WoT Client
KeyWait, 1Joy8
ControlSend,, {vk1B Up}, WoT Client
Return

;;;;;;;;;;;;

1Joy7::
SendMessage, 0x06, 1,,, WoT Client
ControlSend,, {vk4D Down}, WoT Client
KeyWait, 1Joy7
ControlSend,, {vk4D Up}, WoT Client
Return</code></pre></div><p>Подскажите как добавить &quot;защиту от дурака&quot;? Имеется ввиду следующее - если в активном окне игры двигать стики или нажимать кнопки на геймпаде (т.е. скрипт шлет все что надо), то игра виснет намертво.</p>]]></content>
			<author>
				<name><![CDATA[kharlashkin]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=32183</uri>
			</author>
			<updated>2014-06-15T20:08:28Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=83889#p83889</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Отправка нажатий клавиш в неактивное окно World of Tanks]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=83859#p83859" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p>В неактивном окне вряд ли поможет. Но есть только два варианта: либо реально перемещать курсор (и тут без разницы, какие средства использовать), либо эмулировать его перемещения.</p></blockquote></div><p>В том то и дело, что все что можно нагуглить - это отправка сообщений Control окна, но это мы с Вами уже пробовали. Кстати огромнейшее СПАСИБО Вам!!!</p>]]></content>
			<author>
				<name><![CDATA[kharlashkin]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=32183</uri>
			</author>
			<updated>2014-06-12T19:10:26Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=83859#p83859</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Отправка нажатий клавиш в неактивное окно World of Tanks]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=83858#p83858" />
			<content type="html"><![CDATA[<p>В неактивном окне вряд ли поможет. Но есть только два варианта: либо реально перемещать курсор (и тут без разницы, какие средства использовать), либо эмулировать его перемещения.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2014-06-12T19:00:17Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=83858#p83858</id>
		</entry>
</feed>
