Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > AutoIt
You last visited: Today at 17:45

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

Advertisement



Suche Farb PixelSearch code

Discussion on Suche Farb PixelSearch code within the AutoIt forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 7
Join Date: Jun 2010
Posts: 198
Received Thanks: 36
Suche Farb PixelSearch code

Hey,

Kann mir irgendjemand den code für pixelsearch, oder am besten direkt das ganze script schicken, wo pixelsearch nach einem 'weißen beachball' sucht?
wäre voll cool
SprayDay is offline  
Old 07/21/2010, 16:19   #2
 
DraaaKe's Avatar
 
elite*gold: 99
Join Date: May 2009
Posts: 1,020
Received Thanks: 400
Das hier ist eine Community, keine Job Börse^^ Das Skript das du möchtest wird wohl nicht sehr schwer zu schreiben sein, Blos arbeite ich nie mit Pixelsearch. Wenn du mir genauer beschreiben könntest, wo sich der Ball bewegt und in welcher Fenstergröße und ob sonst noch irgendwo weis auf dem Bildschirm is, dann könnte ich dir weiter helfen

Und die genaue Farbe wäre nicht schlecht
DraaaKe is offline  
Old 07/21/2010, 16:24   #3
 
lczocker's Avatar
 
elite*gold: 0
Join Date: Jun 2009
Posts: 20
Received Thanks: 1
Du kannst es auch mit ImageSearch den ball als gesamtes bild suchen lassen, das wäre (glaub ich) einfacher als nach einem einzigen pixel zu suchen

schau dir mal die UDF an

ImageSearch.au3:
PHP Code:
#include-once
; ------------------------------------------------------------------------------
;
AutoIt Version3.0
Language:       English
Description:    Functions that assist with Image Search
;                 Require that the ImageSearchDLL.dll be loadable
;
; ------------------------------------------------------------------------------

;===============================================================================
;
Description:      Find the position of an image on the desktop
Syntax:           _ImageSearchArea_ImageSearch
Parameter(s):     
;                   
$findImage the image to locate on the desktop
;                   $tolerance for no tolerance (0-255). Needed when colors of 
;                                image differ from desktope.g GIF
;                   $resultPosition Set where the returned x,y location of the image is.
;                                     
for centre of imagefor top left of image
;                   $x $y - Return the x and y location of the image
;
; Return 
Value(s):  On Success Returns 1
;                   On Failure Returns 0 
;
Note: Use _ImageSearch to search the entire desktop_ImageSearchArea to specify
;       a desktop region to search
;
;===============================================================================
Func _ImageSearch($findImage,$resultPosition,ByRef $xByRef $y,$tolerance)
   return 
_ImageSearchArea($findImage,$resultPosition,0,0,@DesktopWidth,@DesktopHeight,$x,$y,$tolerance)
EndFunc

Func _ImageSearchArea
($findImage,$resultPosition,$x1,$y1,$right,$bottom,ByRef $xByRef $y$tolerance)
    ;
MsgBox(0,"asd","" $x1 " " $y1 " " $right " " $bottom)
    if 
$tolerance>0 then $findImage "*" $tolerance " " $findImage
    $result 
DllCall("ImageSearchDLL.dll","str","ImageSearch","int",$x1,"int",$y1,"int",$right,"int",$bottom,"str",$findImage)

    ; If 
error exit
    if 
$result[0]="0" then return 0
    
    
Otherwise get the x,y location of the match and the size of the image to
    
compute the centre of search
    $array 
StringSplit($result[0],"|")
   
   
$x=Int(Number($array[2]))
   
$y=Int(Number($array[3]))
   if 
$resultPosition=1 then
      $x
=$x Int(Number($array[4])/2)
      
$y=$y Int(Number($array[5])/2)
   endif
   return 
1
EndFunc

