Sign in to follow this  
Followers 0
Yan2099

Almost done but need help

10 posts in this topic

#1 ·  Posted (edited)

Hey guys I need your help I am stuck =p I need this macro to be as fast as possible.

Also is it possible to make multiple mouse click without making multiple line? like Mouseclick 3 ("left", 800, 600)

PART A

MouseClick("left", 800, 569)
MouseClick("left", 800, 600)
$Current = PixelGetColor ???
( how to make it continue if it does not find any color at a specific location and if it find color go to part B at the bottom of this script )

MouseClick("left", 800, 569)
MouseClick("left", 800, 600)
MouseClick("left", 800, 500)
$Current = PixelGetColor ???
( how to make it continue if it does not find any color at a specific location and if it find color go to part B )

MouseClick("left", 800, 569)
MouseClick("left", 800, 600)
MouseClick("left", 800, 600)
MouseClick("left", 800, 500)
$Current = PixelGetColor ???
( how to make it continue if it does not find any color at a specific location and if it find color go to part B )

MouseClick("left", 800, 569)
MouseClick("left", 800, 600)
MouseClick("left", 800, 600)
MouseClick("left", 800, 600)
MouseClick("left", 800, 500)
$Current = PixelGetColor ???
( how to make it continue if it does not find any color at a specific location and if it find color go to part B )

MouseClick("left", 800, 569)
MouseClick("left", 800, 600)
MouseClick("left", 800, 500)
$Current = PixelGetColor ???
( how to make it continue if it does not find any color at a specific location and if it find color go to part B )

MouseClick("left", 800, 569)
MouseClick("left", 800, 600)
MouseClick("left", 800, 600)
MouseClick("left", 800, 500)
$Current = PixelGetColor ???
( how to make it continue if it does not find any color at a specific location and if it find color go to part B )

MouseClick("left", 800, 569)
MouseClick("left", 800, 600)
MouseClick("left", 800, 600)
MouseClick("left", 800, 500)
$Current = PixelGetColor ???
( how to make it continue if it does not find any color at a specific location and if it find color go to part B )

MouseClick("left", 800, 569)
MouseClick("left", 800, 600)
MouseClick("left", 800, 500)
$Current = PixelGetColor ???
( how to make it continue if it does not find any color at a specific location and if it find color go to part B )

MouseClick("left", 800, 569)
MouseClick("left", 800, 600)
MouseClick("left", 800, 600)
MouseClick("left", 800, 500)
$Current = PixelGetColor ???
( how to make it continue if it does not find any color at a specific location  and if it find color go to part B )

MouseClick("left", 800, 569)
MouseClick("left", 800, 600)
MouseClick("left", 800, 600)
MouseClick("left", 800, 500)
$Current = PixelGetColor ???
( how to make it continue if it does not find any color at a specific location and if it find color go to part B )

( if it reach this point , STOP MACRO )


PART B

MouseClick("left", 800, 400)
MouseClick("left", 800, 300)
Start over at beggening of part A
Edited by Yan2099

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

MouseClick ( "button" [, x, y [, clicks [, speed ]]] )

Parameters

button The button to click: "left", "right", "middle", "main", "menu", "primary", "secondary".

x, y [optional] The x/y coordinates to move the mouse to. If no x and y coords are given, the current position is used (default).

clicks [optional] The number of times to click the mouse. Default is 1.

speed [optional] the speed to move the mouse in the range 1 (fastest) to 100 (slowest). A speed of 0 will move the mouse instantly. Default speed is 10.

Edited by JohnOne

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites

JohnOne Said it, just read the help:)

And try post yor code with out $Current = PixelGetColor ??? and such things, and try make more clear what you want to do.

I am sure that autoit doesn't like PixelGetColor ???, but I am also sure that autoit do like PixelGetColor ($x,$y)

you can also use

;Add comments to your code to make it easier to
;understand what you are trying to do.
if $Current = $ColorCode then
;do 3 click
for $i = 1 to 3
MouseClick("left", 800, 500)
next
else
;if color nor found, what to do
endif

edited

Share this post


Link to post
Share on other sites

I want to make something like that

PART A

MouseClick("left", 800, 569)
MouseClick("left", 800, 600)
    ;===Button 1===
    ;x
        $Button[0] = 170
    ;y
        $Button[1] = 562
    ;color
        $Button[2] = 0x96F4FC
    ;==============
        $Current = PixelGetColor($Button[0],$Button[1])
        If $Current > $Button[2]-$Range AND $Current < $Button[2]+$Range Then ( GO TO PART B) otherwhise continue to next line


