Jump to content

Recommended Posts

Posted


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

Expand  

 

  Quote

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

Expand  

 

 

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

 

Posted

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

  • Moderators
Posted

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!

  • Moderators
Posted

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!

Posted
  On 2/2/2017 at 1:46 PM, 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.

Expand  

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

  • Moderators
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

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:

  Reveal hidden contents

 

  • Moderators
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

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:

  Reveal hidden contents

 

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

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