Jump to content

Help with _WaitForImageSearch - (Locked)


McLukz
 Share

Recommended Posts

Hello guys i.m trying to automate this script i.m trying to do something like this: If img was found then press 4 , but when i try to run the script it's pressing all the time 4 without finding the img. And sorry for my bad english :)

This is my script for this thing, if u have some knowledge why it's doing like this please tell me

            If BitAND(GUICtrlRead($Checkbox_1), $GUI_CHECKED) = $GUI_CHECKED Then
            $result = _WaitForImagesSearch($pictures, $waitTime, 0, $x, $y, 0, 0)
                if $result > 0 Then
                    Send("4")
                EndIf

Edited by McLukz
Link to comment
Share on other sites

  • Moderators

McLukz,

From where do you get this _WaitForImagesSearch function? Is it from a UDF posted on this forum? If so, please provide a link so that potential helpers can see what might be returned from it. If not, then please post the function code (see here how to do it).

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

 i.m using this one from page 4 ,

This is only 2 skills from the game.

And that pictures when the application is running . There is without finding the image pressing all the time the keys.and i select only 2 if i select all of them it's going to send all the keys 1 by 1.

So in this game i have more tabs with skills so i do something like _Waitforimagesearch with an array of pictures. then automatically pressing the button when the program found it.But how u see the program it's sending the keys all the time without founding the img.

And normally when i attack some monsters in the game with one skill he have a cooldown with little bit of dark brightness and the application romally should not find the image and move to the next if (next image) if i.m correct. This is the script from the application.

#include <Color.au3>
#include <ImageSearch2015.au3>
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>
#include <MsgBoxConstants.au3>
#include <GUIConstants.au3>

;//global pictures
Global $pictures[9]
$pictures[0] = 8
$pictures[1] = "skil1.png"
$pictures[2] = "skil2.png"
$pictures[3] = "skil3.png"
$pictures[4] = "skil4.png"
$pictures[5] = "skil5.png"
$pictures[6] = "skil6.png"
$pictures[7] = "skil7.png"
$pictures[8] = "skil8.png"

$Checkbox_1 = GUICtrlCreateCheckbox("Skill 4", 20, 40, 150, 20)
$Checkbox_2 = GUICtrlCreateCheckbox("Skill 5", 20, 60, 150, 20)
$Checkbox_3 = GUICtrlCreateCheckbox("Skill 6", 20, 80, 150, 20)
$Checkbox_4 = GUICtrlCreateCheckbox("Skill 7", 20, 100, 150, 20)
$Checkbox_5 = GUICtrlCreateCheckbox("Skill 8", 20, 120, 150, 20)
$Checkbox_6 = GUICtrlCreateCheckbox("Skill 9", 20, 140, 150, 20)
$Checkbox_7 = GUICtrlCreateCheckbox("Skill 0", 20, 160, 150, 20)
$Checkbox_8 = GUICtrlCreateCheckbox("Skill -", 20, 180, 150, 20)
$Checkbox_9 = GUICtrlCreateCheckbox("Skill +", 20, 200, 150, 20)
GUISetState()
While 1
    Sleep( 10 )
WEnd
Exit
Func _Start ()
    $ClickIt = 1
    While $ClickIt = 1
            If BitAND(GUICtrlRead($Checkbox_1), $GUI_CHECKED) = $GUI_CHECKED Then
            $result = _WaitForImagesSearch($pictures, $waitTime, 0, $x, $y, 0, 0)
                if $result > 0 Then
                    Send("4")
                    Sleep(100)
                Else
                    ToolTip("")
                EndIf

        EndIf
        If BitAND(GUICtrlRead($Checkbox_2), $GUI_CHECKED) = $GUI_CHECKED Then
            $result = _WaitForImagesSearch($pictures, $waitTime, 0, $x, $y, 0, 0)
                if $result > 0 Then
                    Send("5")
                    Sleep(100)
                Else
                    ToolTip("")
                EndIf
        EndIf
        If BitAND(GUICtrlRead($Checkbox_3), $GUI_CHECKED) = $GUI_CHECKED Then
            $result = _WaitForImagesSearch($pictures, $waitTime, 0, $x, $y, 0, 0)
                if $result > 0 Then
                    Send("6")
                    Sleep(100)
                Else
                    ToolTip("")
                EndIf
        EndIf
    WEnd
EndFunc ;==>_Start

skil2.jpg

skilv6.png

problem2.png

Edited by McLukz
Link to comment
Share on other sites

  • Developers

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.
  :)

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...