|
You last visited: Today at 10:10
Advertisement
ImageSearch2015 Problem
Discussion on ImageSearch2015 Problem within the AutoIt forum part of the Coders Den category.
03/12/2016, 20:13
|
#1
|
elite*gold: 0
Join Date: Aug 2008
Posts: 169
Received Thanks: 9
|
ImageSearch2015 Problem
Hello,
I try to script a bot that press buttons if a picture is shown.
The current problem is that the bot do nothing when i start it.
Quote:
#include <ImageSearch2015.au3>
HotKeySet("{+}", "starten")
HotKeySet("{-}", "pause")
HotKeySet("{#}", "quit")
HotKeySet("{.}", "koord")
global $y = 0, $x = 0
ToolTip( "Start: +" &@CRLF& "Pause: -" &@CRLF& "Ende: #" &@CRLF& "Koordinaten anzeigen: .", 0, 0)
While 1
Sleep(100)
WEnd
Func koord()
While 2
Sleep (50)
$arr1 = mousegetpos()
ToolTip( "Start: +" &@CRLF& "Pause: -" &@CRLF& "Ende: #" &@CRLF& "Koordinaten anzeigen: ." &@CRLF& "Koordinaten:" & $arr1[0]&", "&$arr1[1], 0, 0)
WEnd
EndFunc
Func starten()
While 3
local $search = _ImageSearchArea('links.bmp', 1, 568, 86, 588, 108, $x, $y, 0) ; links
If $search = 1 Then
MouseClick( "left", 929, 647,1,10)
Sleep ( 4200)
$search = 0
EndIf
local $search = _ImageSearchArea('rechts.bmp', 1, 568, 86, 588, 108, $x, $y, 0) ; rechts
If $search = 1 Then
MouseClick( "left", 968, 647,1,10)
Sleep ( 4200)
$search = 0
EndIf
local $search = _ImageSearchArea('nach.bmp', 1,568, 86, 588, 108, $x, $y, 0) ; nachgeben
If $search = 1 Then
MouseClick( "left", 1002,647,1,10)
Sleep ( 4200)
$search = 0
EndIf
local $search = _ImageSearchArea('ein.bmp', 1, 568, 86, 588, 108, $x, $y, 0) ; einholen
If $search = 1 Then
MouseClick( "left", 860, 682,1,10)
Sleep ( 4200)
$search = 0
EndIf
local $search = _ImageSearchArea('gein.bmp', 1, 568, 86, 588, 108, $x, $y, 0) ; groß einholen
If $search = 1 Then
MouseClick( "left", 895, 682,1,10)
Sleep ( 4200)
$search = 0
EndIf
WEnd
EndFunc
Func pause()
While True
Sleep(1)
WEnd
Endfunc
Func quit()
Exit
EndFunc
|
If I let the #include <ImageSearch2015.au3> out the debugger says that the function _ImageSearch is unknown, thats normal I know, but at least it says something.
Can anyone help me please?
|
|
|
03/12/2016, 23:16
|
#2
|
elite*gold: 60
Join Date: Aug 2009
Posts: 2,256
Received Thanks: 815
|
You need the ImageSearch2015 UDF for that to work otherwise it won't.
|
|
|
03/12/2016, 23:53
|
#3
|
elite*gold: 0
Join Date: Aug 2008
Posts: 169
Received Thanks: 9
|
I have all stuff from  in the same dir where the script is and copyed the .dll into system32.
Do I have to do anything else?
|
|
|
03/13/2016, 00:03
|
#4
|
elite*gold: 60
Join Date: Aug 2009
Posts: 2,256
Received Thanks: 815
|
Leave the dll in the script folder otherwise you have to Regsvr32 it. You have to use " instead if <> in the include since your include is likely to be in your script dir.
|
|
|
03/13/2016, 10:19
|
#5
|
elite*gold: 0
Join Date: Aug 2008
Posts: 169
Received Thanks: 9
|
I changed it to #include "ImageSearch2015.au3" but same problem
|
|
|
03/13/2016, 11:00
|
#6
|
elite*gold: 60
Join Date: Aug 2009
Posts: 2,256
Received Thanks: 815
|
Where's the error if you leave the include in?
|
|
|
03/13/2016, 14:05
|
#7
|
elite*gold: 0
Join Date: Aug 2008
Posts: 169
Received Thanks: 9
|
There is no error shown, actually is there no difference between "" and <>.
Quote:
>"F:\autoit\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "F:\autoit\AutoIt3\Neuer Ordner\aaaaa.au3"
>Exit code: 0 Time: 0.5067
|
Without doing anything else then pressing F5 to start the script
|
|
|
03/13/2016, 14:45
|
#8
|
elite*gold: 60
Join Date: Aug 2009
Posts: 2,256
Received Thanks: 815
|
That shouldn't be the case since you've build in a While-Loop to not end to the script. Try to run the script without SciTE and look how it behaves.
|
|
|
03/15/2016, 10:03
|
#9
|
elite*gold: 0
Join Date: Aug 2008
Posts: 169
Received Thanks: 9
|
It does nothing. Thats strange
|
|
|
All times are GMT +1. The time now is 10:11.
|
|