Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
help needed
#4
The macro can look for pressed pencil button image, and don't run if not found.

Macro Macro1870
Trigger CSp /MSPAINT     Help - how to add the trigger to the macro
Code:
Copy      Help
int w=win
if(!w or !wintest(w "Paint" "MSPaintApp")) ret
if(!scan("macro:mspaint pencil pressed.bmp" child("" "NetUIHWND" w 0x1) 0 16 10)) ret

OnScreenDisplay "macro"

here "mspaint pencil pressed.bmp" is macro where I saved image captured with the 'Find image' dialog:
Code:
Copy      Help
TFpPASYEAAACQk0mBACBADZUAAIoAAAAEs8AAQAYRAIBAADwA5gAKxMAcc7/IBIIAA4AAG3N/23N
/y9AR0BuiGK45bgBPxQAAAIAAGvL/2vL/0x8l2+VukRzmjxykaQCPBQAAAUAAGnK/2nK/2O+8FeL
tY7I/2aWyFqEorACORQAAgAAZ8j/qAAMTpfCfK/dm9H/g7ryUH+rsAI2FAACAABkx/8nCAAMS5XD
b6/agtz/ZdT1NGqMJ1wAMCAAAgAAYsb/JwgAD2HE/FmMuV+w14zr/27Y+TRqjCdoAC0gAAIAAF/F
/yoIAAtew/w7d6Jqt96R7P953HQOKnQAJywAAgAAXsT/LQgAD1y/+UKGsm+946j1/4bg9jRqjC2A
AAVexP8AAF3E/zAIAAtcwvxGjLaCzu6v+P+I4nQOLYwANdwAAANdxP9cwftRm8SH1fO9/v+ksrk8
aDUq6AACAACE0f82CAADgMv5W6fRUAYGRHQxf5WCqq6vJ6QAAgAAiNP/OQgAD4TO+WeFaI+li+rp
6pmZ1VVlt7AFAgAAjNT/PAgAAAiJ0Pq5xMiJitltbt1HS65vnt6M1P8AAJHW/z8IAAmP0vpZbsJP
XLtrkNOwBQIAAJTX/yAGCwB/susnpAAFAACW2P6Y2f8gDwgABQAAg8z3h874IA8KAAAAEQAA

However will not run when the button is hidden.
Other way would be to find accessible object, but it is slow, ~150 ms on my PC. Also, i tested, it does not work if you want to use the code in a filter function. Finding image is ~30 ms, and can make faster if need.


Messages In This Thread

Forum Jump:


Users browsing this thread: 4 Guest(s)