BluBlack Posted September 8, 2008 Posted September 8, 2008 OK, I've just started using AutoIt a few days ago, and I decided to try and make a simple script for a game i play . This is the code I'm using: Sleep(3000) Global $color = 0xA872B4 While 1=1 Send('{SHIFTDOWN}') $search = PixelSearch(4,30,805,355,$color,5,3) If Not @error Then Send('{F8}') Mouseclick('left',$search[0], $search[1],1,5) Sleep(7000) EndIf If @error Then Mouseclick('left',410,585,1,5) Sleep(5000) EndIf WEnd Basically, all I want it to do is to hold shift, detect a certain pixel and click on it, and if it doesn't detect any, it'll click on another different coordinate. And everything seems to be working fine, except that it won't click at all. The pointer moves to the pixel but doesn't click it. Would appreciate it if someone could help me out
Andreik Posted September 8, 2008 Posted September 8, 2008 OK, I've just started using AutoIt a few days ago, and I decided to try and make a simple script for a game i play . This is the code I'm using: Sleep(3000) Global $color = 0xA872B4 While 1=1 Send('{SHIFTDOWN}') $search = PixelSearch(4,30,805,355,$color,5,3) If Not @error Then Send('{F8}') Mouseclick('left',$search[0], $search[1],1,5) Sleep(7000) EndIf If @error Then Mouseclick('left',410,585,1,5) Sleep(5000) EndIf WEnd Basically, all I want it to do is to hold shift, detect a certain pixel and click on it, and if it doesn't detect any, it'll click on another different coordinate. And everything seems to be working fine, except that it won't click at all. The pointer moves to the pixel but doesn't click it. Would appreciate it if someone could help me out Try this: Sleep(3000) Global $color = 0xA872B4 While 1 Send('{SHIFTDOWN}') $search = PixelSearch(4,30,805,355,$color,5,3) If Not @error Then Send('{F8}') Mouseclick('left',$search[0], $search[1],1,5) Sleep(7000) Else Mouseclick('left',410,585,1,5) Sleep(5000) EndIf WEnd For me work fine.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now