Mellowz Posted September 29, 2006 Share Posted September 29, 2006 Is there a way to make the range of PixelSearch follow the mouse instead of just stay in the middle where the given location is? Link to comment Share on other sites More sharing options...
Mellowz Posted September 29, 2006 Author Share Posted September 29, 2006 (edited) I'm afraid I do not understand. This is how I have it setup: While 1 If $TeamID > -1 Then If $TeamID = 0 Then $coord = PixelSearch(473, 349, 552, 419, 0x333F29, 0) Else $coord = PixelSearch(473, 349, 552, 419, 0x7D6340, 0) EndIf If Not @error Then MouseMove($coord[0], $coord[1], 0) ContinueLoop Else Sleep(100) EndIf EndIf WEnd Also, thanks for the reply. Edited September 29, 2006 by Mellowz Link to comment Share on other sites More sharing options...
AzKay Posted September 29, 2006 Share Posted September 29, 2006 (edited) Not tested, But, Does this work? AdlibEnable("_MousePos", 1) Global $Pos While 1 If $TeamID > -1 Then If $TeamID = 0 Then $coord = PixelSearch($Pos[0] - 10, $Pos[1] - 10, $Pos[0] + 10, $Pos[1] + 10, 0x333F29, 0) Else $coord = PixelSearch($Pos[0] - 10, $Pos[1] - 10, $Pos[0] + 10, $Pos[1] + 10, 0x7D6340, 0) EndIf If Not @error Then MouseMove($coord[0], $coord[1], 0) ContinueLoop Else Sleep(100) EndIf EndIf WEnd Func _MousePos() $Pos = MouseGetPos() EndFunc Should, Search a 10px square around the mouse. EDIT:: Larry beat me =O EDIT:: And his is probly better than mine =P Edited September 29, 2006 by AzKay # MY LOVE FOR YOU... IS LIKE A TRUCK- # Link to comment Share on other sites More sharing options...
Mellowz Posted September 29, 2006 Author Share Posted September 29, 2006 (edited) Oh, I was going to try MouseGetPos, Larry, but I didn't understand what you meant, so I posted the code so we could work together on it. However, thanks for this version of it, both of you. Edited September 29, 2006 by Mellowz Link to comment Share on other sites More sharing options...
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