MouseClick("left", 800, 569)
MouseClick("left", 800, 600)
MouseClick("left", 800, 600)
MouseClick("left", 800, 500)
    ;===Button 1===
    ;x
        $Button[0] = 170
    ;y
        $Button[1] = 562
    ;color
        $Button[2] = 0x96F4FC
    ;==============
        $Current = PixelGetColor($Button[0],$Button[1])
        If $Current > $Button[2]-$Range AND $Current < $Button[2]+$Range Then ( GO TO PART B) otherwhise continue to next line

( if it doesent find the color continue to next line
( if it reach this point , STOP MACRO )


PART B

MouseClick("left", 800, 400)
MouseClick("left", 800, 300)
then Start over at beggening of part A

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

how do I make 2 seperate part like PART A and PART B and it only go on PART B when it find the color or skip to next line if it doesent

If $Current > $Button[2]-$Range AND $Current < $Button[2]+$Range Then ( GO TO PART ;) otherwhise continue to next line

Edited by Yan2099

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

MouseClick("left", 800, 569)
MouseClick("left", 800, 600)
    ;===Button 1===
    ;x
        $Button[0] = 170
    ;y
        $Button[1] = 562
    ;color
        $Button[2] = 0x96F4FC
    ;==============
        $Current = PixelGetColor($Button[0],$Button[1])
        If $Current > $Button[2]-$Range AND $Current < $Button[2]+$Range Then
            MouseClick("left", 800, 569) then MouseClick("left", 800, 569)
            Sleep(100)
            MouseClick("left", 800, 569) then MouseClick("left", 800, 569)
            Sleep(100)
        EndIf

MouseClick("left", 800, 569)
MouseClick("left", 800, 600)
MouseClick("left", 800, 600)
MouseClick("left", 800, 500)
    ;===Button 1===
    ;x
        $Button[0] = 170
    ;y
        $Button[1] = 562
    ;color
        $Button[2] = 0x96F4FC
    ;==============
        $Current = PixelGetColor($Button[0],$Button[1])
        If $Current > $Button[2]-$Range AND $Current < $Button[2]+$Range Then 

            MouseClick("left", 800, 569) then MouseClick("left", 800, 569)
            Sleep(100)
            MouseClick("left", 800, 569) then MouseClick("left", 800, 569)
            Sleep(100)
        EndIf

Wend


PART B

MouseClick("left", 800, 400)
MouseClick("left", 800, 300)
Start over at beggning of PART A

Edited by Yan2099

Share this post


Link to post
Share on other sites

you do it worng, do it like this.

Dim $Current,$Range,$Button
While 1 ;1 will cause infinate loop, but command exit can stop it :)
    A(); call func A over and over again!
WEnd

Func A()

    MouseClick("left", 800, 569)
    MouseClick("left", 800, 600)
    ;===Button 1===
    ;x
    $Button[0] = 170;use something other than button[X] for example, u can use $x instead of $Button[0]
    ;y
    $Button[1] = 562
    ;color
    $Button[2] = 0x96F4FC
    ;==============
    $Current = PixelGetColor($Button[0], $Button[1])
    If $Current > $Button[2] - $Range And $Current < $Button[2] + $Range Then
        b()
    EndIf


    MouseClick("left", 800, 569)
    MouseClick("left", 800, 600)
    MouseClick("left", 800, 600)
    MouseClick("left", 800, 500)
    ;===Button 1===
    ;x
    $Button[0] = 170
    ;y
    $Button[1] = 562
    ;color
    $Button[2] = 0x96F4FC
    ;==============
    $Current = PixelGetColor($Button[0], $Button[1])
    If $Current > $Button[2] - $Range And $Current < $Button[2] + $Range Then
        b()
    EndIf

    ;( if it doesent find the color continue to next line
    ;( if it reach this point , STOP MACRO )
    If $Current = 0x96F4FC Then ; I dno if that right color
        Exit; if right color found, exit
    Else
        Return ;go to another tour
    EndIf
EndFunc   ;==>A

Func B()

    MouseClick("left", 800, 400)
    MouseClick("left", 800, 300)
EndFunc   ;==>B
;then Start over at beggening of part A
;If you call func A u get errors if u do that alot, that's why we are using while

edited

Share this post


Link to post
Share on other sites

just press f1 in scite and read it trough I am sure it will help you ;)


edited

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