Hi All,
I have no experience in making script and would like your help on it.
I am playing a flash game in a webpage and I want to scan for a image that will pop up any place in the flash game and click that image.
Can someone help on creating such a script?
Can the script be auto running while i am browsing other webpage?
appreciate everyone advice and help.
Thank you.
Best Regards,
Gerub
script for scaning an image
Re: script for scaning an image
Here is a video tut on image search
https://www.youtube.com/watch?v=12aahQCJdUs
https://www.youtube.com/watch?v=12aahQCJdUs
Re: script for scaning an image
I try and write below script but it keep saying image not found...
Can someone help me where is my mistake?
Thank you.
Find_Image:
Stop:=0
while=(Stop=0)
{
ImageSearch,Loc_X, Loc_Y,0,0, A_ScreenWidth, A_ScreenHeight, C:\Users\Peter\Desktop\Tools\Loots1.PNG
if(ErrorLevel=2)
{
msgbox,ErrorLevel = 2`nSomething is wrong
}
else if(ErrorLevel=1)
{
TrayTip,,Image Not Found so funny,2
}
else if(ErrorLevel=0)
{
tx:=Loc_X+(posw//2)
ty:=Loc_Y+(posh//2)
;=MouseMove,Loc_x+(posw//2),Loc_Y+(posh//2)
click,%tx% %ty%
}
}
return
Numpad1::
Stop:=1
return
*ESC::ExitApp
Can someone help me where is my mistake?
Thank you.
Find_Image:
Stop:=0
while=(Stop=0)
{
ImageSearch,Loc_X, Loc_Y,0,0, A_ScreenWidth, A_ScreenHeight, C:\Users\Peter\Desktop\Tools\Loots1.PNG
if(ErrorLevel=2)
{
msgbox,ErrorLevel = 2`nSomething is wrong
}
else if(ErrorLevel=1)
{
TrayTip,,Image Not Found so funny,2
}
else if(ErrorLevel=0)
{
tx:=Loc_X+(posw//2)
ty:=Loc_Y+(posh//2)
;=MouseMove,Loc_x+(posw//2),Loc_Y+(posh//2)
click,%tx% %ty%
}
}
return
Numpad1::
Stop:=1
return
*ESC::ExitApp
Re: script for scaning an image
At a glance it looks fine to me.
Have you tried using different images?
Perhaps a simple coloured shaped on a simple background.
Also, use the code tags, reading code like that is a pain and brings back bad memories of coding in plain notepad.
Have you tried using different images?
Perhaps a simple coloured shaped on a simple background.
Also, use the code tags, reading code like that is a pain and brings back bad memories of coding in plain notepad.
Re: script for scaning an image
understand the effect CoordMode has on the script and choose a mode accordingly.
on a side note if youre using imagesearch for a native fullscreen game it probably wont work, you have to switch to windowed or windowed borderless
on a side note if youre using imagesearch for a native fullscreen game it probably wont work, you have to switch to windowed or windowed borderless
Re: script for scaning an image
I try it but somehow it does not detect that image on the adobe flash player game I am playing. It keep prompting can't find the image.
Anyone can advice why?
Thank you.
Anyone can advice why?
Thank you.
-
- Posts: 216
- Joined: 30 Jun 2016, 06:01
Re: script for scaning an image
I almost always need to add a variation to the image search, so the image can be close, but not exactly identical, because some quality is lost when you take a screenshot.
Try changing this line
To this
If it works, try to lower the number as much as possible. If it doesn't work, try raising it.
Try changing this line
Code: Select all
ImageSearch,Loc_X, Loc_Y,0,0, A_ScreenWidth, A_ScreenHeight, C:\Users\Peter\Desktop\Tools\Loots1.PNG
Code: Select all
ImageSearch,Loc_X, Loc_Y,0,0, A_ScreenWidth, A_ScreenHeight, *25 C:\Users\Peter\Desktop\Tools\Loots1.PNG
Re: script for scaning an image
perhaps, if youre using some tool or the game's built-in function, which hopefully doesn't need to be spelled out, you shouldn't be doing in the first placeneomulemi6 wrote:... some quality is lost when you take a screenshot.
dont use the variation parameter to negate the shortcomings of a shoddily taken needle image.
but sure, provided you coordinates arent messed up, try out playing with the variation. Maybe the haystack image subtly changes hues or smth without u realizing it, but be aware of the fact that by doing so youll be taking a huge dump on imagesearch's performance
without seeing what youre doing, it will be hard for anyone to debug this
Re: script for scaning an image
can I ask is there a way to run the image search on a minimized windows?
Thank for your advice.
Thank for your advice.
Re: script for scaning an image
any advice anyone?
Who is online
Users browsing this forum: dunnerca, garry, Google [Bot], mikeyww, steve88, StupidIdiotMoron and 148 guests