Sign in to follow this  
Followers 0
Xav

How If get ....?

10 posts in this topic

#1 ·  Posted (edited)

How can I do?

If color coord does not exist, it will go directly to coord2...

(If not error,If error Do not work...)

Thanks

PixelSearch( 20, 395,54,430, 0xfce874 ) Then
   If not @error Then
   Send("{f1}") 
   MouseClick("right" ,46, 458 ,1 ,0)
   Sleep(450)
   MouseClick("right" ,35, 261 ,1 ,0)
   Sleep(450)
   MouseClick("right" ,31, 508 ,1 ,0)
   Sleep(450)
   MouseClick("right" ,153, 561 ,1 ,0)
   Sleep(450)
   MouseClick("right" ,29, 502 ,1 ,0)
   Sleep(450)
   MouseClick("right" ,20, 468 ,1 ,0)
   Sleep(450)
   MouseClick("right" ,17, 480 ,1 ,0)
   Sleep(450)
   MouseClick("right" ,10, 518 ,1 ,0)
   Sleep(450)
   MouseClick("right" ,7, 320 ,1 ,0)
   Sleep(450)
   MouseClick("right" ,9, 280 ,1 ,0)
   Sleep(450)
   MouseClick("right" ,7, 273 ,1 ,0)
   Sleep(450)
   MouseClick("right" ,7, 320 ,1 ,0)
   Sleep(450)
   MouseClick("right" ,12, 365 ,1 ,0)
   Sleep(450)
   MouseClick("right" ,15, 234 ,1 ,0)
   Sleep(450)
   MouseClick("right" ,19, 166 ,1 ,0)
   Sleep(450)
   MouseClick("right" ,17, 189 ,1 ,0)
   Sleep(450)
   MouseClick("right" ,14, 220 ,1 ,0)
   Sleep(450)
   MouseClick("right" ,18, 212 ,1 ,0)
   Sleep(450)
   MouseClick("right" ,684, 351 ,1 ,0)
   Sleep(450)
   MouseClick("left" ,509, 287 ,1 ,0)
Endif   
                        
                    PixelSearch( 6, 250,42,301, 0xFCE874 )
                        If not @error Then
            Send("{f1}")
            MouseClick("right" ,412, 487 ,1 ,0)
            Sleep(360)
            MouseClick("right" ,411, 576 ,1 ,0)
            Sleep(360)
            MouseClick("right" ,789, 523 ,1 ,0)
            Sleep(360)
            MouseClick("right" ,782, 491 ,1 ,0)
            Sleep(360)
            MouseClick("right" ,792, 529 ,1 ,0)
            Sleep(360)
            MouseClick("right" ,778, 378 ,1 ,0)
            Sleep(360)
            MouseClick("right" ,797, 138 ,1 ,0)
            Sleep(360)
            MouseClick("right" ,801, 175 ,1 ,0)
            Sleep(360)
            MouseClick("right" ,800, 285,1 ,0)
            Sleep(360)
            MouseClick("right" ,793, 356 ,1 ,0)
            Sleep(360)
            MouseClick("right" ,795, 323 ,1 ,0)
            Sleep(360)
            MouseClick("right" ,782, 127 ,1 ,0)
            Sleep(360)
            MouseClick("right" ,797, 385 ,1 ,0)
            Sleep(360)
            MouseClick("right" ,791, 428 ,1 ,0)
            Sleep(360)
            MouseClick("right" ,783, 244 ,1 ,0)
            Sleep(360)
            MouseClick("right" ,783, 412 ,1 ,0)
            Sleep(360)
            MouseClick("right" ,775, 315 ,1 ,0)
            Sleep(360)
            MouseClick("right" ,763, 348 ,1 ,0)
            Sleep(360)
            MouseClick("right" ,763, 348 ,1 ,0)
            Sleep(360)
            MouseClick("right" ,763, 348 ,1 ,0)
            Sleep(360)
            MouseClick("right" ,763, 348 ,1 ,0)
            Sleep(360)
            MouseClick("right" ,6, 313,1 ,0)
            SleeP(360)
            MouseClick("left" ,492, 279 ,1 ,0)
                EndIf
                                                
                                PixelSearch( 767, 339,800,373, 0x644c2c )  
                                                If not @error Then
                            Send("{f1}")
                                                MouseClick("right" ,126, 533 ,1 ,0)
                                                Sleep(360)
                                                MouseClick("right" ,9, 519 ,1 ,0)
                                                Sleep(360)
                                                MouseClick("right" ,16, 468 ,1 ,0)
                                                Sleep(360)
                                                MouseClick("right" ,22, 522 ,1 ,0)
                                                Sleep(360)
                                                MouseClick("right" ,205, 477 ,1 ,0)
                                                Sleep(360)
                                                MouseClick("right" ,13, 521 ,1 ,0)
                                                Sleep(360)
                                                MouseClick("right" ,12, 493 ,1 ,0)
                                                Sleep(360)
                                                MouseClick("right" ,17, 503 ,1 ,0)
                                                Sleep(360)
                                                MouseClick("right" ,10, 413,1 ,0)
                                                Sleep(360)
                                                MouseClick("right" ,5, 93 ,1 ,0)
                                                Sleep(360)
                                                MouseClick("right" ,6, 212 ,1 ,0)
                                                Sleep(360)
                                                MouseClick("right" ,36, 476 ,1 ,0)
                                                Sleep(360)
                                                MouseClick("right" ,14, 392 ,1 ,0)
                                                Sleep(360)
                                                MouseClick("right" ,139, 254 ,1 ,0)
                                                Sleep(360)
                                                MouseClick("right" ,46, 348 ,1 ,0)
                                                Sleep(360)
                                                MouseClick("right" ,23, 234 ,1 ,0)
                                                Sleep(360)
                                                MouseClick("right" ,23, 234 ,1 ,0)
                                                Sleep(360)
                                                MouseClick("right" ,23, 234 ,1 ,0)
                                                Sleep(360)
                                                MouseClick("right" ,23, 234 ,1 ,0)
                                                Sleep(360)
                                                MouseClick("right" ,655, 379 ,1 ,0)
                                                Sleep(360)
                                                MouseClick("left" ,471, 248 ,1 ,0)
                                                Endif
