Jump to content

Please Read this


Recommended Posts

Hello so ive been wondering how do I make my script run multiple times?

like a mouse will click on a pixel that the pixel search has found and I want my script to do it again.

Example Code:

$var1 = PixelSearch ( 0,0, 1279, 1023, 0xFF0000 )
If Not @error Then
MouseClick("Left", $var[0], $var[1], 1)
EndIf

I know I need to use Do or While Loop but I don't know how to use them well.

Link to comment
Share on other sites

Your sleep will only be executed when the loop is finished.

You'd want your code to look liek this.

Local $t = 0
While $t < 10
    MsgBox(0,"","Hi")
    Sleep(1000) ;put the sleep inside the loop
    $t += 1 ;this is another way to increate $t by 1
Wend

A For...To...Next loop would be better for this code:

For $t = 0 To 9 ;this declares $t and automatically increments it by 1, untill $t is 9 at which point the loop will run one last time before it exits.
    MsgBox(0,"","Hi")
    Sleep(1000)
Next

Please reply quick

That almost stopped me from replying. I doubt anyone will feel more inclined to help you if you tell em to be quick about it.
Link to comment
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
 Share

  • Recently Browsing   0 members

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