image search help
-
- Posts: 132
- Joined: 08 Aug 2019, 02:02
image search help
I'm trying to create a script with the image search function and I'm having some problems
I'll put some photos and leave the explanation below
Life Bar Full : https://imgur.com/a/Sk8sk1Q
Life Bar 70% : https://imgur.com/a/dkd6dW7
in the two images below we have one with a full life, and another with a life of 70%
I would like that when life was full, there was no action and that when life gets to be equal to the 70% image, the "R" key should be sent until it is equal to the LifeBar Full image
remembering that the "R" key would activate the function of regaining life in the game!
I'll put some photos and leave the explanation below
Life Bar Full : https://imgur.com/a/Sk8sk1Q
Life Bar 70% : https://imgur.com/a/dkd6dW7
in the two images below we have one with a full life, and another with a life of 70%
I would like that when life was full, there was no action and that when life gets to be equal to the 70% image, the "R" key should be sent until it is equal to the LifeBar Full image
remembering that the "R" key would activate the function of regaining life in the game!
Re: image search help
same thing just real others threads... before you making dupe one
-
- Posts: 132
- Joined: 08 Aug 2019, 02:02
Re: image search help
I made the attempt using this code:
this script has not yet verified the two images implanted, only the Full Life image, and I have a problem when the script checks Full Life
when life is full instead of ignoring and taking no action he fires the "R" key
Code: Select all
loop
{
loop, Files, C:\Users\Micheel\Desktop\Healer\*.*
{
ImageSearch,,, 1185, 20, 1310, 440, *TransBlack *50 %A_LoopFileFullPath% ; modify variation to account for background
if !ErrorLevel ; image is found
{
ImageSearch, x, y, 1190, 125, 1265, 180, *50 C:\Users\Micheel\Desktop\Healer\LifeBar.png ; make sure path and filename are correct
if !ErrorLevel ; bar has fallen below desired level
Send, {r}
Sleep, 250
}
}
}
when life is full instead of ignoring and taking no action he fires the "R" key
Re: image search help
u can do it with 2 timers
and sampling 2 pixels
![Image](https://i.imgur.com/fD291Zp.png)
Code: Select all
SetTimer checkIfHpBelow70
checkIfHpBelow70() {
if !pixelEquals(???, ???, 0xDB4F4F) ; below 70%
{
SetTimer, , Off ; turn this timer off
SetTimer spamKeyUntilHpIs100
}
}
spamKeyUntilHpIs100() {
if !pixelEquals(???, ???, 0xDB4F4F) ; below 100%
Send r
else
{
SetTimer, , Off ; turn this timer off
SetTimer checkIfHpBelow70
}
}
pixelEquals(x, y, rgb) {
PixelGetColor color, x, y, RGB
return color = rgb
}
![Image](https://i.imgur.com/fD291Zp.png)
-
- Posts: 132
- Joined: 08 Aug 2019, 02:02
Re: image search help
@swagfag
only one problem or game has a protection where a black screen is and after 5 minutes open and all as the screen's cores stay at 0x000000 even 0xDB4F4F
i use a script that uses pixel verification and it stopped working. for this reason i am looking to make an image using image search but i am not very familiar with this function
only one problem or game has a protection where a black screen is and after 5 minutes open and all as the screen's cores stay at 0x000000 even 0xDB4F4F
i use a script that uses pixel verification and it stopped working. for this reason i am looking to make an image using image search but i am not very familiar with this function
Re: image search help
if the game implements something to break pixelsearch after 5 minutes, then it would break imagesearch as well
that said, i cant say i believe thats what happens. it sounds like total nonsense, really. theres probably some other errors in ur code causing it to fail(faulty coordmode usage, miscalculated coords, logic/syntax errors etc)
that said, i cant say i believe thats what happens. it sounds like total nonsense, really. theres probably some other errors in ur code causing it to fail(faulty coordmode usage, miscalculated coords, logic/syntax errors etc)
-
- Posts: 132
- Joined: 08 Aug 2019, 02:02
Re: image search help
@swagfag
I understand and generally when a game uses something that prevents it, is there any way to do it?
I've seen a person who managed to create with AHK a tool to do this and more.
would you know which system you may have used? I appreciate your attention and education!
Below is the github link for the program that does it all, but it is paid and I would like to create something for free
https://github.com/Gilbertobal/OldBot
I was unable to analyze the system he used for creation, his system is also functional only in widows 10 if I'm not mistaken
I understand and generally when a game uses something that prevents it, is there any way to do it?
I've seen a person who managed to create with AHK a tool to do this and more.
would you know which system you may have used? I appreciate your attention and education!
Below is the github link for the program that does it all, but it is paid and I would like to create something for free
https://github.com/Gilbertobal/OldBot
I was unable to analyze the system he used for creation, his system is also functional only in widows 10 if I'm not mistaken
Re: image search help
ill level with u. i have 0 clue what ure talking aboutI understand and generally when a game uses something that prevents it, is there any way to do it?
I've seen a person who managed to create with AHK a tool to do this and more.
would you know which system you may have used?
looks like plain ImageSearch/FindText(), which relies on gdip, which itself relies on gdi, which means if what u claim is true(that it works), then PixelSearch/GetColor would also workprogram that does it all