Sign in to follow this  
Followers 0
pezo89

second pixelsearch?

1 post in this topic

i can't figure it out, nor have it work,

Q: - How can i have it do a pixelsearch before initiating the script below, (if it does find a color. ) and if not, go straight for another approach?

Note - as far as iv tried with a first pixelsearch, it still does the "approach" below, even if it dosent find the color i am looking for

;test;
Global $Paused
sleep ("1000")
HotKeySet("{Pause}", "TogglePause")
HotKeySet("{Insert}", "Terminate")
sleep ("2000")
sleep ("2000")
send ("{CTRLdown}")
sleep ("200")
Send ("{0}")
sleep ("2000")
Send ("{NUMPADSUB 1}")
sleep (5000)
send ("{CTRLup}")
sleep ("4000")
send ("{CTRLup}")
sleep (2000)

send ("{Pause}")
$a_answers = StringSplit("xxxx   ", ",")
while 1

toolTip('Script -  "Scriptet er - PÅ"',0, 40)


$pixelSearch=PixelSearch(412, 269, 1005, 769,  0XFFEB75);Search the pixelcolor => Start at 0pixel by 0pixel and finish at your DesktopWidth by DesktopHeight
sleep (1000)
MouseClick("left",$pixelSearch[0],$pixelSearch[1],1,5);Click with left mouse at pixelfound position (with 0 speed = MAX)
MouseClick("left",$pixelSearch[0],$pixelSearch[1],1,5);Click with left mouse at pixelfound position (with 0 speed = MAX)
sleep (1000)


If IsArray($pixelSearch)=1 Then;If the pixel color has been found then
$pixelSearch=PixelSearch(412, 269, 1005, 769,  0XFFEB75);Search the pixelcolor => Start at 0pixel by 0pixel and finish at your DesktopWidth by DesktopHeight
sleep (2000)
MouseClick("left",$pixelSearch[0],$pixelSearch[1],1,5);Click with left mouse at pixelfound position (with 0 speed = MAX)
MouseClick("left",$pixelSearch[0],$pixelSearch[1],1,5);Click with left mouse at pixelfound position (with 0 speed = MAX)
sleep (2000)
sleep (100)
Send("{Tab}")
sleep (100)
sleep (2000)
$i_var = Random(1, $a_answers[0], 1)
Send($a_answers[$i_var])
sleep (2000)
Send("{Shiftdown}")
sleep (3000)
Send("{Tab}")
sleep (100)
Send("{Tab}")
sleep (100)
Send("{Tab}")
sleep (100)
Send("{shiftup}")
sleep (1000)
send ("{Space}")
sleep (4000)
EndIf
WEnd

Func TogglePause()
    $Paused = NOT $Paused
    While $Paused
        sleep(100)
        toolTip('Script -  "Scriptet er - AV"',0, 40)
    WEnd
    ToolTip("")
EndFunc

Func Terminate()

    Exit 0
EndFunc

Share this post


Link to post
Share on other sites



Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0