Jump to content

Help with a simple script


Recommended Posts

hey guys,

im quite new to autoit, and i tried to use autoit help already, but nothing has really helped me.

well i want to make a script, that looks for a certain colour in a rectangle, and everytime that colour appears, it should make a left click.

MouseClick("left", 35, 575, 2, 20)
MouseClick("left", 50, 100, 2, 100)
Sleep ( 3000 )
MouseClick("left", 282, 370, 1, 30) 
sleep ( 30000 )
MouseClick("left", 742, 642, 1, 30) 
sleep ( 2000 )
Mousemove ( 684, 413, 30 )
$i = 0
While $i <= 10
    PixelSearch ( 684, 413, 685, 414, 0x583315 )
if Not @error Then
    MouseClick ( "left" )
    $i = $i + 0
EndIf
WEnd

however it only looks once for that colour and then it stops.

or should the script i wrote work?

does it work like a loop and repeat itself untill end of time?

thanks alot guys.

Link to comment
Share on other sites

The loop does continue infinitely for me, I don't know what's wrong on your end.

However, you are doing some extremely pointless things.

First, you don't need to declare $i=0. $i is declared when the loop starts.

Second, You are making an infinite loop in a weird way...take away the line $i = $i+0 because that's doing nothing. Second, just use "While 1" to make an infinite loop.

While 1

stuff to repeat forever

WEnd

The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN

Link to comment
Share on other sites

the problem is in ur code....

You Put:

$i = 0

While $i <= 10

PixelSearch ( 684, 413, 685, 414, 0x583315 )

if Not @error Then

MouseClick ( "left" )

$i = $i + 0

EndIf

WEnd

It should be:

$i = 0

While $i <= 10

PixelSearch ( 684, 413, 685, 414, 0x583315 )

if Not @error Then

MouseClick ( "left" )

$i = $i + 1

EndIf

WEnd

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...