Jump to content
Sign in to follow this  
pezo89

restarting a script

Recommended Posts

pezo89

As the topic title displays,

is there a way to start a script all over, from the top after a script is done,

i have two pixelsearch arrays, and i need it to start all over when the second one is done with it's job

could't find anything in the helpfile ^_^

Share this post


Link to post
Share on other sites
pezo89

Build a loop?

yea,. i have a loop, however i need it to restart on pixelsearch 4

HotKeySet("|", "MyExit")
Sleep("5000")
Sleep("200")
        
While 1


    $Pixel1 = PixelSearch(1222, 94, 1222, 94, 0xFFFFFF); Mining lock target - start mining
    Sleep("100")
    $Pixel2 = PixelSearch(1223, 114, 1223, 114, 0xFFFFFF); Mining lock target - start mining 112
    Sleep("100")
    
    $Pixel4 = PixelSearch(428, 770, 428, 770, 0x0161C3,1); check if can is full, if yes move home;
    Sleep("100")
    


        If Not IsArray($Pixel1) Then
            sleep ("5000")
        Send("{CTRLdown}")
        sleep ("200")
        MouseClick("Left", 1310, 96, 1, 35)
        sleep ("200")
        Send("{CTRLup}")
        
        Sleep(Random(4000, 6000, 1))
        MouseClick("Left", 963, 91, 1, 17)
        sleep ("2000")
        Send("{F1}")
        
    EndIf
    If Not IsArray($Pixel2) Then
        Sleep ("5000")
        
        Send("{CTRLdown}")
        sleep ("200")
        MouseClick("Left", 1316, 114, 1, 35)
        sleep ("200")
        Send("{CTRLup}")
        Sleep(Random(4000, 6000, 1))
        MouseClick("Left", 963, 91, 1, 17)
        sleep ("2000")
        Send("{F2}")
        sleep ("200")
        send ("{F3}")

        
    EndIf
    
    
         If  IsArray($Pixel4) Then
        
        
        MouseClick("right", 571, 541, 1, 22)
        Sleep("900")
        MouseClick("left", 648, 603, 1, 25)
        Sleep(Random(4000, 8000, 1))
        MouseClick("right", 221, 651, 1, 35)
        Sleep(Random(500, 1000, 1))
        MouseClick("Left", 271, 718, 1, 40)
        Sleep("129000")
        sleep ("3000")
        mouseclick ("Left",185, 812, 1, 18)
Sleep(Random(500, 1000, 1))
send ("{CTRLdown}")
Sleep(Random(500, 1000, 1))
send ("{a}")
Sleep(Random(500, 1000, 1))
send ("{CTRLUp}")
Sleep(Random(500,1000,1))
mouseclick ("right", 185, 812, 1, 24)
Sleep(Random(1000,2000,1))
mouseclick ("Left", 257, 825, 1, 32)
Sleep(Random(1000,2000,1))
mouseclick ("Left", 941, 284, 1, 56)
Sleep(Random(1000,2000,1))  

        
    EndIf

WEnd


Func MyExit()
    Exit
EndFunc  ;==>MyExit

Share this post


Link to post
Share on other sites
implite

I am a noob but found out that I can make loops like this

first add this at the top:

$pixelloop = 0

Then make this a function like:

Func Pixel4()
$Pixel4 = PixelSearch(428, 770, 428, 770, 0x0161C3,1); check if can is full, if yes move home;
    Sleep("100")
Endfunc

Put this part where ever you want the loop to start:

$pixelloop = 1
if $pixelloop = 1 then Pixel4()

I hope this helps. Im still trying to learn how to use PixelSearch.

Maybe you can send me a pm or post in my topic on how to use it.

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.