help in code to fix script with image Topic is solved
-
- Posts: 84
- Joined: 13 Dec 2020, 08:35
Re: help in code to fix script with image
Now you can read the text above, my English is not so good but I edited the text above several times to make it as clear as possible.
Re: help in code to fix script with image
I recommend providing a description of exactly what should occur in each of the four possible results.
"When the colors were found" is also vague. Specify whether all colors must be found, or just one of them.
"When the colors were found" is also vague. Specify whether all colors must be found, or just one of them.
-
- Posts: 84
- Joined: 13 Dec 2020, 08:35
Re: help in code to fix script with image
first search for these colors: [0x8E00BD, 0x8A00B7, 0x8200B0, 0x7D00A9, 0x7A00A3]
at this particular coordinate: 910, 39, 990, 48,
if you don't find these colors:
find this image: Images\utamo.png
if the image is not found, send the "f4" key
however if the image is found send the key "numpadmult"
I think this made the information clearer.
at this particular coordinate: 910, 39, 990, 48,
if you don't find these colors:
find this image: Images\utamo.png
if the image is not found, send the "f4" key
however if the image is found send the key "numpadmult"
I think this made the information clearer.
Re: help in code to fix script with image
Actually, it isn't. You have not addressed either of my suggestions.
-
- Posts: 84
- Joined: 13 Dec 2020, 08:35
Re: help in code to fix script with image
sorry for my ignorance, any of the colors can be found to start performing the actions
I'm using a translator and sometimes it's not clear to me what your words are
I'm using a translator and sometimes it's not clear to me what your words are
Re: help in code to fix script with image
I will ask for a third time: what should the script do if one of the colors is found?
-
- Posts: 84
- Joined: 13 Dec 2020, 08:35
Re: help in code to fix script with image
if one of the colors is found:
it goes to image search Imagens\utamo.png
it goes to image search Imagens\utamo.png
-
- Posts: 84
- Joined: 13 Dec 2020, 08:35
Re: help in code to fix script with image
if the image is not found, send the "f4" key
however if the image is found send the key "numpadmult"
however if the image is found send the key "numpadmult"
Re: help in code to fix script with image
I am not referring to the image. I am asking about the pixel colors. I think you can simplify the response by referring to the four conditions.
1. Pixel found, image found
2. Pixel found, image not found
3. Pixel not found, image found
4. Pixel not found, image not found
If any of these conditions are not relevant, you can note that, too.
1. Pixel found, image found
2. Pixel found, image not found
3. Pixel not found, image found
4. Pixel not found, image not found
If any of these conditions are not relevant, you can note that, too.
-
- Posts: 84
- Joined: 13 Dec 2020, 08:35
Re: help in code to fix script with image
if one of the colors is found I would just like it to follow the script without any action
-
- Posts: 84
- Joined: 13 Dec 2020, 08:35
Re: help in code to fix script with image
the image search would only be done after confirming that one of the colors was found.
-
- Posts: 84
- Joined: 13 Dec 2020, 08:35
Re: help in code to fix script with image
ok, you can check if the pixel is not found a msgbox will appear warning you, but I don't think it's necessary because I've tested all the colors
Re: help in code to fix script with image
I see. So if the color is found, then there is no action, and if the color is found, then the image search should occur.
I think I will have to let others figure this out. I have no understanding. Sorry.
I think I will have to let others figure this out. I have no understanding. Sorry.
-
- Posts: 84
- Joined: 13 Dec 2020, 08:35
Re: help in code to fix script with image
you already helped me with a code yesterday when a color is found it just doesn't happen any action just goes to the next checks
I'll paste the code below for you to remember
I'll paste the code below for you to remember
Code: Select all
Auto_Heal:
PixelSearch,,, 199, 50, 334, 50, 0x707070,, Fast
If !ErrorLevel
Return
PixelGetColor, GreenColor, 320, 50, RGB
If (GreenColor = 0x00C000)
Return
PixelGetColor, LightgreenColor, 310, 50, RGB
PixelGetColor, YellowColor , 270, 50, RGB
PixelGetColor, RedColor , 235, 50, RGB
If (LightgreenColor != 0x60C060 And YellowColor != 0xC0C000 And RedColor != 0xC03030)
ControlSend,, {f5}, Pokemon
Return
-
- Posts: 84
- Joined: 13 Dec 2020, 08:35
Re: help in code to fix script with image Topic is solved
thank you so much for your time and patience to help me i was selecting the color of the full life instead of the gray color of the empty life, now it worked perfectly. I just have to thank you for your cooperation and patience.
@mikeyww @boiler
@mikeyww @boiler
Code: Select all
#Persistent
If !FileExist(image := "Imagens\utamo.png")
MsgBox, 48, Error, File not found.`n`n%image%
Loop {
WinWaitActive, ahk_class Qt5QWindowOwnDCIcon
SetTimer, Check, 400
WinWaitNotActive
SetTimer, Check, Off
SoundBeep, 1000
}
Check:
SoundBeep, 1500
CoordMode, Pixel
For each, color in [0x292929, 0x181919, 0x343434, 0x242424, 0x292929, 0x262626, 0x272727]
PixelSearch, x, y, 910, 39, 990, 48, %color%,, Fast RGB
Until ErrorLevel
If (x = "")
Return
ImageSearch, x, y, 0, 0, A_ScreenWidth, A_ScreenHeight, %image%
Send % ErrorLevel ? "{F4}" : "{NumpadMult}"
Return
Re: help in code to fix script with image
This script looks incorrect to me, but if it works, then that is all that matters.