Sign in to follow this  
Followers 0
evilelf

I dont Understand why

6 posts in this topic

#1 ·  Posted (edited)

Hello I am trying to understand why this will not work.

Now when i run this the first time it has no problems but when it starts over it never does this code.

Yes there is more scrip but i cant show :)

why would this be?

While $NW = 0
Send("{A Down}")
Sleep(50)
Send("{A Up}")
Sleep(20)
PixelSearch(728,14,748,30,0xD5D0AE)

If Not @error Then
    $NW = 1
    Send("X")
    Sleep(1000)
    Send("{A Down}")
    Sleep(30)
    Send("{A Up}")
EndIf
WEnd
Edited by evilelf

Share this post


Link to post
Share on other sites



Are you setting $NW back to 0 (zero) before attempting the loop again? If not if won't run because $NW already equals 1.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

well i dont think i did this.

Tell me this what would i look up in the

"AutoIt Help File"

or tell me a little about this.

PS; Thanks

Edited by evilelf

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

This Works people can look below if you did not know.

;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;; $Names;;;;;;;;;
$NW = 0
$Rerun = 1

While $Rerun = 1

While $NW = 0
Send("{A Down}")
Sleep(50)
Send("{A Up}")
Sleep(20)
PixelSearch(728,14,748,30,0xD5D0AE)

; Some Code



$NW = 0
WEnd
WEnd
Edited by evilelf

Share this post


Link to post
Share on other sites

Do i put

If that is the only place your using $NW then you could just do this.

While 1
    Send("{A Down}")
    Sleep(50)
    Send("{A Up}")
    Sleep(20)
    PixelSearch(728, 14, 748, 30, 0xD5D0AE)

    If Not @error Then
        Send("X")
        Sleep(1000)
        Send("{A Down}")
        Sleep(30)
        Send("{A Up}")
        ExitLoop
    EndIf
WEnd

Share this post


Link to post
Share on other sites

This Works people can look below if you did not know.

;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;; $Names;;;;;;;;;
$NW = 0
$Rerun = 1

While $Rerun = 1

While $NW = 0
Send("{A Down}")
Sleep(50)
Send("{A Up}")
Sleep(20)
PixelSearch(728,14,748,30,0xD5D0AE)

; Some Code
$NW = 0
WEnd
WEnd

This works just fine for me.


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