helpwins Posted September 2, 2010 Posted September 2, 2010 i want it to click in a spot when the var = color if it dont = then i want it to click a diffrent spot this is what i got but it dont work expandcollapse popupGlobal $Paused HotKeySet("{PAUSE}", "TogglePause") HotKeySet("{ESC}", "Terminate") HotKeySet("+!d", "ShowMessage") ;Shift-Alt-d send("{PAUSE}") MouseClick("left",617,498,1,0) sleep(1000) ;;;; Body of program would go here ;;;; While 1 $var = PixelGetColor( 253 , 182 ) $color = 0x000000 If Not @error Then $var = $color MouseClick("left", 951, 614, 1, 0) Sleep(2000) If @error Then MouseClick("left", 661, 653, 1, 0) Sleep(2000) MouseClick("left", 571, 653, 1, 0) Sleep(2000) EndIf EndIf WEnd ;;;;;;;; Func TogglePause() $Paused = NOT $Paused While $Paused sleep(0) ToolTip('Script is "Paused"',0,0) WEnd ToolTip("") EndFunc Func Terminate() Exit 0 EndFunc Func ShowMessage() MsgBox(4096,"","This is a message.") EndFunc
somdcomputerguy Posted September 2, 2010 Posted September 2, 2010 (edited) Read the docs for PixelGetColor again. See this? Success: Returns decimal value of pixel's color.In your code: $var = PixelGetColor( 253 , 182 ) $color = 0x000000 If Not @error Then $var = $color $var has a decimal value, $color has a hexadecimal value. See the last line in the example for a solution. Edit: Also, your If usage is wrong. Re-read the Language Reference section in the Helpfile again, in particular Conditional Statements. Edited September 2, 2010 by somdcomputerguy - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change.
JohnOne Posted September 2, 2010 Posted September 2, 2010 $color = 0x000000 $var = PixelGetColor( 253 , 182 ) If $var = $color Then ;click something Else ;click something else EndIf AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
helpwins Posted September 2, 2010 Author Posted September 2, 2010 Read the docs for PixelGetColor again. See this? In your code: $var = PixelGetColor( 253 , 182 ) $color = 0x000000 If Not @error Then $var = $color $var has a decimal value, $color has a hexadecimal value. See the last line in the example for a solution. Edit: Also, your If usage is wrong. Re-read the Language Reference section in the Helpfile again, in particular Conditional Statements. should i ake the color a decimal?
somdcomputerguy Posted September 2, 2010 Posted September 2, 2010 (edited) Either that or ake $var a hex (after it's a decimal). Edited September 2, 2010 by somdcomputerguy - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change.
JohnOne Posted September 2, 2010 Posted September 2, 2010 It dosent matter, the return will work when tested against dec or hex. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
helpwins Posted September 3, 2010 Author Posted September 3, 2010 thanks all i got it working awsome with yalls help thanks
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