<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; анализ и лок на текст !HELP!]]></title>
		<link>http://forum.script-coding.com/viewtopic.php?id=14163</link>
		<atom:link href="http://forum.script-coding.com/extern.php?action=feed&amp;tid=14163&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «анализ и лок на текст !HELP!».]]></description>
		<lastBuildDate>Wed, 12 Sep 2018 06:47:34 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[анализ и лок на текст !HELP!]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=128655#p128655</link>
			<description><![CDATA[<p>Приветствую форумчане и гуру .ahk</p><p>Я не силен в .ahk и крайне слабо представляю как сделать то , что мне нужно средствами imagesearch+loop.<br />Поискав гайды и туториалы на англ\русс - того , что нужно мне - не нашел.</p><br /><p>Пока курил форум , наткнулся на очень крутой скрипт , который анализирует картинку на наличие текста и *понимает* где текст и что это за текст. Но прикрутить его в свой код - не смог. </p><p>Может быть есть возможность&nbsp; посредством скриптов+внешних подключаемых библиотек сделать анализ определенной части экрана на наличие цифры <strong>*50*</strong> ?<br />По цвету не получается ибо в игре HUD идет прозрачный а ХП бар и вовсе прозрачный+переливается всеми возможными модификациями красного в виде волны слево-направо.</p><p>Снизу код , который на данный момент работает , но поиск не по тексту а по пикселям. Белый цвет есть в куче текстур и аим сбивается при первой возможности.</p><div class="codebox"><pre><code>#SingleInstance, Force
#Persistent
#NoEnv
#Warn
SendMode, Input
SetWorkingDir, %A_ScriptDir%
 
 DirX := 0
 DirY := 0


F8::
#Persistent
#KeyHistory, 0
#NoEnv
#HotkeyInterval 99000000
#MaxHotkeysPerInterval 99000000
#InstallKeybdHook
SetKeyDelay, -1, -1
SetControlDelay, -1
SetMouseDelay, -1
SetWinDelay, -1
SendMode, InputThenPlay
SetBatchLines, -1
ListLines, Off
CoordMode, Mouse, client
CoordMode, Mouse, screen
PID := DllCall(&quot;GetCurrentProcessId&quot;)
Process, Priority, %PID%, Normal
EMCol := 0xfbfbfb
ColVn := 0
ZeroX := A_Screenwidth/2
ZeroY := A_Screenheight/2
CFovX := 15
CFovY := 15
inicount := 9
fileread,settings,settings.ini
 
stringsplit,settings,settings,`n
 
if !(fileexist(&quot;settings.ini&quot;)) || (settings0-3 != inicount)
{
    iniread,rx,settings.ini,settings,sen, 4
    iniread,xrange,settings.ini,settings,FovX, 3
    iniread,yrange,settings.ini,settings,FovY, 3
    iniread,xa,settings.ini,settings,AimX, 90
    iniread,xy,settings.ini,settings,AimY, 43
}
 
 
Soundbeep, 750, 500
Loop, 
{
    GetKeyState, Mouse2, LButton, P
    GetKeyState, Mouse3, RButton, P
    if ( Mouse2 == &quot;D&quot; ) || ( Mouse3 == &quot;D&quot; )
    {
        GoSub MouseMoves2
    }
 
    GetKeyState, Key1, F8, P
    if ( Key1 == &quot;D&quot;)
    {
        Soundbeep
        break
    }
}
 
MouseMoves2:
PixelSearch, AimPixelX, AimPixelY, 0 + (A_Screenwidth * (xrange/10)), 0 + (A_Screenheight * (yrange/10)), A_Screenwidth - (A_Screenwidth * (xrange/10)), A_Screenheight - (A_Screenheight * (yrange / 10)),EMCol, ColVn, Fast RGB
if(AimPixelX != &quot;&quot; &amp;&amp; AimPixelY != &quot;&quot;)
{
    GoSub FindOffsetToTarget
    GoSub DoMousemove

}
else
{
PixelSearch, AimPixelX, AimPixelY, 0 + (A_Screenwidth * (xrange/10)), 0 + (A_Screenheight * (yrange/10)), A_Screenwidth - (A_Screenwidth * (xrange/10)), A_Screenheight - (A_Screenheight * (yrange / 10)),EMCol, ColVn, Fast RGB
    if(AimPixelX != &quot;&quot; &amp;&amp; AimPixelY != &quot;&quot;)
    {
        GoSub FindOffsetToTarget
        GoSub DoMousemove

    }
}
Return
 
FindOffsetToTarget:
AimX := AimPixelX - ZeroX +xa
AimY := AimPixelY - ZeroY +xy
if ( AimX+10 &gt; 0)
{
    DirX := rx / 10
}
else if ( AimX+5 &gt; 0)
{
    DirX := rx / 12
}


 
if ( AimX+10 &lt; 0) 
{
    DirX := (-rx) / 10
}
else if ( AimX+5 &lt; 0)
{
    DirX := (-rx) / 12
}

 
if ( AimY+.25 &gt; 0 ) 
{
    DirY := rx /13
}
 
if ( AimY+.25 &lt; 0 ) 
{
    DirY := (-rx) /13
}
AimOffsetX := AimX * DirX
AimOffsetY := AimY * DirY
Return

GetAimMoves1:
DoMousemove:
RootX := Ceil(( AimOffsetX ** ( 1 )))
RootY := Ceil(( AimOffsetY ** ( 1 )))
MoveX := RootX * DirX
MoveY := RootY * DirY
DllCall(&quot;mouse_event&quot;, uint, 0x01, int, MoveX, int, MoveY, uint, 0, int, 0) 

Return</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Vladislav)]]></author>
			<pubDate>Wed, 12 Sep 2018 06:47:34 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=128655#p128655</guid>
		</item>
	</channel>
</rss>
