lucas_ Posted February 14, 2022 Posted February 14, 2022 I'm using the following code to try and right click red pixels, but it doesn't seem to work. I think the error may lie in the pixelsearch parameters, but I am unsure. HotKeySet ("{DOWN}", "_start") HotKeySet ("{UP}", "_pause") HotKeySet ("{END}", "_exit") Global $go = 0 Func _start() $go = 1 EndFunc Func _pause() $go = 0 EndFunc Func _exit() Exit EndFunc Func _search() $pos = PixelSearch( 599, 113, 648, 160 , 0xFF0000,10) If IsArray ($pos) Then MouseClick ("right", $pos[0], $pos[1], 1, 1) Else Sleep(10) EndIf EndFunc While 1 If $go = 1 Then _search() Else Sleep(10) EndIf WEnd
Moderators Melba23 Posted February 14, 2022 Moderators Posted February 14, 2022 Moved to the appropriate forum. 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
SOLVE-SMART Posted February 14, 2022 Posted February 14, 2022 Hi @lucas_, 4 hours ago, lucas_ said: I think the error may lie in the pixelsearch parameters, but I am unsure. Which error? Please show us your output/error. Did you already tested with MouseMove() to see where the right click would be? Please check and try the usage of these two options Opt("MouseCoordMode", 1) ; 1=absolute, 0=relative, 2=client Opt("PixelCoordMode", 1) ; 1=absolute, 0=relative, 2=client expandcollapse popup#include-once #include <Array.au3> Opt("MouseCoordMode", 1) ; 1=absolute, 0=relative, 2=client Opt("PixelCoordMode", 1) ; 1=absolute, 0=relative, 2=client HotKeySet ("{DOWN}", "_start") HotKeySet ("{UP}", "_pause") HotKeySet ("{END}", "_exit") Global $go = 0 Func _start() $go = 1 EndFunc Func _pause() $go = 0 EndFunc Func _exit() Exit EndFunc Func _search() $pos = PixelSearch(599, 113, 648, 160, 0xFF0000, 10) _ArrayDisplay($pos) If IsArray($pos) Then MouseMove($pos[0], $pos[1], 30) MouseClick("right", $pos[0], $pos[1], 1, 1) Else Sleep(10) EndIf EndFunc While 1 If $go = 1 Then _search() Else Sleep(10) EndIf WEnd Maybe this already solves your problem? Best regards Sven ________________Stay innovative! ==> AutoIt related: 🔗 Organization AutoIt Community, 🔗 GitHub, 🔗 Discord Server, 🔗 Cheat Sheet, 🔗 autoit-webdriver-boilerplate Spoiler 🌍 Au3Forums 🎲 AutoIt (en) Cheat Sheet 📊 AutoIt limits/defaults 💎 Code Katas: [...] (comming soon) 🎭 Collection of GitHub users with AutoIt projects 🐞 False-Positives 🔮 Me on GitHub 💬 Opinion about new forum sub category 📑 UDF wiki list ✂ VSCode-AutoItSnippets 📑 WebDriver FAQs 👨🏫 WebDriver Tutorial (coming soon)
Nine Posted February 14, 2022 Posted February 14, 2022 It would greatly help us if you could post here a screen shot of the application you want to automate while the red color is showing. “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
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now