;===============================================================================
;
Description:      Wait for a specified number of seconds for an image to appear
;     
Syntax:           _WaitForImageSearch_WaitForImagesSearch
Parameter(s):     
;                    
$waitSecs  seconds to try and find the image
;                   $findImage the image to locate on the desktop
;                   $tolerance for no tolerance (0-255). Needed when colors of 
;                                image differ from desktope.g GIF
;                   $resultPosition Set where the returned x,y location of the image is.
;                                     
for centre of imagefor top left of image
;                   $x $y - Return the x and y location of the image
;
; Return 
Value(s):  On Success Returns 1
;                   On Failure Returns 0 
;
;
;===============================================================================
Func _WaitForImageSearch($findImage,$waitSecs,$resultPosition,ByRef $xByRef $y,$tolerance)
    
$waitSecs $waitSecs 1000
    $startTime
=TimerInit()
    While 
TimerDiff($startTime) < $waitSecs
        sleep
(100)
        
$result=_ImageSearch($findImage,$resultPosition,$x$y,$tolerance)
        if 
$result 0 Then
            
return 1
        
EndIf
    
WEnd
    
return 0
EndFunc

;===============================================================================
;
Description:      Wait for a specified number of seconds for any of a set of
;                   images to appear
;     
Syntax:           _WaitForImagesSearch
Parameter(s):     
;                    
$waitSecs  seconds to try and find the image
;                   $findImage the ARRAY of images to locate on the desktop
;                              - ARRAY[0is set to the number of images to loop through
;                                 ARRAY[1is the first image
;                   $tolerance for no tolerance (0-255). Needed when colors of 
;                                image differ from desktope.g GIF
;                   $resultPosition Set where the returned x,y location of the image is.
;                                     
for centre of imagefor top left of image
;                   $x $y - Return the x and y location of the image
;
; Return 
Value(s):  On Success Returns the index of the successful find
;                   On Failure Returns 0 
;
;
;===============================================================================
Func _WaitForImagesSearch($findImage,$waitSecs,$resultPosition,ByRef $xByRef $y,$tolerance)
    
$waitSecs $waitSecs 1000
    $startTime
=TimerInit()
    While 
TimerDiff($startTime) < $waitSecs
        
for $i 1 to $findImage[0]
            
sleep(100)
            
$result=_ImageSearch($findImage[$i],$resultPosition,$x$y,$tolerance)
            if 
$result 0 Then
                
return $i
            
EndIf
        
Next    
    WEnd
    
return 0
EndFunc 
lczocker is offline  
Old 07/21/2010, 17:37   #4
 
PenGuin :O's Avatar
 
elite*gold: 2
Join Date: Mar 2008
Posts: 1,778
Received Thanks: 1,222
ImageSearch ist nur dann besser, wenn auch andere weiße Pixel auf dem Bewegungszyklus des Balles liegen, ansonsten sollte PixelSearch reichen.
PenGuin :O is offline  
Reply


Similar Threads Similar Threads
Suche G1 credits..habe 2.11€ psc und cx4 dinar code+5kdinar code
08/04/2010 - WarRock Trading - 1 Replies
hey..suche g1 credits für 2,11 € psc reste und 5k dinar code + cx4storm code macht mir angebote...
Gebe Vip Hack Suche Storm Code oder 5k Dinar Code
07/25/2010 - WarRock Trading - 4 Replies
blubb
Suche gegenteilcode von pixelsearch
07/23/2010 - AutoIt - 9 Replies
Hey, ich suche eine code, der genau das gegenteil bewirkt von Pixelsearch... er müsste vor rotoder blau UND schwarz 'weglaufen'
suche last chos code gebe RoM code
08/23/2009 - General Gaming Discussion - 3 Replies
wie oben gesgat ich such eine last chaos code aus der computer bild spiele ich gebe dafür den code von Runes of magic der in mein heft dabei war! pnt mich ein fach!



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


Powered by vBulletin®
Copyright ©2000 - 2026, 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 ©2026 elitepvpers All Rights Reserved.