<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; [BF 2] Перемещение курсора]]></title>
		<link>http://forum.script-coding.com/viewtopic.php?id=13479</link>
		<atom:link href="http://forum.script-coding.com/extern.php?action=feed&amp;tid=13479&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «[BF 2] Перемещение курсора».]]></description>
		<lastBuildDate>Fri, 16 Mar 2018 17:31:19 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: [BF 2] Перемещение курсора]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=124103#p124103</link>
			<description><![CDATA[<p>Макрос на спот на сколько я понимаю? Делал я такой себе лет 5 назад. На сколько помню основной моей проблемой было то, что почему-то координаты в батле и на рабочем столе не совпадали, я тогда по пкм выводил MsgBox с координатами, чтоб понять на каком значении Y координаты меню привязывается к низу экрана. Возможно твоя проблема именно в этом...<br />П.С: думал вторая батла загнулась вместе с прикрытием логин серверов ЕА (я знаю про revive, но на нем когда я играл не было онлайна).</p>]]></description>
			<author><![CDATA[null@example.com (Tamposhka)]]></author>
			<pubDate>Fri, 16 Mar 2018 17:31:19 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=124103#p124103</guid>
		</item>
		<item>
			<title><![CDATA[Re: [BF 2] Перемещение курсора]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=123789#p123789</link>
			<description><![CDATA[<p>Не знаю, как объяснить словами, но мне нужно типо такого, только низкоуровневое<br /></p><div class="codebox"><pre><code>X=30 Y=30
GetMousePosition Y1
Y2 =  X+1200-Y1
if Y1&gt;1200 then 
  MouseMove X, Y2, 1, R
   else
  MouseMove X, Y, 1, R
</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (JMortimer)]]></author>
			<pubDate>Tue, 20 Feb 2018 04:18:45 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=123789#p123789</guid>
		</item>
		<item>
			<title><![CDATA[Re: [BF 2] Перемещение курсора]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=123785#p123785</link>
			<description><![CDATA[<p>Не работает. Вообще никак.</p>]]></description>
			<author><![CDATA[null@example.com (JMortimer)]]></author>
			<pubDate>Mon, 19 Feb 2018 19:19:51 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=123785#p123785</guid>
		</item>
		<item>
			<title><![CDATA[Re: [BF 2] Перемещение курсора]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=123784#p123784</link>
			<description><![CDATA[<p>Судя по скрину Yp где то 60 пикселей от нижнего края. Вопрос будет ли корректно работать в игре MouseGetPos.<br /></p><div class="codebox"><pre><code>CoordMode Mouse, Screen
MouseGetPos x, y
If (y &gt; A_ScreenHeight - 60)
	LLMouse.Move(0, ScreenHeight-60 - y)</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (stealzy)]]></author>
			<pubDate>Mon, 19 Feb 2018 19:13:43 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=123784#p123784</guid>
		</item>
		<item>
			<title><![CDATA[[BF 2] Перемещение курсора]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=123782#p123782</link>
			<description><![CDATA[<p>Всем здравия. Я уже где-то видел эту тему, но не нашел.<br />Суть такова: при нажатии на горячую клавишу вызывается контекстное меню и выбирается определенный пункт из него. Для этого приходится передвигать курсор, так как ни стрелками, ни колесом мышки эти пункты не выбрать.<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><span class="postimg"><img src="https://i.imgur.com/5VaxKMM.jpg" alt="https://i.imgur.com/5VaxKMM.jpg" /></span></p></div></div><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>; =========== Sample script ============================================================
#SingleInstance,Force

XButton1::
  SendInput {Click, right, down}
  Sleep, 40
  SendInput {Click, right, up}
  LLMouse.Move(30, 30)
  Sleep, 20
  SendInput {Click, down}
  Sleep, 40
  SendInput {Click, up}
  Sleep, 40
  LLMouse.Move(-30, -30)
Return

; =======================================================================================
; LLMouse - A library to send Low Level Mouse input

; Note that many functions have time and rate parameters.
; These all work the same way:
; times	- How many times to send the requested action. Optional, default is 1
; rate	- The rate (in ms) to send the action at. Optional, default rate varies
; Note that if you use a value for rate of less than 10, special code will kick in.
; QPX is used for rates of &lt;10ms as the AHK Sleep command does not support sleeps this short
; More CPU will be used in this mode.
class LLMouse {
	static MOUSEEVENTF_MOVE := 0x1
	static MOUSEEVENTF_WHEEL := 0x800
	
	; ======================= Functions for the user to call ============================
	; Move the mouse
	; All values are Signed Integers (Whole numbers, Positive or Negative)
	; x		- How much to move in the x axis. + is right, - is left
	; y		- How much to move in the y axis. + is down, - is up
	Move(x, y, times := 1, rate := 1){
		this._MouseEvent(times, rate, this.MOUSEEVENTF_MOVE, x, y)
	}
	
	; Move the wheel
	; dir	- Which direction to move the wheel. 1 is up, -1 is down
	Wheel(dir, times := 1, rate := 10){
		static WHEEL_DELTA := 120
		this._MouseEvent(times, rate, this.MOUSEEVENTF_WHEEL, , , dir * WHEEL_DELTA)
	}
	
	; ============ Internal functions not intended to be called by end-users ============
	_MouseEvent(times, rate, dwFlags := 0, dx := 0, dy := 0, dwData := 0){
		Loop % times {
			DllCall(&quot;mouse_event&quot;, uint, dwFlags, int, dx ,int, dy, uint, dwData, int, 0)
			if (A_Index != times){	; Do not delay after last send, or if rate is 0
				if (rate &gt;= 10){
					Sleep % rate
				} else {
					this._Delay(rate * 0.001)
				}
			}
		}
	}
	
	_Delay( D=0.001 ) { ; High Resolution Delay ( High CPU Usage ) by SKAN | CD: 13/Jun/2009
		Static F ; www.autohotkey.com/forum/viewtopic.php?t=52083 | LM: 13/Jun/2009
		Critical
		F ? F : DllCall( &quot;QueryPerformanceFrequency&quot;, Int64P,F )
		DllCall( &quot;QueryPerformanceCounter&quot;, Int64P,pTick ), cTick := pTick
		While( ( (Tick:=(pTick-cTick)/F)) &lt;D ) {
			DllCall( &quot;QueryPerformanceCounter&quot;, Int64P,pTick )
			Sleep -1
		}
		Return Round( Tick,3 )
	}
}</code></pre></div></div></div><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"><p><span class="postimg"><img src="https://i.imgur.com/2BiBMEW.png" alt="https://i.imgur.com/2BiBMEW.png" /></span></p></div></div><p>Я понятия не имею, как вычислить &quot;переломный момент&quot;, потому что рекордер абсолютно игнорирует нажатия клавиш в BF2.<br />И не знаю как сделать ту самую переменную</p>]]></description>
			<author><![CDATA[null@example.com (JMortimer)]]></author>
			<pubDate>Mon, 19 Feb 2018 18:07:04 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=123782#p123782</guid>
		</item>
	</channel>
</rss>
