Jump to content

Image Search (2017


Recommended Posts


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.

 

Link to comment
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

Link to comment
Share on other sites

  • Moderators

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.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

  • Moderators

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.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
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.

Link to comment
Share on other sites

  • Moderators

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

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see 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

 

Link to comment
Share on other sites

  • Moderators

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.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

  • Moderators

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

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see 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

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...