Jump to content
Sign in to follow this  
Douves

Return to line ....

Recommended Posts

Douves

Hello has all, I am French, and I use a translator, I made a script with autoit, but I would want that if the program does not find certain pixel, as it returns has the previous action(share), or, a predefined line...

Is there a code for that?

My code :

While 1 
    $coord=PixelSearch( 0, 0 , 1024 , 768 ,"0xF4F4FD")
If Not @error Then
;Rejoignons le combat....
Mouseclick("left", $coord[0] , $coord[1] , 1, 0)
Mouseclick("left", $coord[0] + 10, $coord[1] + 10 , 1, 0)
;sortie de boucle...
ExitLoop
EndIf
wend

While 2
    sleep("2000")
    $pret=Pixelsearch(661, 446, 719, 463, "0xFF6600")
    If @error Then
[u][b]; I want that he(it) returns has the first line...[/b][/u]
        EndIf
        If Not @error Then
Mouseclick("left", $pret[0], $pret[1], 1, 10)           
ExitLoop
EndIf
wend

Share this post


Link to post
Share on other sites
Mat

Bonjour (mais mon francais est nul ^_^ )

Put your entire script in another loop, and read the helpfile - look at continue loop. The rest of the script seems fairly good though. What game is it for?

I do not know exactly what you are attempting to do, so this will not be 100% accurate. But it is the general idea.

CODE
While 1

While 1

$coord=PixelSearch( 0, 0 , 1024 , 768 ,"0xF4F4FD")

If Not @error Then

;Rejoignons le combat....

Mouseclick("left", $coord[0] , $coord[1] , 1, 0)

Mouseclick("left", $coord[0] + 10, $coord[1] + 10 , 1, 0)

;sortie de boucle...

ExitLoop

EndIf

wend

While 2

sleep("2000")

$pret=Pixelsearch(661, 446, 719, 463, "0xFF6600")

If @error Then

ContinueLoop[2]

Else

Mouseclick("left", $pret[0], $pret[1], 1, 10)

ExitLoop

EndIf

wend

WEnd

Edit: added level to continue loop.

Edited by mdiesel

Share this post


Link to post
Share on other sites
Mat

no probs. If you want to include more loops, just change the level of continue loop!

as for part 2 of returning to a specific line, just change the location of the loops, make sure you are still nesting it properly though.

MDiesel

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.