<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: PixelGetColor]]></title>
	<link rel="self" href="http://forum.script-coding.com/extern.php?action=feed&amp;tid=16836&amp;type=atom" />
	<updated>2021-12-19T14:59:16Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.script-coding.com/viewtopic.php?id=16836</id>
		<entry>
			<title type="html"><![CDATA[AHK: PixelGetColor]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=151303#p151303" />
			<content type="html"><![CDATA[<p>Привет, подскажите как мне использовать функцию if с PixelGetColor.<br />Вот мой примерный код.<br /></p><div class="codebox"><pre><code>
; &lt;COMPILER: v1.1.33.10&gt;
#NoEnv



txtNotFrozen := &quot;(Hold Ctrl or Shift to suspend updates)&quot;
txtFrozen := &quot;(Updates suspended)&quot;




SendMode Input
SetWorkingDir %A_ScriptDir%
SetBatchLines, -1
CoordMode, Pixel, Screen
DetectHiddenWindows, On
SetTitleMatchMode, 2
Gui,1:+AlwaysOnTop

Gui, New, hwndhGui AlwaysOnTop Resize MinSize

Gui, Color, ffff66, 00ffff
Gui, Font, bold,
Gui, Font, ffff66

Gui, Add, Edit, x12 y30 w120 h20 vPressAD gTime_all,
Gui, Add, Edit, x12 y60 w120 h20 vClick1 gTime_all,
Gui, Add, Edit, x12 y90 w120 h20 vbind1 gTime_all,
Gui, Add, Edit, x12 y120 w120 h20 vbind2 gTime_all,
Gui, Add, Edit, x12 y150 w120 h20 vbind3 gTime_all,
Gui, Add, Text, x12 y250 w170 h25 , Press F7 to start
Gui, Add, Text, x12 y265 w170 h25 , Press F10 to pause/resume
Gui, Add, Text, x12 y280 w170 h25 , Press F12 to close
Gui, Add, Edit, x12 y310 w120 h20 vPid gTime_all,
Gui, Add, Text, x142 y313 w100 h25 , Write your PID
Gui, Add, Text, x250 y300 w300 h25 r4 ReadOnly -Wrap vCtrl_Title
Gui, Show, w485 h350, script1


return
GuiClose:
ExitApp

Time_all:
Gui, Submit, NoHide
F7::

game := &quot;ahk_pid &quot; Pid

MouseGetPos, MouseX, MouseY
PixelGetColor, color, %MouseX%, %MouseY%
if (TRX = 0x2B2B2B)
	Loop
	{
	SetKeyDelay, 50, 50
	ControlSend,, {/}, %game%
	sleep 100
	ControlSend,, {Enter}, %game%
	sleep 100
	} 
 



Loop
{
SetKeyDelay, 50, 50
ControlSend,, {%Click1% down}, %game%
sleep 100
ControlSend,, {%Click1% up}, %game%
sleep 100
}
F10::Pause
Suspend
Return
F12::ExitApp
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[baklan18]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=42068</uri>
			</author>
			<updated>2021-12-19T14:59:16Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=151303#p151303</id>
		</entry>
</feed>
