Jump to content

PixelSearch help


pblikpb
 Share

Recommended Posts




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]]] )

 

Link to comment
Share on other sites

  • Developers

@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 


 

 

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

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
Link to comment
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)

 

Link to comment
Share on other sites

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
Link to comment
Share on other sites

  • Moderators

pblikpb,

24 minutes ago, pblikpb said:

Func startAutoshoot() ;

Are you automating a game?

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see 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

 

Link to comment
Share on other sites

  • Moderators

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

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see 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

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...