beamtenversteher Posted February 11, 2022 Posted February 11, 2022 Hi, based on last solution here (thx to ad777) i am thingking how i can automate the task. Lets explain u what i am doing with the mentioned double click. i will manually every time click on a row (see attached pic) which has a different color like this grey (should be #21242E RGB(33,36,46)) and the turquoise (should be #4EE6EB RGB (78,230,235)) Both, grey and turquoise should not be considered but all if there will popup other colors then there should be done excatly this double click action ad77 created in advance. And if it comes to all other colors - it can be any color. So rule should be do nothing until any other color will popup. Important is that the area where this rule should wor is a different (smaller area ofc) than in the example before. best would be if i can configure it in the same way like before. Is it possible with this information to automate this process?
junkew Posted February 11, 2022 Posted February 11, 2022 https://www.autoitscript.com/autoit3/docs/functions/PixelChecksum.htm or any other pixel* function FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets
ad777 Posted February 11, 2022 Posted February 11, 2022 @beamtenversteher this how you make sure if color grey (should be #21242E RGB(33,36,46)) and the turquoise (should be #4EE6EB RGB (78,230,235)) : #include <WinAPIGdi.au3> $COLOR = "0x" & Hex(PixelGetColor(MouseGetPos(0), MouseGetPos(1))) $Red = _WinAPI_GetRValue($COLOR) $Green = _WinAPI_GetGValue($COLOR) $Blue = _WinAPI_GetBValue($COLOR) If $Red = 33 And $Green = 36 And $Blue = 46 Or $Red = 78 And $Green = 230 And $Blue = 235 Then ;;;if the color the same then Else ;;;if the color not same then else EndIf none
beamtenversteher Posted February 16, 2022 Author Posted February 16, 2022 TY - how to combine with to the previous condition and automate the task whenever the color is different from these both? expandcollapse popup#include <GUIConstantsEx.au3> #include "MouseOnEvent.au3" #include <Misc.au3> HotKeySet("{ESC}", "_Quit") _BlockDBClick() Func _BlockDBClick() Global $hGUI = GUICreate("") GUISetState(@SW_HIDE, -1) _MouseSetOnEvent($MOUSE_PRIMARYDBLCLK_EVENT) _MouseSetOnEvent($MOUSE_PRIMARYDOWN_EVENT) While 1 $Left = 400 $Top = 140 $Right = 1300 $Bottom = 900 If MouseGetPos(0) > $Left And MouseGetPos(0) < $Right And MouseGetPos(1) > $Top And MouseGetPos(1) < $Bottom Then _MouseSetOnEvent($MOUSE_PRIMARYDOWN_EVENT, "_MouseDBEvent") _MouseSetOnEvent($MOUSE_PRIMARYDOWN_EVENT, "_MouseDBEvent", $hGUI) Else _MouseSetOnEvent($MOUSE_PRIMARYDBLCLK_EVENT) _MouseSetOnEvent($MOUSE_PRIMARYDOWN_EVENT) EndIf Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch ;Sleep(10) WEnd EndFunc ;==>_BlockDBClick Func _MouseDBEvent() Send("u") ;;send Win+r ;;;;do stuff Return $MOE_BLOCKDEFPROC ;Block EndFunc ;==>_MouseDBEvent Func _Quit() Exit EndFunc ;==>_Quit i think the checksum (if any the color changes and then the double click will be done automatically) might be a solution as well. Thx in advance for your support!
ad777 Posted February 16, 2022 Posted February 16, 2022 7 hours ago, beamtenversteher said: TY - how to combine with to the previous condition and automate the task whenever the color is different from these both? expandcollapse popup#include <GUIConstantsEx.au3> #include "MouseOnEvent.au3" #include <Misc.au3> #include <WinAPIGdi.au3> HotKeySet("{ESC}", "_Quit") _BlockDBClick() Func _BlockDBClick() Global $hGUI = GUICreate("") GUISetState(@SW_HIDE, -1) _MouseSetOnEvent($MOUSE_PRIMARYDBLCLK_EVENT) _MouseSetOnEvent($MOUSE_PRIMARYDOWN_EVENT) While 1 $Left = 400 $Top = 140 $Right = 1300 $Bottom = 900 $COLOR = "0x" & Hex(PixelGetColor(MouseGetPos(0), MouseGetPos(1))) $Red = _WinAPI_GetRValue($COLOR) $Green = _WinAPI_GetGValue($COLOR) $Blue = _WinAPI_GetBValue($COLOR) If MouseGetPos(0) > $Left And MouseGetPos(0) < $Right And MouseGetPos(1) > $Top And MouseGetPos(1) < $Bottom Then If $Red = 33 And $Green = 36 And $Blue = 46 Or $Red = 78 And $Green = 230 And $Blue = 235 Then ;;;if the color the same then _MouseSetOnEvent($MOUSE_PRIMARYDBLCLK_EVENT) _MouseSetOnEvent($MOUSE_PRIMARYDOWN_EVENT) Else ;;;if the color not same then else _MouseSetOnEvent($MOUSE_PRIMARYDOWN_EVENT, "_MouseDBEvent") _MouseSetOnEvent($MOUSE_PRIMARYDOWN_EVENT, "_MouseDBEvent", $hGUI) EndIf EndIf Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch ;Sleep(10) WEnd EndFunc ;==>_BlockDBClick Func _MouseDBEvent() Send("u") ;;send Win+r ;;;;do stuff Return $MOE_BLOCKDEFPROC ;Block EndFunc ;==>_MouseDBEvent Func _Quit() Exit EndFunc ;==>_Quit none
beamtenversteher Posted February 16, 2022 Author Posted February 16, 2022 hi, the situation is that typically it looks like in the pic without different color but in the next moment then you have the orange/yellow or other coloered row - and then the mouse double click should be automatically done somewhere where the row is colored in orange/yellow. If i read the code correctly i an not able to click by myself anymore somewhere else if the colore fit to the two mentioned ones......
ad777 Posted February 16, 2022 Posted February 16, 2022 17 minutes ago, beamtenversteher said: the mouse double click should be automatically done somewhere where the row is colored in orange/yellow. just replace:(Remmber to change Value $Red & Green & Blue accordig to Orange/Yellow) If MouseGetPos(0) > $Left And MouseGetPos(0) < $Right And MouseGetPos(1) > $Top And MouseGetPos(1) < $Bottom Then If $Red = 33 And $Green = 36 And $Blue = 46 Or $Red = 78 And $Green = 230 And $Blue = 235 Then ;;;if the color the same then _MouseSetOnEvent($MOUSE_PRIMARYDBLCLK_EVENT) _MouseSetOnEvent($MOUSE_PRIMARYDOWN_EVENT) Else ;;;if the color not same then else _MouseSetOnEvent($MOUSE_PRIMARYDOWN_EVENT, "_MouseDBEvent") _MouseSetOnEvent($MOUSE_PRIMARYDOWN_EVENT, "_MouseDBEvent", $hGUI) EndIf EndIf with: If MouseGetPos(0) > $Left And MouseGetPos(0) < $Right And MouseGetPos(1) > $Top And MouseGetPos(1) < $Bottom Then If $Red = 33 And $Green = 36 And $Blue = 46 Or $Red = 78 And $Green = 230 And $Blue = 235 Then ;;;if the color the same then _MouseSetOnEvent($MOUSE_PRIMARYDOWN_EVENT, "_MouseDBEvent") _MouseSetOnEvent($MOUSE_PRIMARYDOWN_EVENT, "_MouseDBEvent", $hGUI) Else ;;;if the color not same then else _MouseSetOnEvent($MOUSE_PRIMARYDBLCLK_EVENT) _MouseSetOnEvent($MOUSE_PRIMARYDOWN_EVENT) EndIf EndIf none
junkew Posted February 16, 2022 Posted February 16, 2022 search for bitblt in the forum maybe you can use getimage from over here Get the whole area and save as a hexadecimal value to see how it looks Find the different hex values for your color calculate the position where your yellow/orange part is. FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets
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