<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; AutoIT: (Игра) Kena: Bridge of Spirits: Прыжок + "Лук" (Jump + "Bow")]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=17616</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=17616&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AutoIT: (Игра) Kena: Bridge of Spirits: Прыжок + "Лук" (Jump + "Bow")».]]></description>
		<lastBuildDate>Thu, 23 Feb 2023 15:35:25 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[AutoIT: (Игра) Kena: Bridge of Spirits: Прыжок + "Лук" (Jump + "Bow")]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=156904#p156904</link>
			<description><![CDATA[<p>1. Вешает на клавишу &quot;v&quot; двойной прыжок с замедлением и натягиванием тетивы &quot;лука&quot; (т.е. посоха).<br />2. Отключается при переключении из окна игры.</p><p>Лично для меня решил проблему с тем, что в боях с боссами любой сбой тетивы мог привести к непопаданию в тайминг или лишней тычке.<br />- Почти перестал психовать когда играл от &quot;лука&quot;.<br />- Перестал беспокоиться что раскрошу любимую клавиатуру.</p><div class="codebox"><pre><code>; Тема на форуме https://forum.script-coding.com/viewtopic.php?id=17616
; Обсуждение https://forum.script-coding.com/viewtopic.php?id=17621

#include &lt;Constants.au3&gt;
#include &lt;GuiConstantsEx.au3&gt;
#include &lt;WindowsConstants.au3&gt;
#include &lt;Misc.au3&gt;

#NoTrayIcon

Opt(&quot;TrayOnEventMode&quot;, 1)
Opt(&quot;TrayMenuMode&quot;, 1) ; Default tray menu items (Script Paused/Exit) will not be shown.

TrayCreateItem(&quot;&quot;)
Local $ExitMenuItem = TrayCreateItem(&quot;Exit&quot;)
TrayItemSetOnEvent($ExitMenuItem, &quot;ExitHandler&quot;)
TraySetState(1) ; Shows the tray icon
TraySetClick(16) ; Only secondary mouse button will show the tray menu.

Local $hDLL = DllOpen(&quot;user32.dll&quot;)
Local $v_is_pressed = 0
Local $hotkeys_mode_saved = 0
Local $hotkeys_mode_needed = 0

;======== Тело скрипта (выполняется постоянно) ========
While 1
	; Каждые 0.4 секунды определяет активно-ли окно &quot;Kena: Bridge of Spirits&quot;.
	Sleep(400)
	If WinActive(&quot;Kena: Bridge of Spirits&quot;) Then
		$hotkeys_mode_needed = 1
	Else
		$hotkeys_mode_needed = 2
	EndIf	
	If $hotkeys_mode_needed &lt;&gt; $hotkeys_mode_saved Then
		$hotkeys_mode_saved = $hotkeys_mode_needed
		; Если фокус переключился на окно Ken&#039;ы - переназначает клавишу &quot;v&quot; на двойной прыжок.
		If $hotkeys_mode_needed = 1 Then
			HotKeySet(&quot;{v}&quot;, &quot;Jump&quot;)
			HotKeySet(&quot;+{V}&quot;, &quot;Nothing&quot;)
		; Если фокус переключился на другое окно - возвращает стандартную работу клавиши &quot;v&quot; и отжимает Shift.
		Else
			HotKeySet(&quot;{v}&quot;)
			HotKeySet(&quot;+{V}&quot;)
			; A0 - left SHIFT, A1 - right SHIFT.
			If $v_is_pressed or _IsPressed(&quot;A0&quot;, $hDLL) or _IsPressed(&quot;A1&quot;, $hDLL) Then
				Send(&quot;{SHIFTUP}&quot;)
			EndIf
			$v_is_pressed = 0
		EndIf	
	EndIf
WEnd

;======== Обработчик нажатия клавиши &quot;v&quot; в игре ========
Func Jump()
	; Если клавиша &quot;v&quot; уже нажата - выход для предтворащения двойного срабатывания скрипта.
	if $v_is_pressed Then
		Return
	EndIf
	$v_is_pressed = 1
	; Двойное нажатие на пробел, затем зажатие Shift и левой кнопки мыши (прицеливание).
	Send(&quot;{SPACE down}&quot;)
	Sleep(10)
	Send(&quot;{SPACE up}&quot;)
	Sleep(200)
	Send(&quot;{SPACE down}&quot;)
	Sleep(300)
	Send(&quot;{SHIFTDOWN}&quot;)
	Sleep(100)
	MouseDown($MOUSE_CLICK_LEFT)
	; Ожидание отжатия клавиши &quot;v&quot;.
	While 1
		; Код 56 соответствует нажатой клавише &quot;v&quot;.
		If _IsPressed(&quot;56&quot;, $hDLL) Then
			Sleep(30)
		Else
			ExitLoop
		EndIf
	Wend
	; Отпускание левой клавиши мыши.
	; Код 01 соответствует нажатой левой клавиши мыши.
	If _IsPressed(&quot;01&quot;, $hDLL) Then
		MouseUp($MOUSE_CLICK_LEFT)
		Sleep(20)
	EndIf
	; Отпускание Shift и пробела.
	Send(&quot;{SHIFTUP}&quot;)
	Send(&quot;{SPACE up}&quot;)
	$v_is_pressed = 0
EndFunc

;======== Обработчик нажатия клавиши &quot;shift+v&quot; в игре ========
Func Nothing()
	
EndFunc

Func ExitHandler()
	Exit(0)
EndFunc
</code></pre></div><p><strong>Обсуждение</strong>: <a href="https://forum.script-coding.com/viewtopic.php?id=17621">Здесь</a></p>]]></description>
			<author><![CDATA[null@example.com (Kiber)]]></author>
			<pubDate>Thu, 23 Feb 2023 15:35:25 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=156904#p156904</guid>
		</item>
	</channel>
</rss>