Edited by Xav

Share this post


Link to post
Share on other sites



Maybe.....

*** NOT TESTED!!!

Global $Paused
Dim $arGrid[3][6] = [[ 20, 395, 54, 430, 0xfce874], [ 6, 250, 42, 301, 0xFCE874], [ 767, 339, 800, 373, 0x644c2c]]
Local $wait = 5000  ; 1 second = 1000

HotKeySet("{PAUSE}", "TogglePause")
HotKeySet("{ESC}", "Terminate")
HotKeySet("{F9}", "ShowMe")

While 1
    
    For $x = 0 To 2
        PixelSearch($arGrid[$x][0], $arGrid[$x][1], $arGrid[$x][2], $arGrid[$x][3], $arGrid[$x][4])
        If Not @error Then
            Call(Eval("Search" & $x))
            ExitLoop
        EndIf
    Next
    
    Sleep($wait)
WEnd

Func TogglePause()
    $Paused = Not $Paused
    While $Paused
        Sleep(100)
        ToolTip('Script is "Paused"', 0, 0)
    WEnd
    ToolTip("")
EndFunc   ;==>TogglePause

Func Terminate()
    Exit 0
EndFunc   ;==>Terminate

Func ShowMe()
    MsgBox(4096, "", "Thanks ...Valuater 8)   ", 3)
EndFunc   ;==>ShowMe


Func Search0()

    Send("{f1}")
    MouseClick("right", 46, 458, 1, 0)
    Sleep(450)
    MouseClick("right", 35, 261, 1, 0)
    Sleep(450)
    MouseClick("right", 31, 508, 1, 0)
    Sleep(450)
    MouseClick("right", 153, 561, 1, 0)
    Sleep(450)
    MouseClick("right", 29, 502, 1, 0)
    Sleep(450)
    MouseClick("right", 20, 468, 1, 0)
    Sleep(450)
    MouseClick("right", 17, 480, 1, 0)
    Sleep(450)
    MouseClick("right", 10, 518, 1, 0)
    Sleep(450)
    MouseClick("right", 7, 320, 1, 0)
    Sleep(450)
    MouseClick("right", 9, 280, 1, 0)
    Sleep(450)
    MouseClick("right", 7, 273, 1, 0)
    Sleep(450)
    MouseClick("right", 7, 320, 1, 0)
    Sleep(450)
    MouseClick("right", 12, 365, 1, 0)
    Sleep(450)
    MouseClick("right", 15, 234, 1, 0)
    Sleep(450)
    MouseClick("right", 19, 166, 1, 0)
    Sleep(450)
    MouseClick("right", 17, 189, 1, 0)
    Sleep(450)
    MouseClick("right", 14, 220, 1, 0)
    Sleep(450)
    MouseClick("right", 18, 212, 1, 0)
    Sleep(450)
    MouseClick("right", 684, 351, 1, 0)
    Sleep(450)
    MouseClick("left", 509, 287, 1, 0)
EndFunc   ;==>Search0

