Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > AutoIt
You last visited: Today at 08:07

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

Advertisement



Imagesearch problem..

Discussion on Imagesearch problem.. within the AutoIt forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Oct 2009
Posts: 400
Received Thanks: 234
Imagesearch problem..

Quote:
#include<ImageSearch.au3>

HotKeySet("{Numpad2}","starten")
HotKeySet ("{Numpad3}"),"beenden"
$x1=0
$y1=0
$x2=0
$y2=0
$x3=0
$y3=0

While 1
SLeep(1)
WEnd




Func starten ()
While 1
$result2=_ImageSearch("exo.png") ,1,$x2,$y2,0)
If $result2=1 Then
Mouseclick ("Right", $x2,$y2)
sleep(500)
$result3=_ImageSearch("konzi.png") ,1,$x3,$y3,0)
If $result3=1 Then
Mouseclick ("Right" ,$x3,$y3)
$result=_imageSearch("fb.png",1,$x1,$y1,0)
If $result=1 Then
Mouseclick("Right", $x1,$yi
sleep(500)
send ("FB gelesen ")

EndIf
EndIf
WEnd
EndFunc

Func beenden()
exit 0
Endfunc

es funzt nicht.. es kommt


Error:"Wend" statement with no machting "While" statement

Ich hab das Wend und das While im Thread rot angestrichen.. warum funzt es nicht?
jumpstyle31 is offline  
Old 07/15/2010, 22:52   #2
 
omer36's Avatar
 
elite*gold: 0
Join Date: Mar 2009
Posts: 2,317
Received Thanks: 1,255
da waren einige fehler mehr fehler als du dachtest.... ^^
und ich weiss nicht ganz ob das sein muss:
$x1=0
$y1=0
$x2=0
$y2=0
$x3=0
$y3=0
das: $x1=0 und $y1=0 müssten eig. reichen...

teste mal obs klappt..:

PHP Code:
#include<ImageSearch.au3>

HotKeySet("{NUMPAD2}""starten")
HotKeySet ("{NUMPAD3}""beenden")

While 
1
SLeep
(10)
WEnd

$x1
=0
$y1
=0

Func starten 
()
While 
1
$result2
=_ImageSearch("exo.png" ,1,$x1,$y1,0)
If 
$result2=1 Then
Mouseclick 
("Right"$x1,$y1)
sleep(500)
$result3=_ImageSearch("konzi.png" ,1,$x1,$y1,0)
If 
$result3=1 Then
Mouseclick 
("Right" ,$x1,$y1)
$result=_ImageSearch("fb.png",1,$x1,$y1,0)
If 
$result=1 Then
Mouseclick
("Right"$x1,$y1)
sleep(500)
send ("FB gelesen ")
EndIf
EndIf
EndIf
WEnd
EndFunc

Func beenden
()
exit 
0
Endfunc 
btw. das mit dem WEnd fehler kam dadurch, weil du ein EndIf vergessen hattest,,,,
omer36 is offline  
Thanks
1 User
Old 07/16/2010, 02:53   #3
 
PenGuin :O's Avatar
 
elite*gold: 2
Join Date: Mar 2008
Posts: 1,778
Received Thanks: 1,222
@omer:
Nur weil er zu viele Variablen hat, heißt es ja nicht ,dass es Fehler sind.
Es war lediglich ein Fehler drin, den du ja beseitigt hast und zwar hat ein EndIf gefehlt.
PenGuin :O is offline  
Thanks
1 User
Old 07/16/2010, 08:28   #4
 
elite*gold: 0
Join Date: Oct 2009
Posts: 400
Received Thanks: 234
Danke an Omer36 "thanks given"
Danke an Pinguin94 "thanks given"


Frage.. wie kann ich dieses Script also



Quote:

#include<ImageSearch.au3>

HotKeySet("{NUMPAD2}", "starten")
HotKeySet ("{NUMPAD3}", "beenden")

While 1
SLeep(10)
WEnd

$x1=0
$y1=0

Func starten ()
While 1
$result2=_ImageSearch("exo.png" ,1,$x1,$y1,0)
If $result2=1 Then
Mouseclick ("Right", $x1,$y1)
sleep(500)
$result3=_ImageSearch("konzi.png" ,1,$x1,$y1,0)
If $result3=1 Then
Mouseclick ("Right" ,$x1,$y1)
$result=_ImageSearch("fb.png",1,$x1,$y1,0)
If $result=1 Then
Mouseclick("Right", $x1,$y1)
sleep(500)
send ("FB gelesen ")
EndIf
EndIf
EndIf
WEnd
EndFunc

Func beenden()
exit 0
Endfunc
So lange ablaufen lassen bis es kein fb.png mehr findet?

Mfg Jumpstyle31


Edit:

Es geht doch nicht.. Es kommt dieser Fehler..

Langsam check ich's nimmer..

jumpstyle31 is offline  
Old 07/16/2010, 09:24   #5
 
omer36's Avatar
 
elite*gold: 0
Join Date: Mar 2009
Posts: 2,317
Received Thanks: 1,255
Quote:
Originally Posted by pinguin94 View Post
@omer:
Nur weil er zu viele Variablen hat, heißt es ja nicht ,dass es Fehler sind.
Es war lediglich ein Fehler drin, den du ja beseitigt hast und zwar hat ein EndIf gefehlt.
nja schau mal die makierten stellen

Code:
#include<ImageSearch.au3>

HotKeySet("{Numpad2}","starten")
HotKeySet ("{Numpad3}"[COLOR="Red"])[/COLOR],"beenden"[COLOR="Lime"])[/COLOR]
$x1=0
$y1=0
$x2=0
$y2=0
$x3=0
$y3=0

