4

I need to find an image (detect text in game) using transparency (the background is changing every few seconds). My script:

#include <ImageSearch.au3>

HotKeySet("s", "Start")
$x = 0
$y = 0

Func Start()
    $Search = _ImageSearchArea("*Trans0x40FF00 " & "trans_test.png",1,90,90,@DesktopWidth,@DesktopHeight,$x,$y,50)

    If $Search = 1 Then
        MouseMove($x, $y,10)
    EndIf
EndFunc

While 1
    Sleep(100)
WEnd

It doesn't work. My image to search has a bright green colour 0x40FF00 all around, representing transparency. How to make my image match?

user4157124
  • 2,809
  • 13
  • 27
  • 42
Marcin Kostrzewa
  • 565
  • 4
  • 11
  • 24
  • 1
    Can you provide an example of your transparent image and a screenshot of a game situation with the text included you want to search for? – Samoth Feb 25 '13 at 14:03

1 Answers1

0

First of all, if your game runs in DirectX mode or similar (as most fullscreen games do). This won't work at all. (A DirectX hook or something like that would be required and I don't think someone has been going through the troubles of writing the code necessary to do in from AutoIt/AHK.)

Otherwise, in Autohotkey there is the *n option which may do the job for you when adjusted correctly. It's possible this exists in AutoIt too.
(*TransN does exist in AutoHotkey too btw.)

Forivin
  • 14,780
  • 27
  • 106
  • 199