Func Search1()
    
    Send("{f1}")
    MouseClick("right", 412, 487, 1, 0)
    Sleep(360)
    MouseClick("right", 411, 576, 1, 0)
    Sleep(360)
    MouseClick("right", 789, 523, 1, 0)
    Sleep(360)
    MouseClick("right", 782, 491, 1, 0)
    Sleep(360)
    MouseClick("right", 792, 529, 1, 0)
    Sleep(360)
    MouseClick("right", 778, 378, 1, 0)
    Sleep(360)
    MouseClick("right", 797, 138, 1, 0)
    Sleep(360)
    MouseClick("right", 801, 175, 1, 0)
    Sleep(360)
    MouseClick("right", 800, 285, 1, 0)
    Sleep(360)
    MouseClick("right", 793, 356, 1, 0)
    Sleep(360)
    MouseClick("right", 795, 323, 1, 0)
    Sleep(360)
    MouseClick("right", 782, 127, 1, 0)
    Sleep(360)
    MouseClick("right", 797, 385, 1, 0)
    Sleep(360)
    MouseClick("right", 791, 428, 1, 0)
    Sleep(360)
    MouseClick("right", 783, 244, 1, 0)
    Sleep(360)
    MouseClick("right", 783, 412, 1, 0)
    Sleep(360)
    MouseClick("right", 775, 315, 1, 0)
    Sleep(360)
    MouseClick("right", 763, 348, 1, 0)
    Sleep(360)
    MouseClick("right", 763, 348, 1, 0)
    Sleep(360)
    MouseClick("right", 763, 348, 1, 0)
    Sleep(360)
    MouseClick("right", 763, 348, 1, 0)
    Sleep(360)
    MouseClick("right", 6, 313, 1, 0)
    Sleep(360)
    MouseClick("left", 492, 279, 1, 0)
EndFunc   ;==>Search1

Func Search2()
    
    Send("{f1}")
    MouseClick("right", 126, 533, 1, 0)
    Sleep(360)
    MouseClick("right", 9, 519, 1, 0)
    Sleep(360)
    MouseClick("right", 16, 468, 1, 0)
    Sleep(360)
    MouseClick("right", 22, 522, 1, 0)
    Sleep(360)
    MouseClick("right", 205, 477, 1, 0)
    Sleep(360)
    MouseClick("right", 13, 521, 1, 0)
    Sleep(360)
    MouseClick("right", 12, 493, 1, 0)
    Sleep(360)
    MouseClick("right", 17, 503, 1, 0)
    Sleep(360)
    MouseClick("right", 10, 413, 1, 0)
    Sleep(360)
    MouseClick("right", 5, 93, 1, 0)
    Sleep(360)
    MouseClick("right", 6, 212, 1, 0)
    Sleep(360)
    MouseClick("right", 36, 476, 1, 0)
    Sleep(360)
    MouseClick("right", 14, 392, 1, 0)
    Sleep(360)
    MouseClick("right", 139, 254, 1, 0)
    Sleep(360)
    MouseClick("right", 46, 348, 1, 0)
    Sleep(360)
    MouseClick("right", 23, 234, 1, 0)
    Sleep(360)
    MouseClick("right", 23, 234, 1, 0)
    Sleep(360)
    MouseClick("right", 23, 234, 1, 0)
    Sleep(360)
    MouseClick("right", 23, 234, 1, 0)
    Sleep(360)
    MouseClick("right", 655, 379, 1, 0)
    Sleep(360)
    MouseClick("left", 471, 248, 1, 0)
EndFunc   ;==>Search2

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

@XAV - I LOATHE repetitive code, how do you even know what all of these mouse clicks are without comments?????

Use some arrays man!

Func Search1()

Send("{f1}")

MouseClick("right", 412, 487, 1, 0)

Local $array[21][2] [[411, 576],[789, 523],[782, 491],[792, 529],[778, 378],[797, 138],[801, 175],[800, 285],[793, 356],[795, 323],[782, 127],[797, 385],[791, 428],[783, 244],[783, 412],[775, 315],[763, 348],[763, 348],[763, 348],[763, 348],[6, 313]]

For $X = 0 to Ubound($array) -1

Sleep(360)

MouseClick("right", $array[$X][0],$array[$X][1], 1, 0)

Next

Sleep(360)

MouseClick("left", 492, 279, 1, 0)

EndFunc ;==>Search1

Share this post


Link to post
Share on other sites

Thanks ...

Share this post


Link to post
Share on other sites

Ehhh this is only working if i run 1 per 1 :S :)

Share this post


Link to post
Share on other sites

up

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

You would get help faster if you explained what the problem is in a way that other "humans" can understand :)

i dont know the probleme i run 1 per 1 and its working but If i run the 3 it's not working ....

i tryd en fix but it bugged idk why it should work , its good colors. when i open the script it don't do anything but if i run the Script [only Search(1)] It's working

Edited by Xav

Share this post


Link to post
Share on other sites

You should at least be able to tell WHERE the problem is and not just

"i dont know something is wrong plz anybody fix this for me i dont want to strain"

Share this post


Link to post
Share on other sites

up

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