Im a total newbie,im specifically trying to make a macro to cover my needs. But im kinda lost while trying to do it,never done this before. I will be glad if anyone can help me out. This is what i want to do:
When i press specific keyboard button = for example F5 it should start the macro and when it reaches the end waits for me to press it once again.
Macro needs to do this in priority order:
*part1* (priority order)
check if image or pixel color on specific location matches (Less cpu usage is better )
if yes ,press somekey
if not skip to part 2
*part 2*
check if image or pixel color on specific location matches
if yes ,press somekey
if not skip to part 3
*part 3*
check if image or pixel color on specific location matches
if yes ,press somekey
if not skip to part 4
*part 4*
check if image or pixel color on specific location matches
if yes ,press somekey
if not skip to part 5
*part 5*
check if image or pixel color on specific location matches
if yes ,press somekey
if not end the macro and until i press F5 again do not fire it.
Thanks in advance !
Need your knowledge while creating a macro
Moderators: Dorian (MJT support), JRL
I suggest FindImagePos>
Online Help http://www.mjtnet.com/OnlineHelp/index. ... agepos.htm
Online Help http://www.mjtnet.com/OnlineHelp/index. ... agepos.htm
Code: Select all
FindImagePos>C:\part1.bmp,SCREEN,0,1,X,Y,NumFound
If>NumFound>0
//Press Some Key
Endif
FindImagePos>C:\part2.bmp,SCREEN,0,1,X,Y,NumFound
If>NumFound>0
//Press Some Key
Endif
FindImagePos>C:\part3.bmp,SCREEN,0,1,X,Y,NumFound
If>NumFound>0
//Press Some Key
Endif
FindImagePos>C:\part4.bmp,SCREEN,0,1,X,Y,NumFound
If>NumFound>0
//Press Some Key
Endif
FindImagePos>C:\part5.bmp,SCREEN,0,1,X,Y,NumFound
If>NumFound>0
//Press Some Key
Endif
OnEvent is what you're looking for...
OnEvent Online Help http://www.mjtnet.com/OnlineHelp/index.htm?onevent.htm
Virtual Key Codes http://www.mjtnet.com/vkcodes.htm
OnEvent Online Help http://www.mjtnet.com/OnlineHelp/index.htm?onevent.htm
Virtual Key Codes http://www.mjtnet.com/vkcodes.htm
Code: Select all
OnEvent>KEY_DOWN,VK116,0,F5KeyPressed
Label>Loop
Wait>.1
Goto>Loop
SRT>F5KeyPressed
MDL>F5 was pressed
END>F5KeyPressed
So i recently bought MS,im going to figure working with it hopefully. Baby steps for now. Unfortunately,i need this one working as soon as possible:
it looks like this :
Problem atm:
It always fires F11-first image found,does not skip part 2.
it looks like this :
Code: Select all
OnEvent>KEY_DOWN,VK116,0,F5KeyPressed
SetFocus> ProgramX
Label>Loop
FindImagePos>C:\Users\Patish\Desktop\Documents\Macro scheduler\brand.bmp,C:\Users\Patish\Desktop\Documents\Macro scheduler\brand.bmp,1,1,1845,1058,NumFound
If>NumFound>0
//Press F11
Endif
FindImagePos>C:\Users\Patish\Desktop\Documents\Macro scheduler\banner.bmp,C:\Users\Patish\Desktop\Documents\Macro scheduler\banner.bmp,2,1,1896,961,NumFound
If>NumFound>0
//Press F10
Endif
FindImagePos>C:\Users\Patish\Desktop\Documents\Macro scheduler\powerr.bmp,C:\Users\Patish\Desktop\Documents\Macro scheduler\powerr.bmp,1,1,1896,993,NumFound
If>NumFound>0
//Press F9
Endif
FindImagePos>C:\Users\Patish\Desktop\Documents\Macro scheduler\Execute.bmp,C:\Users\Patish\Desktop\Documents\Macro scheduler\Execute.bmp,1,1,1896,1028,NumFound
If>NumFound>0
//Press F8
Endif
FindImagePos>C:\Users\Patish\Desktop\Documents\Macro scheduler\style.bmp,C:\Users\Patish\Desktop\Documents\Macro scheduler\style.bmp,1,1,1896,1059,NumFound
If>NumFound>0
//Press F7
Endif
Wait>.1
Goto>Loop
SRT>F5KeyPressed
END>F5KeyPressed
It always fires F11-first image found,does not skip part 2.