Pulover's Macro Creator v5.4.1 - The Complete Automation Tool
Moderator: Pulover
Re: Pulover's Macro Creator v5.2.8 - The Complete Automation Tool
Thanks, WinActivate made the difference
Re: Pulover's Macro Creator v5.2.8 - The Complete Automation Tool
Image search is a really nice function but sometimes it cannot find the searched image.Pulover wrote: ↑10 Oct 2020, 16:06In fact the problems you've described are not bugs in PMC. ImageSearch, PixelSearch and SoundBeep are ahk commands that it executes using the defined parameters, as you can see in the preview panel and you'd probably face the same problems with an exported script. You might have more luck searching the forum as not detecting image is a commonly asked question. Maybe just using WinActivate before ImageSearch might help.
Do you have a tip for image search?
Information worth everything....
Re: Pulover's Macro Creator v5.2.8 - The Complete Automation Tool
@bluefire, you might try FindClick by @berban as well as FindText by @feiyue , which despite the name searches for images.
Joe Glines did a demo on FindText, see this link. He also lists a new tool there.
Regards,
burque505
Joe Glines did a demo on FindText, see this link. He also lists a new tool there.
Regards,
burque505
Re: Pulover's Macro Creator v5.2.8 - The Complete Automation Tool
Sometimes the issue is how the person is trying to use ImageSearch. Among the more common problems are:bluefire wrote: ↑12 Oct 2020, 14:12Image search is a really nice function but sometimes it cannot find the searched image.Pulover wrote: ↑10 Oct 2020, 16:06In fact the problems you've described are not bugs in PMC. ImageSearch, PixelSearch and SoundBeep are ahk commands that it executes using the defined parameters, as you can see in the preview panel and you'd probably face the same problems with an exported script. You might have more luck searching the forum as not detecting image is a commonly asked question. Maybe just using WinActivate before ImageSearch might help.
Do you have a tip for image search?
1. Not using a wide enough search.
ImageSearch, FoundX, FoundY, 0, 0, A_ScreenWidth, A_ScreenHeight, C:\My Images\test.bmp
2. Not knowing about using *n (variation) option. This way you are not looking for an exact match, but what is relatively similar by color.
ImageSearch, FoundX, FoundY, 0, 0, A_ScreenWidth, A_ScreenHeight, *50 C:\My Images\test.bmp
3. As mentioned, not using WinActivate on the Window you want to conduct an image search on or not using the right CoordMode
https://www.autohotkey.com/docs/commands/WinActivate.htm
https://www.autohotkey.com/docs/commands/CoordMode.htm
If the problem is not specific to Pulover's Macro Creator, but how to use AutoHotkey in general, you might want to ask in the Help Forum.
https://www.autohotkey.com/boards/viewforum.php?f=76
Re: Pulover's Macro Creator v5.2.8 - The Complete Automation Tool
Hi, I'm sorry if I'm in the wrong place, but I don't understand how this is possible.
I have 2 if statements that are exactly the same, except one is "if image found" and one is "if image not found"
if I run both if statements I get the message for both...
Am I crazy, or just waaay off the mark on how I think the find image function works?
Thanks
I have 2 if statements that are exactly the same, except one is "if image found" and one is "if image not found"
if I run both if statements I get the message for both...
Code: Select all
CoordMode, Pixel, Screen
ImageSearch, FoundX, FoundY, 1049, 109, 1501, 150, *2 C:\Users\tzvi\AppData\Roaming\MacroCreator\Screenshots\Screen_20201013213116.png ; Regen
If (ErrorLevel)
{
MsgBox, 0, , regen not found`, click
}
CoordMode, Pixel, Screen
ImageSearch, FoundX, FoundY, 1049, 109, 1501, 150, *2 C:\Users\tzvi\AppData\Roaming\MacroCreator\Screenshots\Screen_20201013213116.png ; Regen
If (ErrorLevel = 0)
{
MsgBox, 0, , regen found
}
Thanks
Re: Pulover's Macro Creator v5.2.8 - The Complete Automation Tool
Maybe You Can Use Pixel Search. You are more likely to get success the hard way with Multiple Pixel Search.bluefire wrote: ↑12 Oct 2020, 14:12Image search is a really nice function but sometimes it cannot find the searched image.Pulover wrote: ↑10 Oct 2020, 16:06In fact the problems you've described are not bugs in PMC. ImageSearch, PixelSearch and SoundBeep are ahk commands that it executes using the defined parameters, as you can see in the preview panel and you'd probably face the same problems with an exported script. You might have more luck searching the forum as not detecting image is a commonly asked question. Maybe just using WinActivate before ImageSearch might help.
Do you have a tip for image search?
Re: Pulover's Macro Creator v5.2.8 - The Complete Automation Tool
ImageSearch works on the active window and it's recommended to use WinActivate before each command. The problem in your code is the message box on the first result that steals focus from the target window, so without any sleep or WinActivate the next search fails.
Rodolfo U. Batista
Pulover's Macro Creator - Automation Tool (Recorder & Script Writer)
Pulover's Macro Creator - Automation Tool (Recorder & Script Writer)
Re: Pulover's Macro Creator v5.2.8 - The Complete Automation Tool
I used the pixel search, but I got the same result as I did in the image search. How to use multiple pixels in PMC?hasantr wrote: ↑14 Oct 2020, 03:34Maybe You Can Use Pixel Search. You are more likely to get success the hard way with Multiple Pixel Search.bluefire wrote: ↑12 Oct 2020, 14:12Image search is a really nice function but sometimes it cannot find the searched image.Pulover wrote: ↑10 Oct 2020, 16:06In fact the problems you've described are not bugs in PMC. ImageSearch, PixelSearch and SoundBeep are ahk commands that it executes using the defined parameters, as you can see in the preview panel and you'd probably face the same problems with an exported script. You might have more luck searching the forum as not detecting image is a commonly asked question. Maybe just using WinActivate before ImageSearch might help.
Do you have a tip for image search?
Information worth everything....
Re: Pulover's Macro Creator v5.2.8 - The Complete Automation Tool
Can you explain more about variation?SOTE wrote: ↑13 Oct 2020, 04:39Sometimes the issue is how the person is trying to use ImageSearch. Among the more common problems are:bluefire wrote: ↑12 Oct 2020, 14:12Image search is a really nice function but sometimes it cannot find the searched image.Pulover wrote: ↑10 Oct 2020, 16:06In fact the problems you've described are not bugs in PMC. ImageSearch, PixelSearch and SoundBeep are ahk commands that it executes using the defined parameters, as you can see in the preview panel and you'd probably face the same problems with an exported script. You might have more luck searching the forum as not detecting image is a commonly asked question. Maybe just using WinActivate before ImageSearch might help.
Do you have a tip for image search?
1. Not using a wide enough search.
ImageSearch, FoundX, FoundY, 0, 0, A_ScreenWidth, A_ScreenHeight, C:\My Images\test.bmp
2. Not knowing about using *n (variation) option. This way you are not looking for an exact match, but what is relatively similar by color.
ImageSearch, FoundX, FoundY, 0, 0, A_ScreenWidth, A_ScreenHeight, *50 C:\My Images\test.bmp
3. As mentioned, not using WinActivate on the Window you want to conduct an image search on or not using the right CoordMode
https://www.autohotkey.com/docs/commands/WinActivate.htm
https://www.autohotkey.com/docs/commands/CoordMode.htm
If the problem is not specific to Pulover's Macro Creator, but how to use AutoHotkey in general, you might want to ask in the Help Forum.
https://www.autohotkey.com/boards/viewforum.php?f=76
Information worth everything....
Re: Pulover's Macro Creator v5.2.8 - The Complete Automation Tool
How can I make a selection in sub menus of TOOLSTRIP1 control?
Information worth everything....
Re: Pulover's Macro Creator v5.2.8 - The Complete Automation Tool
ImageSearch, FoundX, FoundY, 0, 0, A_ScreenWidth, A_ScreenHeight, *50 C:\My Images\test.bmp
*variation (*50 in the above example or *n in the help file), is a number between 0 and 255 that you can pick. 0 is the default, the most strict, and requires an exact match. 255 would be the most promiscuous, where almost anything could match.
There can be slight color differences between the image file (test.bmp in the above example), type of file format (like JPG or PNG), and the image on the screen. To compensate, you loosen up on how strict ImageSearch will be on matching colors. Instead of *2, you might try *20 or *80. Nobody can say what will be the best number. It's something you play with, if an exact match can't be found, and is part of the troubleshooting process. It's common for AHKers (especially new or less experienced) to overlook this or not be aware the option exists.
https://www.autohotkey.com/docs/commands/ImageSearch.htm
(ImageSearch)
Note- PixelSearch has a similar option that's doing the same (*n in ImageSearch), and it's more obviously called Variation. Some AHKers overlook it too (per Help forum), though probably not so much as with ImageSearch as the name (variation) is more obvious and the help file example uses it.
https://www.autohotkey.com/docs/commands/PixelSearch.htm
(PixelSearch)
Re: Pulover's Macro Creator v5.2.8 - The Complete Automation Tool
Thank you very much for your answer. It was a very revealing answer.SOTE wrote: ↑14 Oct 2020, 20:20ImageSearch, FoundX, FoundY, 0, 0, A_ScreenWidth, A_ScreenHeight, *50 C:\My Images\test.bmp
*variation (*50 in the above example or *n in the help file), is a number between 0 and 255 that you can pick. 0 is the default, the most strict, and requires an exact match. 255 would be the most promiscuous, where almost anything could match.
There can be slight color differences between the image file (test.bmp in the above example), type of file format (like JPG or PNG), and the image on the screen. To compensate, you loosen up on how strict ImageSearch will be on matching colors. Instead of *2, you might try *20 or *80. Nobody can say what will be the best number. It's something you play with, if an exact match can't be found, and is part of the troubleshooting process. It's common for AHKers (especially new or less experienced) to overlook this or not be aware the option exists.
https://www.autohotkey.com/docs/commands/ImageSearch.htm
(ImageSearch)
Note- PixelSearch has a similar option that's doing the same (*n in ImageSearch), and it's more obviously called Variation. Some AHKers overlook it too (per Help forum), though probably not so much as with ImageSearch as the name (variation) is more obvious and the help file example uses it.
https://www.autohotkey.com/docs/commands/PixelSearch.htm
(PixelSearch)
This was a situation that I had never paid attention to before.
Information worth everything....
Version Update: 5.2.9
Version Update!
Version 5.2.9Download version 5.2.9
- Updated Compare variables in If Statements window to use expressions with symbols operators only.
- Fixed bugs in duplicate and paste in groups.
- Fixed mixed history when adding slots after using undo.
- Fixed escaped percent signs in strings (`%) being wrongly converted to variables during playback.
Rodolfo U. Batista
Pulover's Macro Creator - Automation Tool (Recorder & Script Writer)
Pulover's Macro Creator - Automation Tool (Recorder & Script Writer)
Re: Pulover's Macro Creator v5.2.9 - The Complete Automation Tool
@Pulover, thank you! I look forward to trying it out.
Regards,
burque505
Regards,
burque505
-
- Posts: 28
- Joined: 13 Jul 2014, 16:33
Re: Pulover's Macro Creator v5.2.9 - The Complete Automation Tool
@Pulover, thanks
Re: Pulover's Macro Creator v5.2.9 - The Complete Automation Tool
@Pulover, thank you! Thank you so much for your great work.
Information worth everything....
Re: Version Update: 5.2.9
I really appreciate your continued support of this great tool, Rudolfo. I use it every day.
With the last update, I have ran into a problem that I have finally been able to resolve.
Specifically the: Updated Compare variables in If Statements window to use expressions with symbols operators only.
I have an input box, where I provide my macro one of three letters. Depending on which letter I enter, the macro will branch to one of 3 different text entry options. This no longer worked. (If I replaced the letters with numbers and then change the If statements to look for those numbers, the code worked.) I had to modify the If statement with the compare variable line so it instead was a String Contains line. But before that I tried with and without quotes. I tried using double equal sign to be case sensitive. But I could not find the right syntax so that the value I stored in my input box was correctly tested. Without any change, it always went to the first branch, even if that entered value should have caused it to go to the second branch. So the If statement resolved to true regardless of what letter I enter.
Here is what the macrocreator had for the ahk code:
Now the working code is:
Is what I did the only way to resolve this issue after the latest update? Or is there something else I should have done instead to be able to use the If statement with the Compare Variable option in PMC?
Thanks for the great tool.
Higrm
With the last update, I have ran into a problem that I have finally been able to resolve.
Specifically the: Updated Compare variables in If Statements window to use expressions with symbols operators only.
I have an input box, where I provide my macro one of three letters. Depending on which letter I enter, the macro will branch to one of 3 different text entry options. This no longer worked. (If I replaced the letters with numbers and then change the If statements to look for those numbers, the code worked.) I had to modify the If statement with the compare variable line so it instead was a String Contains line. But before that I tried with and without quotes. I tried using double equal sign to be case sensitive. But I could not find the right syntax so that the value I stored in my input box was correctly tested. Without any change, it always went to the first branch, even if that entered value should have caused it to go to the second branch. So the If statement resolved to true regardless of what letter I enter.
Here is what the macrocreator had for the ahk code:
Code: Select all
InputBox, GearSelector, Chose your gear, Enter "r" for research Clothes`, "t" for Training Gear`, or "p" for Spying. Case sensitive
Sleep, 185
WinActivate, March of Empires: War of Lords
If (GearSelector = r)
{
Text1 := "research speed"
Xs := [395,395,395,395,395,1026,1026,1026,1026,1026]
Ys := [199,289,389,489,562,199,289,389,489,562]
Goto, StartOfLoop
}
If (GearSelector = t)
{
Xs := [395,395,395,395,395,1026,1026,1026,1026,1]
Ys := [199,289,389,489,562,199,289,389,489,562]
Text1 := "training speed"
Goto, StartOfLoop
}
If (GearSelector = p)
{
Xs := [395,395,395,395,395,1026,1026,1026,1026,1026]
Ys := [199,289,389,489,562,199,289,389,489,562]
Text1 := "spy"
}
Else
{
MsgBox, 0, , % GearSelector, 185
Goto, endScript
Code: Select all
InputBox, GearSelector, Chose your gear, Enter "r" for research Clothes`, "t" for Training Gear`, or "p" for Spying. Case sensitive
Sleep, 185
WinActivate, March of Empires: War of Lords
IfInString, GearSelector, r
{
Text1 := "research speed"
Xs := [395,395,395,395,395,1026,1026,1026,1026,1026]
Ys := [199,289,389,489,562,199,289,389,489,562]
Goto, StartOfLoop
}
IfInString, GearSelector, t
{
Xs := [395,395,395,395,395,1026,1026,1026,1026,1]
Ys := [199,289,389,489,562,199,289,389,489,562]
Text1 := "training speed"
Goto, StartOfLoop
}
IfInString, GearSelector, p
{
Xs := [395,395,395,395,395,1026,1026,1026,1026,1026]
Ys := [199,289,389,489,562,199,289,389,489,562]
Text1 := "spy"
}
Else
{
MsgBox, 0, , % GearSelector, 185
Goto, endScript
}
Thanks for the great tool.
Higrm
Version Update: 5.3.0
Version Update!
Version 5.3.0Download version 5.3.0
- Fixed bug in Compare variables of If Statements window.
Rodolfo U. Batista
Pulover's Macro Creator - Automation Tool (Recorder & Script Writer)
Pulover's Macro Creator - Automation Tool (Recorder & Script Writer)
Re: Version Update: 5.2.9
There was indeed a bug with the last update. I didn't test the change as I should I made a mistake... really should have went to bad before releasing that update late at night.
The bug should be fixed now with v5.3.0 but be aware that this is a breaking change. You should now use expression format in the value field, so you should change your code accordingly, e.g. If (GearSelector = r) should become If (GearSelector = "r") to work. Also don't enclose variables in percent signs here.
Rodolfo U. Batista
Pulover's Macro Creator - Automation Tool (Recorder & Script Writer)
Pulover's Macro Creator - Automation Tool (Recorder & Script Writer)
Re: Pulover's Macro Creator v5.3.0 - The Complete Automation Tool
How can I make a selection in the Windows TOOLSTRIP1 control and its sub-menus?
Information worth everything....
Return to “Pulovers Macro Creator”
Who is online
Users browsing this forum: No registered users and 9 guests