McLukz Posted November 7, 2022 Posted November 7, 2022 (edited) 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 November 7, 2022 by McLukz
Moderators Melba23 Posted November 8, 2022 Moderators Posted November 8, 2022 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 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 columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
ashraful089 Posted November 8, 2022 Posted November 8, 2022 @Melba23 as much i know its an function from image search library
Nine Posted November 8, 2022 Posted November 8, 2022 Can you post a typical example of the image you are searching and a printscreen of the application running. “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
McLukz Posted November 8, 2022 Author Posted November 8, 2022 (edited) 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. expandcollapse popup#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 Edited November 8, 2022 by McLukz
Developers Jos Posted November 8, 2022 Developers Posted November 8, 2022 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.
Recommended Posts