<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Включить выключить фрагменты в цикле посредством Checkbox]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=11574&amp;type=atom" />
	<updated>2016-05-13T22:38:01Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=11574</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Включить выключить фрагменты в цикле посредством Checkbox]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=103761#p103761" />
			<content type="html"><![CDATA[<p>Спасибо огромное всем за помощь, сам разобрался. <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /><br />Вот решение через костыль.<br /></p><div class="codebox"><pre><code>*~WheelUp:: ;  активация макроса
Suspend, Off
MoveOFF := 1
Return

*~WheelDown::
MoveOFF := 0
   n := 0
o := 0
return

*~vk51::  ; Q 
MoveOFF := 0
return

vk76::  ; F7 пока сделал на кнопку
Suspend, Off
If keystroke = 
  {
    keystroke = 1 
     np := 0x08 
op := 0x010
SoundBeep, 1000
  }
Else if keystroke = 1 
  {
    keystroke =
    np := 0
op := 0
SoundBeep, 1000
  }
return

return

vk75::  ; F6 пока сделал на кнопку
Suspend, Off
If keystroke = 
  {
    keystroke = 1 
     n := 0x02
o := 0x04
SoundBeep, 1000
  }
Else if keystroke = 1 
  {
    keystroke =
    n := 0
o := 0
SoundBeep, 1000
  }
return
  
; 0x02 нажать лкм
; 0x04 отпустить лкм
;0x08 нажать пкм
;0x010 отпустить пкм

*~$LButton::

      DllCall(&quot;mouse_event&quot;, UInt, np, Int, 0, Int, 0, UInt, 0, Int, 0) ; нажать правую кнопку мыши
    sleep, 40  
  DllCall(&quot;mouse_event&quot;, UInt, op, Int, 0, Int, 0, UInt, 0, Int, 0) ; отпустить правую кнопку мыши
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) ; для основного оружия движение мыши
DllCall(&quot;mouse_event&quot;, UInt, n, Int, 0, Int, 0, UInt, 0, Int, 0) ; нажать левую кнопку мыши
    Sleep, Time      ; первая задержка
DllCall(&quot;mouse_event&quot;, UInt, o, Int, 0, Int, 0, UInt, 0, Int, 0)  ; отпустить левую кнопку мыши
  Sleep, Timee    ;   первая задержка
}
DllCall(&quot;mouse_event&quot;, UInt, np, Int, 0, Int, 0, UInt, 0, Int, 0) ; нажать правую кнопку мыши
   sleep, 40  
 DllCall(&quot;mouse_event&quot;, UInt, op, Int, 0, Int, 0, UInt, 0, Int, 0) ; отпустить правую кнопку мыши
