<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; AHK: Разделить задержку в макросе]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=11440</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=11440&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: Разделить задержку в макросе».]]></description>
		<lastBuildDate>Mon, 28 Mar 2016 10:32:26 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: Разделить задержку в макросе]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=102056#p102056</link>
			<description><![CDATA[<p>Я незнаю может это топорно но вот так работает. Получается я отделил &quot;Sleep, 30&quot; от первой задержки путём &quot;If stop&quot;. <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"><p>Если кто знает способ получше подскажите пожалуйста</p></div></div><div class="codebox"><pre><code>#SingleInstance force
#Persistent
#NoEnv
SendMode Input
SetBatchLines, -1
#MaxHotkeysPerInterval
#HotkeyInterval, -1
#InstallKeybdHook
#InstallMouseHook



DllCall(&quot;LoadKeyboardLayout&quot;, &quot;Str&quot;, &quot;00000409&quot;, &quot;Int&quot;, 1)

Gui, Color, 9CEE90

Gui, Font, s11 Bold, Cambria

Gui, Add, Text, x82 y10 w40 h20 cBlue, Y pos

Gui, Add, Edit, x92 y40 w40 h20 cRed  vDllCall3  
 
Gui, Add, Text, x12 y10 w40 h20 cBlue, X pos

Gui, Add, Edit, x22 y40 w40 h20 cRed vDllCall1 

Gui, Add, Text, x162 y10 w40 h20 cBlue, Delay

Gui, Add, Edit, x162 y40 w40 h20 cRed  vDllCall2

Gui, Add, Edit, x95 y125 w40 h20 cRed  vDllCall4, 3 

Gui, Add, Button, x192 y90 w42 h20 gSave, Save

Gui, Add, Button, x20 y90 w42 h20 gOpen, Open

Gui, Add, Button, x108 y90 w42 h20 gOK, OK

Gui, Show, x557 y130 h171 w255, LightGreen = {:-) 
return

*~vk7A:: ; свернуть - для точной настройки макроса
Suspend, On
WinMinimize, Warface
return

~vk79::  ; выход
Suspend, Off
ExitApp
return

~vk78::
Suspend, toggle
return

*~WheelUp:: ;  активация макроса
Suspend, Off
MoveOFF := 1
MoveON := 0
stop := 0
Return

*~vk47:: ; G - бросок гранаты
KeyWait, LButton
Suspend, On
KeyWait, LButton, D
Suspend, Off
return

*~WheelDown::
*~vk51::  ; Q - переключение на пистолет
MoveOFF := 0
MoveON := 1
stop := 1
return
  

*~LButton::
while GetKeyState(&quot;LButton&quot;,&quot;P&quot;)

{
 If MoveOFF

DllCall(&quot;mouse_event&quot;, uint, 1, int, x, int, y, uint, 0, int, 0) ; для основного оружия

 Sleep, Time      ; первая задержка

   Sleep, Timee    ;   первая задержка

if MoveON

DllCall(&quot;mouse_event&quot;, uint, 1, int, 0, int, z, uint, 0, int, 0) ; для второстипенного оружия

If stop

 Sleep, 30   ; вторая задержка
}
Return

 Save: ; сохранение
Gui Submit, NoHide

 FileSelectFile, SelectedFile, S24, , Сохранить макрос, *.ini

  IniWrite, %DllCall3%, %SelectedFile%.ini, xdirectory, dir3 

   IniWrite, %DllCall1%, %SelectedFile%.ini, ydirectory, dir1 

IniWrite, %DllCall2%, %SelectedFile%.ini, sldirectory, dir2 


  FileDelete, .ini

Return

Open: ; загрузить ранее сохранённый макрос

 Gui Submit, NoHide

  FileSelectFile, SelectedFile, 24, , Загрузить макрос, *.ini
  
   IniRead, OutputVar3, %SelectedFile%, xdirectory, dir3, %A_Space%

  IniRead, OutputVar1, %SelectedFile%, ydirectory, dir1, %A_Space%

IniRead, OutputVar2, %SelectedFile%, sldirectory, dir2, %A_Space%


  GuiControl,, DllCall3, % OutputVar3

   GuiControl,, DllCall1, % OutputVar1

  GuiControl,, DllCall2, % OutputVar2

Return

OK:  

 Gui Submit, NoHide

  Timee :=   DllCall2

   Time :=   DllCall2

    y := DllCall3

  x := DllCall1 

z := DllCall4

  Suspend, Off

WinMaximize, Warface

Return
GuiClose:
ExitApp</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Ядрён)]]></author>
			<pubDate>Mon, 28 Mar 2016 10:32:26 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=102056#p102056</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Разделить задержку в макросе]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=102026#p102026</link>
			<description><![CDATA[<p><strong>YMP</strong> Но тогда на второе условие &quot;if MoveON&quot; не срабатывает &quot;while GetKeyState(&quot;vk1&quot;,&quot;P&quot;)&quot;.</p>]]></description>
			<author><![CDATA[null@example.com (Ядрён)]]></author>
			<pubDate>Sun, 27 Mar 2016 14:31:09 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=102026#p102026</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Разделить задержку в макросе]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=101991#p101991</link>
			<description><![CDATA[<p>Не знаю, что значит цепляться. Предположу, что нужно сделать так:<br /></p><div class="codebox"><pre><code>
If MoveOFF
{
DllCall(&quot;mouse_event&quot;, uint, 1, int, x, int, y, uint, 0, int, 0) ; для основного оружия

 Sleep, Time      ; первая задержка

   Sleep, Timee    ;   первая задержка
}
 if MoveON
{
DllCall(&quot;mouse_event&quot;, uint, 1, int, 0, int, z, uint, 0, int, 0) ; для второстипенного оружия

 Sleep, 30   ; вторая задержка
}
</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (YMP)]]></author>
			<pubDate>Fri, 25 Mar 2016 02:05:42 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=101991#p101991</guid>
		</item>
		<item>
			<title><![CDATA[AHK: Разделить задержку в макросе]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=101987#p101987</link>
			<description><![CDATA[<p>Доброго времени суток. Помогите разделить задержку 1 и задержку 2 , по идее они не должны цепляться друг за друга.</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"><p>Если есть какие нибудь советы по оптимизации кода ,подскажите пожалуйста.</p></div></div><div class="codebox"><pre><code>#SingleInstance force
#Persistent
#NoEnv
SendMode Input
SetBatchLines, -1
#MaxHotkeysPerInterval
#HotkeyInterval, -1
#InstallKeybdHook
#InstallMouseHook



DllCall(&quot;LoadKeyboardLayout&quot;, &quot;Str&quot;, &quot;00000409&quot;, &quot;Int&quot;, 1)

Gui, Color, 9CEE90

Gui, Font, s11 Bold, Cambria

Gui, Add, Text, x82 y10 w40 h20 cBlue, Y pos

Gui, Add, Edit, x92 y40 w40 h20 cRed  vDllCall3  
 
Gui, Add, Text, x12 y10 w40 h20 cBlue, X pos

Gui, Add, Edit, x22 y40 w40 h20 cRed vDllCall1 

Gui, Add, Text, x162 y10 w40 h20 cBlue, Delay

Gui, Add, Edit, x162 y40 w40 h20 cRed  vDllCall2

Gui, Add, Edit, x95 y125 w40 h20 cRed  vDllCall4, 3 

Gui, Add, Button, x192 y90 w42 h20 gSave, Save

Gui, Add, Button, x20 y90 w42 h20 gOpen, Open

Gui, Add, Button, x108 y90 w42 h20 gOK, OK

Gui, Show, x557 y130 h171 w255, LightGreen = {:-) 
return

*~vk7A:: ; свернуть - для точной настройки макроса
Suspend, On
WinMinimize, Warface
return

~vk79::  ; выход
Suspend, Off
ExitApp
return

~vk78::
Suspend, toggle
return

*~WheelUp:: ;  активация макроса
Suspend, Off
MoveOFF := 1
MoveON := 0
Return

*~vk47:: ; G - бросок гранаты
KeyWait, LButton
Suspend, On
KeyWait, LButton, D
Suspend, Off
return

*~WheelDown::
*~vk51::  ; Q - переключение на пистолет
MoveOFF := 0
MoveON := 1
return
  

~*$vk1::
while GetKeyState(&quot;vk1&quot;,&quot;P&quot;)

{
 If MoveOFF

DllCall(&quot;mouse_event&quot;, uint, 1, int, x, int, y, uint, 0, int, 0) ; для основного оружия

 Sleep, Time      ; первая задержка

   Sleep, Timee    ;   первая задержка

 if MoveON

DllCall(&quot;mouse_event&quot;, uint, 1, int, 0, int, z, uint, 0, int, 0) ; для второстипенного оружия

 Sleep, 30   ; вторая задержка
}
Return

 Save: ; сохранение
Gui Submit, NoHide

 FileSelectFile, SelectedFile, S24, , Сохранить макрос, *.ini

  IniWrite, %DllCall3%, %SelectedFile%.ini, xdirectory, dir3 

   IniWrite, %DllCall1%, %SelectedFile%.ini, ydirectory, dir1 

IniWrite, %DllCall2%, %SelectedFile%.ini, sldirectory, dir2 


  FileDelete, .ini

Return

Open: ; загрузить ранее сохранённый макрос

 Gui Submit, NoHide

  FileSelectFile, SelectedFile, 24, , Загрузить макрос, *.ini
  
   IniRead, OutputVar3, %SelectedFile%, xdirectory, dir3, %A_Space%

  IniRead, OutputVar1, %SelectedFile%, ydirectory, dir1, %A_Space%

IniRead, OutputVar2, %SelectedFile%, sldirectory, dir2, %A_Space%


  GuiControl,, DllCall3, % OutputVar3

   GuiControl,, DllCall1, % OutputVar1

  GuiControl,, DllCall2, % OutputVar2

Return

OK:  

 Gui Submit, NoHide

  Timee :=   DllCall2

   Time :=   DllCall2

    y := DllCall3

  x := DllCall1 

z := DllCall4

  Suspend, Off

WinMaximize, Warface

Return
GuiClose:
ExitApp</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Ядрён)]]></author>
			<pubDate>Thu, 24 Mar 2016 14:32:36 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=101987#p101987</guid>
		</item>
	</channel>
</rss>
