JanqeD1337 Posted May 24, 2020 Share Posted May 24, 2020 Hey everyone, I apologize if in the wrong place. Was a few general options so wasn't exactly positive. If I am Just advise and I can post elsewhere. So I am completely new to Autoit. Been spending lots of the quarantine learning new languages. I'm pretty good with Javascript, C++, C#, Python but never messed with Autoit. Anyway, the thing I'm running into here is the ImageSearch/PixelSearch. Not sure if there is a better way to make these more useful for me. I've attached an image to the post to demonstrate what I'm trying to match up with. I've tried both Pixel and Image to accomplish the goal. Pixel actually doesn't have any issue finding an acceptable color however, I need it to be like a 10px-10px opening for unit placement it's finding small gaps where units can't be placed. So I figure this is where image would come in but the only time I have luck with that is if the image is if I select 1 portion of the pattern in the image but then it's too large and if other units are in the way it will simply state not found. Is there a better way to use pixel or image to find an appropriate area that I want the mouse to drag to? Code is below. Maybe a suggestion on another method of doing this? The light green(image example) is where you can place units. As you can see all the little sprites are characters already placed. My bot already checks if a unit is available (in the bottom) then it scans for a location to put it (and fails) however it does grab the character and drags it but not in a valid location then it returns by pressing the home button. This is a PVE game where you just play vs NPCs characters like a raid.You can place 1 unit with your team every 5 minutes so trying to automate this portion. Below function is only for the locate light green area. func unitFind() ; $result = PixelSearch(430, 369, 1546, 718, 0x136F73, 0) $picture = "C:\Users\Jcape\Documents\RaidBot\img\validBF.png" $result = _ImageSearch_Area($picture, 488, 326, 1544, 759) if Not @error then MouseMove(261, 967, 50) MouseDown("LEFT") Sleep(200) MouseMove($result[1], $result[2], 50) MouseUp("LEFT") EndIf EndFunc Link to comment Share on other sites More sharing options...
JanqeD1337 Posted May 24, 2020 Author Share Posted May 24, 2020 I think I seen a rule saying we can't ask about games so I apologize. My question is for a game based solution but generally I would like the answer of how to best get more accurate selections if there are any tips. If neither is allowed feel free to delete! Thanks! Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 25, 2020 Moderators Share Posted May 25, 2020 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 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 Link to comment Share on other sites More sharing options...
Recommended Posts