return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Ядрён]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=30092</uri>
			</author>
			<updated>2016-05-13T22:38:01Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=103761#p103761</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Включить выключить фрагменты в цикле посредством Checkbox]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=103713#p103713" />
			<content type="html"><![CDATA[<p>Вот два скрипта слепил (криво конечно но работает) , но вот третий никак. Как раз третий скрипт должен активироваться от &quot;LButton&quot; но не должен находиться в одном цикле с теми двумя.</p><div class="codebox"><pre><code>
*~WheelUp:: ;  активация макроса
Suspend, Off
MoveOFF := 1
MoveON := 0

*~WheelDown::
MoveOFF := 0
MoveON := 0
   n := 0
o := 0
return

*~vk51::  ; Q 
MoveOFF := 0
MoveON := 1
return

vk75::  ; F6, пока сделал на кнопку
If keystroke = 
  {
    keystroke = 1 
     n := 0x02
o := 0x04
SoundBeep, 1000
  }
Else if keystroke = 1 
  {
    keystroke =
    n := 0
o := 0
SoundBeep, 1000
  }
return

; 0x02 нажать лкм
; 0x04 отпустить лкм

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

DllCall(&quot;mouse_event&quot;, uint, 1, int, 2, int, 3, uint, 0, int, 0) ;  движение мыши

   DllCall(&quot;mouse_event&quot;, UInt, n, Int, 0, Int, 0, UInt, 0, Int, 0) ; нажать левую кнопку мыши

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

   DllCall(&quot;mouse_event&quot;, UInt, o, Int, 0, Int, 0, UInt, 0, Int, 0)  ; отпустить левую кнопку мыши

Sleep, 20    ;   первая задержка
 
  if MoveON
 
DllCall(&quot;mouse_event&quot;, uint, 1, int, 0, int, 2, uint, 0, int, 0) ; движение мыши

   Sleep, 40   ; вторая задержка
}
Return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Ядрён]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=30092</uri>
			</author>
			<updated>2016-05-12T23:04:57Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=103713#p103713</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Включить выключить фрагменты в цикле посредством Checkbox]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=103601#p103601" />
			<content type="html"><![CDATA[<p>Доброго времени суток. Подскажите пожалуйста как объединить эти 3 скрипта в одном цикле , что бы они нормально работали со всеми задержками <strong>&quot;Sleep&quot;</strong> , и каждый из них можно было (вкл|выкл) посредством Checkbox. Если использовать <strong>выражение&nbsp; &quot;If&quot;</strong> то все задержки <strong>&quot;Sleep&quot;</strong> плюсуются друг к другу а это критично в этом коде. </p><p>1- Двигает курсор мыши<br /></p><div class="codebox"><pre><code>*~WheelUp:: ;  активация макроса
Suspend, Off
MoveOFF := 1
MoveON := 0
Return 

*~WheelDown::
MoveOFF := 0
MoveON := 0
return

*~vk51::  
MoveOFF := 0
MoveON := 1
return

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

DllCall(&quot;mouse_event&quot;, uint, 1, int, 2, int, 3, uint, 0, int, 0) ; Двигает курсор мыши
  Sleep, 25      ; первая задержка
    Sleep, 20    ;   первая задержка
  
if MoveON
 
DllCall(&quot;mouse_event&quot;, uint, 1, int, 0, int, 2, uint, 0, int, 0) ; Двигает курсор мыши
    Sleep, 40   ; вторая задержка
}
Return</code></pre></div><p>2- кликер<br /></p><div class="codebox"><pre><code>*~$vk1::
  while GetKeyState(&quot;vk1&quot;,&quot;P&quot;)
{
DllCall(&quot;mouse_event&quot;, UInt, 0x02, Int, 0, Int, 0, UInt, 0, Int, 0) ; нажать левую кнопку мыши

  Sleep, 23
DllCall(&quot;mouse_event&quot;, UInt, 0x04, Int, 0, Int, 0, UInt, 0, Int, 0) ; отпустить левую кнопку мыши

  Sleep, 26
}
Return</code></pre></div><p>3- Нажимает отпускает правую кнопку мыши<br /></p><div class="codebox"><pre><code>*~$vk1::
 GetKeyState(&quot;vk1&quot;,&quot;P&quot;)

DllCall(&quot;mouse_event&quot;, UInt, 0x08, Int, 0, Int, 0, UInt, 0, Int, 0) ; нажать правую кнопку мыши
    sleep, 40
 
DllCall(&quot;mouse_event&quot;, UInt, 0x010, Int, 0, Int, 0, UInt, 0, Int, 0) ; отпустить правую кнопку мыши
sleep, 4

  KeyWait, vk1
sleep, 4

DllCall(&quot;mouse_event&quot;, UInt, 0x08, Int, 0, Int, 0, UInt, 0, Int, 0) ; нажать правую кнопку мыши
      sleep, 40
  
DllCall(&quot;mouse_event&quot;, UInt, 0x010, Int, 0, Int, 0, UInt, 0, Int, 0) ; отпустить правую кнопку мыши
Return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Ядрён]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=30092</uri>
			</author>
			<updated>2016-05-09T20:32:24Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=103601#p103601</id>
		</entry>
</feed>
