Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > AutoIt
You last visited: Today at 20:19

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



ImageSearch../Return..

Discussion on ImageSearch../Return.. within the AutoIt forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Oct 2009
Posts: 100
Received Thanks: 26
Question ImageSearch../Return..

Hallo Community,
Ich brauch Hilfe bei meinem Script...
Und zwar will ich mit der ImageSearch Funkt. den Bot dazu bringen ein Bild zu suchen und wenn er das gefunden hat soll er ein weiteres suchen und wenn wenn er es nicht findet soll er von vorne anfangen. Leider schaff ich es nicht das er von vorne anfängt wenn er das Bild nicht findet.

So siehts bei mir aus aber funktioniert nicht so wie ichs will..
Code:
#include <ImageSearch.au3>

HotKeySet ( "{F9}" , "Start" )
HotKeySet ( "{F10}" , "Ende" )

$x1=0
$y1=0

Func Start ()
While 1

$result = _ImageSearch("1.bmp",1,$x1,$y1,0)
    if $result=1 Then
	Sleep(10)
Else	
	Return 0
EndIf

$result = _ImageSearch("2.bmp",1,$x1,$y1,0)
    if $result=1 Then
    MouseMove($x1,$y1,3)
	MouseClick("Left")

EndIf
WEnd
EndFunc



Func Ende ()
Exit
EndFunc

While 1
sleep (1)
WEnd
LÖSUNG:
THX an omer36
KiNG'sBACK is offline  
Old 08/09/2010, 15:19   #2
 
HardCore.1337's Avatar
 
elite*gold: 1
Join Date: Feb 2009
Posts: 1,726
Received Thanks: 729
Ich denke Imagesearch benutzt einen Boolean Wert.
HardCore.1337 is offline  
Old 08/09/2010, 16:16   #3
 
PenGuin :O's Avatar
 
elite*gold: 2
Join Date: Mar 2008
Posts: 1,778
Received Thanks: 1,222
Zu Boolean: D.h. die Funktion returned nur True und False, falls er nicht weiß was das ist.
PenGuin :O is offline  
Thanks
1 User
Old 08/09/2010, 16:51   #4
 
omer36's Avatar
 
elite*gold: 0
Join Date: Mar 2009
Posts: 2,317
Received Thanks: 1,255
hab mal bischen rumprobiert, und so klappts:

PHP Code:
#include <ImageSearch.au3>


HotKeySet("{ESC}""_exit")
HotKeySet("{F1}""_start")

$x1=0
$y1
=0


Func _start
()
Sleep(2000)
$result _ImageSearch("bild1.bmp",1,$x1,$y1,0)
if 
$result 1 Then
    MsgBox
("","Info","Bild gefunden!","2")
    
Sleep(200)
    
MouseMove($x1,$y1,25)
Else
    
MsgBox("","info","fehler"2)
_start()
EndIf

Sleep(2000)

$result1 _ImageSearch("bild2.bmp",1,$x1,$y1,0)
    if 
$result1 1 Then
    MsgBox
("","Info","Bild gefunden!","2")
    
Sleep(200)
    
MouseMove($x1,$y1,25)
Else
    
MsgBox("","info","fehler"2)
_start()
EndIf

Sleep(2000)

$result2 _ImageSearch("bild3.bmp",1,$x1,$y1,0)
    if 
$result2 1 Then
    MsgBox
("","Info","Bild gefunden!","2")
    
Sleep(200)
    
MouseMove($x1,$y1,25)
Else
    
MsgBox("","info","fehler"2)
_start()
EndIf
EndFunc

Func _exit
()
    Exit
EndFunc

While 1
Sleep
(100)
WEnd 
kannst die sleep und msgbox weg machen, das war nur zum testen
omer36 is offline  
Thanks
1 User
Reply


Similar Threads Similar Threads
ImageSearch?
01/11/2010 - AutoIt - 4 Replies
Hey, kann einer von euch, einfach für einen Anfänger erklären, wie man mit Autoit die Funktion "ImageSearch" benutzt? Thx für eure Antworten!
Imagesearch - Return
12/31/2009 - AutoIt - 7 Replies
Hey, wollte mal die ImageSearch von AutoIT ausprobieren, aber es gibt bei mir immer folgenden Error: ...\AutoIt3\Include\ImageSearch.au3 (40) : ==> Subscript used with non-Array variable.: if $result="0" then return 0 if $result^ ERROR >Exit code: 1 Time: 18.449 Ehrlich gesagt hab ich schon ein Paar sachen versucht, aber es klappt derzeit nicht.
Autoit ImageSearch
09/20/2009 - AutoIt - 10 Replies
moin Leuts, hab ein problem mit einem Autoit ImageSearch Bot.Unzwar wenn ich den Bot starten erscheint er für ein bruchteil einer sec unten rechts iner taskleiste(da wo die uhr ist) dann schliest er sich wieder. Warum auch immer. Hier mal der Script HOTKEYSET("{F6}", "Start") HotKeySet("{F5}", "Stop") #include <ImageSearch.au3>
Imagesearch Problem
09/18/2009 - GW Bots - 16 Replies
Hi, sorry, dass ich nochmal nerven muss:rolleyes:ich hab mal Imagesearch ausprobiert aber irgendwie klappt das bei mir in Guild Wars nicht...:( Kann mir einer bitte sagen woran das liegt?:confused: #include <ImageSearch.au3> $x1 = 0 $y1 = 0



All times are GMT +1. The time now is 20:20.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.