While 1
SLeep(1)
WEnd




Func starten ()
While 1
$result2=_ImageSearch("exo.png"[COLOR="Red"])[/COLOR] ,1,$x2,$y2,0)
If $result2=1 Then
Mouseclick ("Right", $x2,$y2)
sleep(500)
$result3=_ImageSearch("konzi.png"[COLOR="Red"])[/COLOR] ,1,$x3,$y3,0)
If $result3=1 Then
Mouseclick ("Right" ,$x3,$y3)
$result=_imageSearch("fb.png",1,$x1,$y1,0)
If $result=1 Then
Mouseclick("Right", $x1,$y[COLOR="Red"]i[/COLOR][COLOR="Lime"])[/COLOR]
sleep(500)
send ("FB gelesen ")
[COLOR="PaleGreen"]EndIf[/COLOR]
EndIf
EndIf
WEnd
EndFunc

Func beenden()
exit 0
Endfunc
einige mehr oder?

@jumpstyle zu dein prblem schau ich mal später nochmal...

Quote:
Jumpstyle31

Edit:

Es geht doch nicht.. Es kommt dieser Fehler..

Langsam check ich's nimmer..
hmm..also bei mir kommen keine fehlermeldungen...
omer36 is offline  
Old 07/16/2010, 12:02   #6
 
PenGuin :O's Avatar
 
elite*gold: 2
Join Date: Mar 2008
Posts: 1,778
Received Thanks: 1,222
Quote:
Originally Posted by omer36 View Post
nja schau mal die makierten stellen

Code:
#include<ImageSearch.au3>

HotKeySet("{Numpad2}","starten")
HotKeySet ("{Numpad3}"[COLOR="Red"])[/COLOR],"beenden"[COLOR="Lime"])[/COLOR]
$x1=0
$y1=0
$x2=0
$y2=0
$x3=0
$y3=0

While 1
SLeep(1)
WEnd




Func starten ()
While 1
$result2=_ImageSearch("exo.png"[COLOR="Red"])[/COLOR] ,1,$x2,$y2,0)
If $result2=1 Then
Mouseclick ("Right", $x2,$y2)
sleep(500)
$result3=_ImageSearch("konzi.png"[COLOR="Red"])[/COLOR] ,1,$x3,$y3,0)
If $result3=1 Then
Mouseclick ("Right" ,$x3,$y3)
$result=_imageSearch("fb.png",1,$x1,$y1,0)
If $result=1 Then
Mouseclick("Right", $x1,$y[COLOR="Red"]i[/COLOR][COLOR="Lime"])[/COLOR]
sleep(500)
send ("FB gelesen ")
[COLOR="PaleGreen"]EndIf[/COLOR]
EndIf
EndIf
WEnd
EndFunc

Func beenden()
exit 0
Endfunc
einige mehr oder?

@jumpstyle zu dein prblem schau ich mal später nochmal...



hmm..also bei mir kommen keine fehlermeldungen...
Na guck, den Code hab ich mir nicht näher angeschaut, ich dachte tippen und Klammern setzen ist nicht zuviel verlangt ;D
PenGuin :O is offline  
Old 07/16/2010, 12:05   #7
 
bladerofdarknes's Avatar
 
elite*gold: 0
Join Date: Mar 2008
Posts: 1,524
Received Thanks: 285
benutzt doch elseif sieht netter aus O_o

Quote:
Func starten ()
While 1
$result2=_ImageSearch("exo.png") ,1,$x2,$y2,0)
If $result2=1 Then
Mouseclick ("Right", $x2,$y2)
sleep(500)
$result3=_ImageSearch("konzi.png") ,1,$x3,$y3,0)
ElseIf $result3=1 Then
Mouseclick ("Right" ,$x3,$y3)
$result=_imageSearch("fb.png",1,$x1,$y1,0)
ElseIf $result=1 Then
Mouseclick("Right", $x1,$yi)
sleep(500)
send ("FB gelesen ")
EndIf
WEnd
EndFunc

Func beenden()
exit 0
Endfunc
bladerofdarknes is offline  
Reply


Similar Threads Similar Threads
ImageSearch wie benutzen?
04/02/2010 - AutoIt - 21 Replies
Problem: Es findet nix. Toleranz ist schon ziemlich hoch... am Bild kanns also nich liegen... Ach ja, die MsgBox zeigts auch nich an. $x1 = 0 $y1 = 0 Do $result = _ImageSearch("login.bmp",1,ByRef $x1,ByRef $y1,100) Until $result=1 If $result=1 Then WinActivate("S4 Client")
Question on imagesearch
02/17/2010 - Mabinogi - 9 Replies
Is there a way to limit the image search to a small area, such as under the character's feet? And in the event where there are multiple sites that look the same, how do you force it to pick just one and not go berserk clicking around? The beta version of metallurgy bot is not working well for me.
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 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
Autoit Problem: imagesearch in metin2
07/29/2009 - AutoIt - 5 Replies
tach Ich hab ein problem mit der imagesearch funktion(muss man erst icluden) und zwar das Bild was ich suchen möchte( teil vom namen der gemsichi ) findet er auf dem Desktop, er findet es wen ich es mit der Vorschau öffne, wenn ich es mit paint öffne aber nicht im Metin2 fentser. woran kann das liegen?



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


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.