Pulover's Macro Creator v5.3.7 - The Complete Automation Tool

Advanced Macro Recorder/Editor.

Moderator: Pulover

TomTomJnr
Posts: 4
Joined: 31 Aug 2020, 18:38

Re: Pulover's Macro Creator v5.2.8 - The Complete Automation Tool

10 Oct 2020, 19:49

Thanks, WinActivate made the difference
bluefire
Posts: 34
Joined: 15 Dec 2018, 11:17
Location: Türkiye

Re: Pulover's Macro Creator v5.2.8 - The Complete Automation Tool

12 Oct 2020, 14:12

Pulover wrote:
10 Oct 2020, 16:06
In 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.
Image search is a really nice function but sometimes it cannot find the searched image.
Do you have a tip for image search?
Information worth everything....
burque505
Posts: 1398
Joined: 22 Jan 2017, 19:37

Re: Pulover's Macro Creator v5.2.8 - The Complete Automation Tool

12 Oct 2020, 14:26

@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
SOTE
Posts: 1129
Joined: 15 Jun 2015, 06:21

Re: Pulover's Macro Creator v5.2.8 - The Complete Automation Tool

13 Oct 2020, 04:39

bluefire wrote:
12 Oct 2020, 14:12
Pulover wrote:
10 Oct 2020, 16:06
In 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.
Image search is a really nice function but sometimes it cannot find the searched image.
Do you have a tip for image search?
Sometimes the issue is how the person is trying to use ImageSearch. Among the more common problems are:

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
tzvi
Posts: 2
Joined: 13 Oct 2020, 21:19

Re: Pulover's Macro Creator v5.2.8 - The Complete Automation Tool

13 Oct 2020, 21:31

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...

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
}
Am I crazy, or just waaay off the mark on how I think the find image function works?

Thanks
User avatar
hasantr
Posts: 678
Joined: 05 Apr 2016, 14:18
Location: İstanbul

Re: Pulover's Macro Creator v5.2.8 - The Complete Automation Tool

14 Oct 2020, 03:34

bluefire wrote:
12 Oct 2020, 14:12
Pulover wrote:
10 Oct 2020, 16:06
In 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.
Image search is a really nice function but sometimes it cannot find the searched image.
Do you have a tip for image search?
Maybe You Can Use Pixel Search. You are more likely to get success the hard way with Multiple Pixel Search.
User avatar
Pulover
Posts: 509
Joined: 29 Sep 2013, 19:51
Location: Brazil
Contact:

Re: Pulover's Macro Creator v5.2.8 - The Complete Automation Tool

14 Oct 2020, 05:42

tzvi wrote:
13 Oct 2020, 21:31
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...
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)
bluefire
Posts: 34
Joined: 15 Dec 2018, 11:17
Location: Türkiye

Re: Pulover's Macro Creator v5.2.8 - The Complete Automation Tool

14 Oct 2020, 13:51

hasantr wrote:
14 Oct 2020, 03:34
bluefire wrote:
12 Oct 2020, 14:12
Pulover wrote:
10 Oct 2020, 16:06
In 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.
Image search is a really nice function but sometimes it cannot find the searched image.
Do you have a tip for image search?
Maybe You Can Use Pixel Search. You are more likely to get success the hard way with Multiple Pixel Search.
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?
Information worth everything....
bluefire
Posts: 34
Joined: 15 Dec 2018, 11:17
Location: Türkiye

Re: Pulover's Macro Creator v5.2.8 - The Complete Automation Tool

14 Oct 2020, 14:31

SOTE wrote:
13 Oct 2020, 04:39
bluefire wrote:
12 Oct 2020, 14:12
Pulover wrote:
10 Oct 2020, 16:06
In 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.
Image search is a really nice function but sometimes it cannot find the searched image.
Do you have a tip for image search?
Sometimes the issue is how the person is trying to use ImageSearch. Among the more common problems are:

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
Can you explain more about variation?
Information worth everything....
bluefire
Posts: 34
Joined: 15 Dec 2018, 11:17
Location: Türkiye

Re: Pulover's Macro Creator v5.2.8 - The Complete Automation Tool

14 Oct 2020, 15:20

How can I make a selection in sub menus of TOOLSTRIP1 control?
Information worth everything....
SOTE
Posts: 1129
Joined: 15 Jun 2015, 06:21

Re: Pulover's Macro Creator v5.2.8 - The Complete Automation Tool

14 Oct 2020, 20:20

bluefire wrote:
14 Oct 2020, 14:31
Can you explain more about variation?
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)
bluefire
Posts: 34
Joined: 15 Dec 2018, 11:17
Location: Türkiye

Re: Pulover's Macro Creator v5.2.8 - The Complete Automation Tool

14 Oct 2020, 20:35

SOTE wrote:
14 Oct 2020, 20:20
bluefire wrote:
14 Oct 2020, 14:31
Can you explain more about variation?
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)
Thank you very much for your answer. It was a very revealing answer.
This was a situation that I had never paid attention to before.
Information worth everything....
User avatar
Pulover
Posts: 509
Joined: 29 Sep 2013, 19:51
Location: Brazil
Contact:

Version Update: 5.2.9

15 Oct 2020, 17:16

Version Update!

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.
Download version 5.2.9
Rodolfo U. Batista
Pulover's Macro Creator - Automation Tool (Recorder & Script Writer)
burque505
Posts: 1398
Joined: 22 Jan 2017, 19:37

Re: Pulover's Macro Creator v5.2.9 - The Complete Automation Tool

15 Oct 2020, 17:52

@Pulover, thank you! I look forward to trying it out.
Regards,
burque505
bluefire
Posts: 34
Joined: 15 Dec 2018, 11:17
Location: Türkiye

Re: Pulover's Macro Creator v5.2.9 - The Complete Automation Tool

16 Oct 2020, 12:21

@Pulover, thank you! Thank you so much for your great work.
Information worth everything....
higrm
Posts: 4
Joined: 28 Aug 2019, 05:00

Re: Version Update: 5.2.9

16 Oct 2020, 16:47

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:

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
Now the working code is:

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
}
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
User avatar
Pulover
Posts: 509
Joined: 29 Sep 2013, 19:51
Location: Brazil
Contact:

Version Update: 5.3.0

17 Oct 2020, 11:18

Version Update!

Version 5.3.0
  • Fixed bug in Compare variables of If Statements window.
Download version 5.3.0
Rodolfo U. Batista
Pulover's Macro Creator - Automation Tool (Recorder & Script Writer)
User avatar
Pulover
Posts: 509
Joined: 29 Sep 2013, 19:51
Location: Brazil
Contact:

Re: Version Update: 5.2.9

17 Oct 2020, 11:23

higrm wrote:
16 Oct 2020, 16:47
With the last update, I have ran into a problem that I have finally been able to resolve.
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. :lol:

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)
bluefire
Posts: 34
Joined: 15 Dec 2018, 11:17
Location: Türkiye

Re: Pulover's Macro Creator v5.3.0 - The Complete Automation Tool

18 Oct 2020, 12:25

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 6 guests