|
You last visited: Today at 19:12
Advertisement
Problem bei Pixel search
Discussion on Problem bei Pixel search within the AutoIt forum part of the Coders Den category.
12/06/2010, 21:00
|
#1
|
elite*gold: 0
Join Date: Jan 2009
Posts: 229
Received Thanks: 60
|
Problem bei Pixel search
Heey,
habe noch nie etwas mit AutoIt geschreiben...
Hier mein script:
Quote:
HotKeySet("{F1}","Start")
HotKeySet("{F2}","Pause")
HotKeySet("{F3}","Ende")
Global $funcs = false
Func Start()
$funcs = True
EndFunc
Func Pause()
$funcs = False
while $funcs = False
sleeP(500)
WEnd
EndFunc
Func Ende()
Exit
EndFunc
MouseClick("left" , 736, 699, 1)
$B = PixelSearch(650, 530, 1200, 800, 0x511B0F)
If IsArray($B) = True Then
MouseMove($B[0], $B[1], 1)
MouseClick("left")
EndIf
Sleep(400)
MouseClick("left", 786, 680, 1)
$B = PixelSearch(650, 530, 1200, 800, 0x511B0F)
If IsArray($B) = True Then
MouseMove($B[0], $B[1], 1)
MouseClick("left")
EndIf
Sleep(400)
|
Ich wollte eigentlich nur dass mein Mauszeiger auf 736, 699 klickt, dann die Pixel in dem Bereich sucht und drauf klickt. Daraufhin wieder woanders hin klickt und wieder die Pixel den dem Bereich sucht und wieder drauf klickt.
|
|
|
12/06/2010, 21:02
|
#2
|
elite*gold: 0
Join Date: Jan 2010
Posts: 108
Received Thanks: 3
|
PHP Code:
HotKeySet("{F1}","Start") HotKeySet("{F2}","Pause") HotKeySet("{F3}","Ende")
Global $funcs = false
Func Start() $funcs = True EndFunc
Func Pause() $funcs = False while $funcs = False sleeP(500) WEnd EndFunc
Func Ende() Exit EndFunc
MouseClick("left" , 736, 699, 1) $B = PixelSearch(650, 530, 1200, 800, 0x511B0F) If IsArray($B) = True Then MouseMove($B[0], $B[1], 1) MouseClick("left") EndIf Sleep(400) MouseClick("left", 786, 680, 1) $B = PixelSearch(650, 530, 1200, 800, 0x511B0F) If IsArray($B) = True Then MouseMove($B[0], $B[1], 1) MouseClick("left") EndIf Sleep(400)
bitte in php code machen dan sieht es besser aus
Fehler habe ich leider noch nicht gefunden suche weiter <3
€: muss das "Mouseclick...." nicht mit in die Start func .?
|
|
|
12/06/2010, 21:08
|
#3
|
elite*gold: 0
Join Date: Jan 2009
Posts: 229
Received Thanks: 60
|
oke sieht jetzt so aus ( hab die koords umgeändert)
HotKeySet("{F1}","Start")
HotKeySet("{F2}","Pause")
HotKeySet("{F3}","Ende")
Global $funcs = false
Func Start()
$funcs = True
EndFunc
Func Pause()
$funcs = False
while $funcs = False
sleeP(500)
WEnd
EndFunc
Func Ende()
Exit
EndFunc
while 1
MouseClick("left" , 745, 690, 1)
$B = PixelSearch(650, 530, 1200, 800, 0x511B0F)
If IsArray($B) = True Then
MouseMove($B[0], $B[1], 1)
MouseClick("left")
EndIf
Sleep(400)
MouseClick("left" , 1167, 711, 1)
$B = PixelSearch(650, 530, 1200, 800, 0x511B0F)
If IsArray($B) = True Then
MouseMove($B[0], $B[1], 1)
MouseClick("left")
EndIf
Sleep(400)
WEnd
Aber der macht da irgendwas komisches...
habe glaub ich die pixel falsch definiert bzw. gibt es das pixel öfters als nur da wo ich es will
Kann man mehrere Pixel oder sogar nach einem Bild suchen?
|
|
|
12/06/2010, 22:09
|
#4
|
elite*gold: 1
Join Date: Dec 2006
Posts: 360
Received Thanks: 135
|
Quote:
Originally Posted by AzIo
Kann man mehrere Pixel oder sogar nach einem Bild suchen?
|
Ja man kan direkt nach Bildern suchen, was große Vorteile hat.
Stichwort dafür ist: ImageSearch
|
|
|
12/07/2010, 14:03
|
#5
|
elite*gold: 0
Join Date: Jan 2009
Posts: 229
Received Thanks: 60
|
habe mal dieses hier gemacht:
PHP Code:
while 1
$B=0
MouseClick("left" , 959, 745, 1)
$B =_ImageSearch("Windows-7-Start-Orb.png",1,$x1,$y1,100)
If $B = 1 Then
Mouseclick ("left",$x1,$y1)
Else
MouseClick("left" , 1000, 745, 1)
EndIf
Sleep(1000)
WEnd
dadabei kommt dieser Fehler:
C:\Users\******\Desktop\AutoIt v3 Script (neu).au3 (25) : ==> Variable used without being declared.:
$B =_ImageSearch("Windows-7-Start-Orb.png",1,$x1,$y1,100)
$B =_ImageSearch("Windows-7-Start-Orb.png",1,^ ERROR
 das ist das bild dazu
|
|
|
12/07/2010, 14:32
|
#6
|
elite*gold: 1
Join Date: Dec 2006
Posts: 360
Received Thanks: 135
|
Quote:
Originally Posted by AzIo
habe mal dieses hier gemacht:
PHP Code:
while 1 $B=0 MouseClick("left" , 959, 745, 1) $B =_ImageSearch("Windows-7-Start-Orb.png",1,$x1,$y1,100) If $B = 1 Then Mouseclick ("left",$x1,$y1) Else MouseClick("left" , 1000, 745, 1) EndIf Sleep(1000) WEnd
dadabei kommt dieser Fehler:
C:\Users\******\Desktop\AutoIt v3 Script (neu).au3 (25) : ==> Variable used without being declared.:
$B =_ImageSearch("Windows-7-Start-Orb.png",1,$x1,$y1,100)
$B =_ImageSearch("Windows-7-Start-Orb.png",1,^ ERROR
 das ist das bild dazu
|
AutoIT hat dir schon die Lösung gesagt , schau mal wo der ERROR ist.
Bei $x1 und wahrscheinlich auch bei $y1
Wird das Problem beheben!
|
|
|
12/07/2010, 14:40
|
#7
|
elite*gold: 0
Join Date: Jan 2009
Posts: 229
Received Thanks: 60
|
Naja da bin ich zwar auch drauf gekommen aber es kommt immer noch ein error:
PHP Code:
>Running:(3.3.6.1):C:\Program Files (x86)\AutoIt3\autoit3_x64.exe "C:\Users\*****\Desktop\AutoIt v3 Script (neu).au3" C:\Program Files (x86)\AutoIt3\Include\ImageSearch.au3 (40) : ==> Subscript used with non-Array variable.: if $result[0]="0" then return 0 if $result^ ERROR ->14:40:03 AutoIT3.exe ended.rc:1 >Exit code: 1 Time: 2.301
PHP Code:
While 1 $x1=0 $y1=0 $B = 0 MouseClick("left", 959, 745, 1) $B = _ImageSearch("Windows-7-Start-Orb.png", 1, $x1, $y1, 10) If $B = 1 Then MouseClick("left", $x1, $y1) Else MouseClick("left", 1000, 745, 1) EndIf Sleep(1000) WEnd
|
|
|
12/07/2010, 15:00
|
#8
|
elite*gold: 1
Join Date: Dec 2006
Posts: 360
Received Thanks: 135
|
Quote:
Originally Posted by AzIo
Naja da bin ich zwar auch drauf gekommen aber es kommt immer noch ein error:
PHP Code:
>Running:(3.3.6.1):C:\Program Files (x86)\AutoIt3\autoit3_x64.exe "C:\Users\*****\Desktop\AutoIt v3 Script (neu).au3"
C:\Program Files (x86)\AutoIt3\Include\ImageSearch.au3 (40) : ==> Subscript used with non-Array variable.:
if $result[0]="0" then return 0
if $result^ ERROR
->14:40:03 AutoIT3.exe ended.rc:1
>Exit code: 1 Time: 2.301
PHP Code:
While 1
$x1=0
$y1=0
$B = 0
MouseClick("left", 959, 745, 1)
$B = _ImageSearch("Windows-7-Start-Orb.png", 1, $x1, $y1, 10)
If $B = 1 Then
MouseClick("left", $x1, $y1)
Else
MouseClick("left", 1000, 745, 1)
EndIf
Sleep(1000)
WEnd
|
Dieser Fehler kommt wenn du dein Script als 64bit Anwendung kompilieren lässt!
_ImageSearch funktioniert nur bei 32bit
|
|
|
12/07/2010, 15:06
|
#9
|
elite*gold: 0
Join Date: Jan 2009
Posts: 229
Received Thanks: 60
|
Mein komplettes script:
PHP Code:
#include<ImageSearch.au3> #AutoIt3Wrapper_usex64=n HotKeySet("{F1}", "Start") HotKeySet("{F2}", "Pause") HotKeySet("{F3}", "Ende") Global $funcs = False
Func Start() $funcs = True EndFunc ;==>Start
Func Pause() $funcs = False While $funcs = False Sleep(500) WEnd EndFunc ;==>Pause
Func Ende() Exit EndFunc ;==>Ende
While 1 $x1=0 $y1=0 $B = 0 MouseClick("left", 959, 745, 1) $B = _ImageSearch("Windows-7-Start-Orb.png", 1, $x1, $y1, 10) If $B = 1 Then MouseClick("left", $x1, $y1) Else MouseClick("left", 1000, 745, 1) EndIf Sleep(1000) WEnd
Oke jetzt gehts :;D
|
|
|
12/07/2010, 15:10
|
#10
|
elite*gold: 1
Join Date: Dec 2006
Posts: 360
Received Thanks: 135
|
Quote:
Originally Posted by AzIo
Mein komplettes script:
PHP Code:
#include<ImageSearch.au3>
#AutoIt3Wrapper_usex64=n
HotKeySet("{F1}", "Start")
HotKeySet("{F2}", "Pause")
HotKeySet("{F3}", "Ende")
Global $funcs = False
Func Start()
$funcs = True
EndFunc ;==>Start
Func Pause()
$funcs = False
While $funcs = False
Sleep(500)
WEnd
EndFunc ;==>Pause
Func Ende()
Exit
EndFunc ;==>Ende
While 1
$x1=0
$y1=0
$B = 0
MouseClick("left", 959, 745, 1)
$B = _ImageSearch("Windows-7-Start-Orb.png", 1, $x1, $y1, 10)
If $B = 1 Then
MouseClick("left", $x1, $y1)
Else
MouseClick("left", 1000, 745, 1)
EndIf
Sleep(1000)
WEnd
Oke jetzt gehts :;D
|
Kleiner Tipp: bei ImageSearch immer .bmp Bilder benutzen!
|
|
|
12/07/2010, 15:25
|
#11
|
elite*gold: 0
Join Date: Mar 2009
Posts: 2,317
Received Thanks: 1,255
|
Quote:
Originally Posted by sava
Dieser Fehler kommt wenn du dein Script als 64bit Anwendung kompilieren lässt!
_ImageSearch funktioniert nur bei 32bit
|
falsch!
ich nehme an, du hast die imagesearch.dll und imagesearch.au3?
die .dll in dein system32 ordner kopieren, die .au3 in den includes ordner von autoit kopieren.
jetz deine neue.au3 in ein extra ordner und dadrin nochmal die .dll und .au3 einfügen
(so dass die 3 sachen in ein order zsm sind)
und oben in deine neue.au3 das einfügen:
PHP Code:
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_UseX64=n
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
und vllt noch #RequireAdmin wenn du keine vollen rechte hast
|
|
|
12/07/2010, 16:32
|
#12
|
elite*gold: 0
Join Date: Jan 2009
Posts: 229
Received Thanks: 60
|
oke Funktioniert jetzt so halb:d
habe einen screen von meinem startbutton gemacht, auf den screen.jpg fährt er, aber auf das startbutton nicht, Warum das?
|
|
|
12/07/2010, 17:00
|
#13
|
elite*gold: 0
Join Date: Mar 2009
Posts: 2,317
Received Thanks: 1,255
|
du musst das bild so klein wie möglich machen, und am besten nur einen kleinen teil davon,
etwas auffälliges, was sonnst nix auf dein bildschirm hatt....
zb so:
|
|
|
12/07/2010, 17:09
|
#14
|
elite*gold: 0
Join Date: Jan 2009
Posts: 229
Received Thanks: 60
|
xD hmm hab mal das bild verkleinert^^ und dann ist der mauszeiger nicht mehr auf das alte bild bei dem es noch komplett war...
Will eig in nem Javascriptgame das dann laufen lassen.
|
|
|
12/07/2010, 17:14
|
#15
|
elite*gold: 0
Join Date: Mar 2009
Posts: 2,317
Received Thanks: 1,255
|
ist das bild "durchsichtig" ? könnte sich die farbe dahinter auf igenteine art und weise verändern?
wenn ja, wird es nciht klappen, dann müsste mann das bild transparent machen und es versuchen (ob das klappt weiß ich nciht, nur ein gedanke...habs noch nie versucht!!)
|
|
|
 |
|
Similar Threads
|
C# PixelSearch (search screen for pixel)
04/13/2019 - .NET Languages - 6 Replies
This is a very similar to Auto-its PixelSearch functions (since that's what i intended to make it)
Basically it creates a bitmap of a region on the screen, converts the image to a 2d array and loops through the array searching for the inputed color.
NOTE: to compile this in a VC# 2008 you will need to allow unsafe code (HOW: Project->Properties->Build->Allow unsafe code)
public static Point PixelSearch(Rectangle rect, int PixelColor, int Shade_Variation)
{
...
|
Problem mit Pixel search Autoit
06/18/2010 - AutoIt - 14 Replies
Wie der Titel schon sagt habe ich ein Problem mit der funktion Pixel search
Mein Problem ist das die Maus immer über die Rausgesuchte Pixel Position geht
zb O ist der ausgewählte punkt es kommt aber eher sowas raus als ob ich Ö striche ausgewählt hab
Also aimt immer etwas über der angegebennen position der Code :
und dann hätte ich noch die frage ob man mehrere Pixel Searches in einem Script laufen lassen kann
Zb: Wenn die Lebensanzeige sinkt oder Fast lehr ist das eine Function...
|
Pixel Search Click
04/11/2010 - AutoIt - 4 Replies
Hi,
I am trying to open up Internet Explorer using Pixel Search,
But i keep getting Error.
Here is my script :
It finds the color then double clicks on it,but it cannot find the color,i hope some one can help me, +k for any one who can
|
Aoc Bot with Pixel search or how
07/20/2008 - General Gaming Releases - 0 Replies
Hi there
sorry for my poor english
I tryed a aoc bot , but i got several problems
the enemys are fare away so i need to walk to them and then hit.
i cannot get the next target cause first the bot need to look for 50m to see is there a enemy
|
Pixel search
02/23/2008 - Guild Wars - 18 Replies
hallihallo
bin immoment dabei einen meiner eigenen bots zu optimieren und wollte ne Pixelsearchfunktion einbauen.
Leider weiß ich nicht genau wie man das macht vorallem mit den farben.
mein ziel:
3 verschiedene punkte im gw fenster(mit: x1;y1;;x2;y2;;x3;y3) sollen geprüft werden ob sie in GRÜN sind.
falls x1;y1 grün ist -> (dollerzeichen)folge = 1
falls x2;y2 grün ist -> (dollerzeichen)folge = 2
falls x3;y3 grün ist -> (dollerzeichen)folge = 3
|
All times are GMT +1. The time now is 19:13.
|
|