Sign in to follow this  
Followers 0
helpwins

help me plz

7 posts in this topic

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

Global $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

Share this post


Link to post
Share on other sites



#2 ·  Posted (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 by somdcomputerguy

- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Either that or ake $var a hex (after it's a decimal).

Edited by somdcomputerguy

- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Share this post


Link to post
Share on other sites

thanks all i got it working awsome with yalls help thanks

Share this post


Link to post
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
Sign in to follow this  
Followers 0