Jump to content

Array error


Recommended Posts

  • Replies 55
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

$i=0
While $i=0
    
    $minicord=PixelSearch(770,132,857,220,0xA58629,5,3)
        If Not @error Then
            MouseClick("left",$minicord[0],$minicord[1],1,1)
            Sleep(100)
        EndIf
                If @error Then
                    $travelx=Random(770,857,1)
                    $travely=Random(132,220,1)
                        MouseClick("left",$travelx,$travely,1,1)
                    $travel2x=Random(143,878,1)
                    $travel2y=Random(113,669,1)
                        Mouseclick("left",$travel2x,$travel2y,1,1)
                EndIf
        If Not @error Then
            $timer=TimerInit()
            $cord=PixelSearch(133,103,888,656,0xA58A29,10,10)
                MouseClick("left",$cord[0],$cord[1],1,1)
                Sleep(12000)
        Endif
            If $timer >= 15000  Then
                    $travelx=Random(770,857,1)
                    $travely=Random(132,220,1)
                        MouseClick("left",$travelx,$travely,1,1)
                    $travel2x=Random(143,878,1)
                    $travel2y=Random(113,669,1)
                        Mouseclick("left",$travel2x,$travel2y,1,1)
            EndIf
WEnd

CHRIST ON A BIKE !!!

Wheres the error checking pal ??

Donr make me open this bottle of whishey :(

o my gosh,,, i dont no wat this error cking is quite yet just look at this Edited by DarkDragon
Link to comment
Share on other sites

John i think i figured out just now wat u meant u wanted me to put the pixel chk b4 the loop problem being i dont want that pixel chk to happen unless there is no error from the 1st pixel check... hope u understand

Edited by DarkDragon
Link to comment
Share on other sites

John i think i figured out just now wat u meant u wanted me to put the pixel chk b4 the loop problem being i dont want that pixel chk to happen unless there is no error from the 1st pixel check... hope u understand

wait.. would it change anything if it were out or in
Link to comment
Share on other sites

John i think i figured out just now wat u meant u wanted me to put the pixel chk b4 the loop problem being i dont want that pixel chk to happen unless there is no error from the 1st pixel check... hope u understand

No he means that you need to check for error after EVERY PixelSearch!
Link to comment
Share on other sites

$i=0
While $i=0
    
    $minicord=PixelSearch(770,132,857,220,0xA58629,5,3)
        If Not @error Then
            MouseClick("left",$minicord[0],$minicord[1],1,1)
            Sleep(100)
        EndIf
                If @error Then
                    $travelx=Random(770,857,1)
                    $travely=Random(132,220,1)
                        MouseClick("left",$travelx,$travely,1,1)
                    $travel2x=Random(143,878,1)
                    $travel2y=Random(113,669,1)
                        Mouseclick("left",$travel2x,$travel2y,1,1)
                EndIf
        If Not @error Then
            $timer=TimerInit()
            $cord=PixelSearch(133,103,888,656,0xA58A29,10,10)
                MouseClick("left",$cord[0],$cord[1],1,1)
                Sleep(12000)
        Endif
            If $timer >= 15000  Then
                    $travelx=Random(770,857,1)
                    $travely=Random(132,220,1)
                        MouseClick("left",$travelx,$travely,1,1)
                    $travel2x=Random(143,878,1)
                    $travel2y=Random(113,669,1)
                        Mouseclick("left",$travel2x,$travel2y,1,1)
            EndIf
WEnd

o my gosh,,, i dont no wat this error cking is quite yet just look at this

Posted Image Edited by JohnOne

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

If Not @error Then
            $timer=TimerInit()
            $cord=PixelSearch(133,103,888,656,0xA58A29,10,10)
            If Not @error Then
                MouseClick("left",$cord[0],$cord[1],1,1)
                Sleep(12000)
            Endif
EndIf

Im sorry but I cand do any better than that, and I think the tags will mess this up.

Also, in your code, remember that @error is only valid immedietly adfter the function.

so after you have caught it and tell it what to do, if another function is used then your first one has gone.

Edited by JohnOne

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

If Not @error Then
            $timer=TimerInit()
            $cord=PixelSearch(133,103,888,656,0xA58A29,10,10)
            If Not @error Then
                MouseClick("left",$cord[0],$cord[1],1,1)
                Sleep(12000)
            Endif
EndIf

Im sorry but I cand do any better than that, and I think the tags will mess this up.

Also, in your code, remember that @error is only valid immedietly adfter the function.

so after you have caught it and tell it what to do, if another function is used then your first one has gone.

OHHHHHHH......... that just cleared up alot of things thanks, ill do some fixes and if i still have problems ill post in this thread :(
Link to comment
Share on other sites

well i looked over all the @error(s) i dont think they should collid, but now it says : ==> "Wend" statement with no matching "While" statement.:

WEnd

which doesnt make any since i have a while statement at the top...

nvm its fixed all i gotta do is do al little fixing in the program and ill be done thanks guys
Link to comment
Share on other sites

When I pasted the code into scite, the endif was closing the while. like as though it isnt nested snuggly.

Just go right back through it and make sure of your is and endifs, and whiles and while nots.

Basically just ticy it up, at the moment it looks like a burst mattress.

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

When I pasted the code into scite, the endif was closing the while. like as though it isnt nested snuggly.

Just go right back through it and make sure of your is and endifs, and whiles and while nots.

Basically just ticy it up, at the moment it looks like a burst mattress.

lol wat ever that means i just need to make a few changes b/c the program isnt working exactly how i want it too but the good thing is all the techy bugs are out :(
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...