Jump to content
Sign in to follow this  

Is ImageSearch the best option? - (Locked)

Recommended Posts

HI All,

I have been expirimenting with AutoIT PixelSearch and ImageSearch and assigned myself a new project.
I want to record the kills and killstreaks from a game automaticly in a TextFile.
This text file is then publicated with stream software on screen.

This way there is a "live" death/kill counter on the stream.

At the moment I have something like this:

#include <File.au3>
#include <FileConstants.au3>
#include <MsgBoxConstants.au3>

Local $Coords

HotKeySet("{NUMPAD0}", "_start")
HotKeySet("^{NUMPAD0}", "_start")

HotKeySet("{NUMPAD1}", "_stop")
HotKeySet("^{NUMPAD1}", "_stop")

HotKeySet("{NUMPAD2}", "_exit")
HotKeySet("^{NUMPAD2}", "_exit")

$run = True
while 1

Func _stop()
   ; Pause the script
    $run = False

Func _start()
    $run = True
    while $run
    ; Search for a color at a certain location Left, Top, Right, Bot, Color
    $Coords = PixelSearch(100, 200, 780, 313, 0X8BA9C5)
      If @Error Then
      ; The color was not found, what to do
      ; THe color was found, what to do
      ; Open the text File
FileWrite( 'lucio.txt', "*** Lucio Died ***" & @CRLF)


Func _exit()
   ;Close the script
    Exit 1

Which does what it needs to do BUT not in a way that I want. Everytime it sees the color on the top rigth it writes to the file but I need it t be more precise. SInce when the color is on the right but on the left side he didn't die but he killed. (I Added an image to make sense).

So I was thinking of using imagesearch instead of pixelsearch and search for the image left and the image on the right and then write to the file that image1 killed image2.
(IF Image1 and image2 then)

Pixelsearch is to preciese since the feed changes size a lot (depening on how many more images are in the banner).

I am not asking for someone to make this or give an example. I just want to know if ImageSearch is the "best" way to do this so I can start to make a database of the pictures and start writing the code.

If anyone has a better idea please let me know :)



kill feed.png

Edited by Moonlit

Share this post

Link to post
Share on other sites

Welcome to the AutoIt forum.

Unfortunately you appear to have missed the Forum rules on your way in. Please read them now - particularly the bit about not discussing game automation - and then you will understand why you will get no help and this thread will now be locked.

See you soon with a legitimate question I hope.

The Moderation team

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
Live for the present,
Dream of the future,
Learn from the past.

Share this post

Link to post
Share on other sites
This topic is now closed to further replies.
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...