newbie_pete

Image Search (2017

13 posts in this topic


Hi. First I want to say that I am no expert on programming. and i really really want this to work Because
I had a stroke 3½ years ago and got paralyzed on my left side of my body, its much better now but i still
have problems typing on the keyboard with botghs hand. witch is why I want to get it to work.
So i can Automise stuff thats hard for me. In qwould like to have a script That fill in forms that i use
frequently. I really appreciates you ppl that writes these scripts and/or help newbies like my self withj problems.

 

There is a few things that will make the script not to work!

You cant use extend desktop( 2 screens extended),2 screens with duplicate works 

So here's a working example  It scans the entire screen

#include <ImageSearch.au3>

HotKeySet("p", "checkForImage")

global $y = 0, $x = 0

Func checkForImage()
Local $search = _ImageSearch('checkImage.bmp', 0, $x, $y, 0)
If $search = 1 Then
MouseMove($x, $y, 10)
EndIf
EndFunc

while 1
sleep(200)
WEnd

Here is another solution for scanning an area.

#include <ImageSearch.au3>

HotKeySet("p", "checkForImage")

global $y = 0, $x = 0

Func checkForImage()
local $search = _ImageSearchArea('check5.bmp', 1, 800, 40, 900, 80, $x, $y, 0)
If $search = 1 Then
MouseMove($x, $y, 10)
EndIf
EndFunc

while 1
sleep(200)
WEnd

 

 

There are a few common errors i will out the solution here when someone comes up with one.

Here we have one  of the errors, lets call it Error 1

Quote

 Subscript used on non-accessible variable.:
If $result[0] = "0" Then Return 0
If $result^ ERROR

 

Quote

Solution:currently none know solution. If someone posts a solution i'll put it here

 

 

Thats all i had to say. Have a nice day to you all.

 

Share this post


Link to post
Share on other sites



Me myself dont get it to work. Im sittin on a win 7  x64 computer.

This is my script 

#include <ImageSearch.au3>

HotKeySet("c", "close")
HotKeySet("p", "checkForImage")
global $y = 0, $x = 0
Func checkForImage()
   $file =  'fish.png'
    MsgBox(0,"",$file)
local $search = _ImageSearch($file, 1, $x, $y, 0)
If $search = 1 Then
   MsgBox(0, "ppsearch")
    MsgBox(0, $x, $y)
MouseMove($x, $y, 10)
EndIf
MsgBox(0,"searchgg",$search)
EndFunc
Func close()
   Exit
EndFunc

while 1
sleep(200)
WEnd

Nothing happen the script just stops after like 10 sec, I dont know how to debug tbh. 

 

Hope someone can point me in the right direction.

peace out

Share this post


Link to post
Share on other sites

Since you said you want to fill in forms, I will offer that ImageSearch is about the worst way you can go about it. Is this a desktop application with a form in it, or a web form? There are much easier ways to accomplish what you're after if you can give us some more details.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

one od the thing i want to ue it for i thaat, ye. So till i want to make it work.. But ure i take the form olution

Share this post


Link to post
Share on other sites

web forms

Share this post


Link to post
Share on other sites

Ok, again, you're not exactly giving us a lot to go on. How about a screenshot of the web form - no two forms are going to be exactly the same. Help us help you.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

Like I said my main goal is to fix image search and then everything will be good..

Share this post


Link to post
Share on other sites
15 minutes ago, JLogan3o13 said:

Ok, again, you're not exactly giving us a lot to go on. How about a screenshot of the web form - no two forms are going to be exactly the same. Help us help you.

this thread is about image search and how to soulve  errors and stuff.

Share this post


Link to post
Share on other sites

#10 ·  Posted

Jos,

Nice spot.

newbie_pete,

After coming over the innocent in our PM exchange before you posted this thread, you had best come up with a very good explanation to Jos' question.

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

#11 ·  Posted

Very nice catch. newbie_pete, you now have the attention of the entire moderation staff. Make it a good one if you expect to stay on this forum.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

#12 ·  Posted

12 hours ago, Jos said:

Funny as it seems you tried the same previously under another account. Why?

Jos

well yeah, i gfelt a little bit ashamed because of my behavor so i wanted a new start. 

Share this post


Link to post
Share on other sites

#13 ·  Posted

newbie_pete,

So you were "ashamed" of having had 2 threads being locked  - so "ashamed" that you created a new account and promptly posted the same question again?  You should be even more "ashamed" of offering such an appalling excuse for an excuse.

We do not permit multiple accounts, nor questions regarding gamebots - as the Forum rules to which I linked you when your first thread was locked clearly explain. But you seem incapable of reading these rules, or understanding them, or perhaps both. And given your evident distain for actually learning anything about AutoIt for yourself, I see little point in you remaining part of this community.

Both accounts permanently banned.

M23

1 person likes this

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.