pblikpb

PixelSearch help

8 posts in this topic




how to do it

Remarks

The search direction varies as follows:
    Left-to-Right - left < right
    Right-to-Left - right < left
    Top-to-Bottom - top < bottom
    Bottom-to-Top - bottom < top

My rectangle coordinates

PixelSearch( 900,100,1015,515, 0xff0000 , 2 )

PixelSearch ( left, top, right, bottom, color [, shade-variation = 0 [, step = 1 [, hwnd]]] )

I need

PixelSearch ( right, bottom,left, top, color [, shade-variation = 0 [, step = 1 [, hwnd]]] )

 

Share this post


Link to post
Share on other sites



@pblikpb,

Welcome,  I am not sure how often you were planning to post the same question but I have deleted the other 2.
Since you are new to our forums I also like to point you to our forumrules so you understand how this community is working.

Jos 


 

 


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Im sorry. How to change the direction to scan the bottom up. 

Remarks

The search direction varies as follows:
    Left-to-Right - left < right
    Right-to-Left - right < left
    Top-to-Bottom - top < bottom
    Bottom-to-Top - bottom < top

Edited by pblikpb

Share this post


Link to post
Share on other sites

I hope this will help with your understanding.

#cs
The search direction varies as follows:
        Left-to-Right - left < right
        Right-to-Left - right < left
        Top-to-Bottom - top < bottom
        Bottom-to-Top - bottom < top
#ce

;         PixelSearch(left, top, right, bottom,    color ,s-v) ; Search directions based on the relative sizes of the function parameters (left, top, right, and bottom)
$aCoord = PixelSearch( 900, 100,  1015,    515, 0xff0000 , 2 ) ; Left-to-Right & Top-to-Bottom because left < right & top < bottom
$aCoord = PixelSearch( 900, 515,  1015,    100, 0xff0000 , 2 ) ; Left-to-Right & Bottom-to-Top because left < right & bottom < top
$aCoord = PixelSearch(1015, 100,   900,    515, 0xff0000 , 2 ) ; Right-to-Left & Top-to-Bottom because right < left & top < bottom
$aCoord = PixelSearch(1015, 515,   900,    100, 0xff0000 , 2 ) ; Right-to-Left & Bottom-to-Top because right < left & bottom < top
;....................(..^.,..^.,....^.,....^..,......^...,.^.) ; 
;....................(left, top, right, bottom,    color ,s-v)

 

2 people like this

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Thanks for the answer . Please see all of the code . How can I speed up the script ? If the subject is more likely to appear at the bottom.

#include <Misc.au3>
#include <WindowsConstants.au3>
Global $Autoshoot = 0, $i, $color = 0xFF0000, $scan = 0

HotKeySet("{INSERT}", "startAutoshoot") ;
HotKeySet("{DELETE}", "offAutoshoot") ;

While 1 ;цикл
If $Autoshoot = 1 then
PixelSearch( 1015,515,900,100, 0xff0000 , 2 ) ;
If Not @error then ;
$i = 1
While $i < 2
Call('clicks') ;
$i = $i + 1
WEnd
EndIf
EndIf
WEnd

Func startAutoshoot() ;
$Autoshoot = 1
EndFunc ; 
Func offAutoshoot() ; 
$Autoshoot = 0
EndFunc ; 
Func clicks() ;
AutoItSetOption('MouseClickDelay',0) ;
MouseClick('left') ; 
EndFunc

Edited by pblikpb

Share this post


Link to post
Share on other sites

pblikpb,

24 minutes ago, pblikpb said:

Func startAutoshoot() ;

Are you automating a game?

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

yes it Autoshot
Edited by pblikpb

Share this post


Link to post
Share on other sites

pblikpb,

I feared as much.  You appear to have missed the Forum rules on your way in. Please read them now - particularly the bit about not discussing game automation - and then you will understand why you will get no help and this thread will now be locked.

See you soon with a legitimate question I hope.

M23

1 person likes this

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.