Sign in to follow this  
Followers 0
MarcoCastro

Condition in While

4 posts in this topic

#1 ·  Posted (edited)

Hi Champs, In My Script I Need In The Part With ****************** (End Of Condition)... The Code Doesn't Finish, But That It Begins Again. ...... I Try But I Can't....

THANKS...

; Script para Packouts automaticos

Opt("WinWaitDelay",100)

Opt("WinTitleMatchMode",4)

Opt("WinDetectHiddenText",1)

Opt("MouseCoordMode",0)

;copia orden

WinWait("Microsoft Excel - 1","Worksheet Menu Bar")

If Not WinActive("Microsoft Excel - 1","Worksheet Menu Bar") Then WinActivate("Microsoft Excel - 1","Worksheet Menu Bar")

WinWaitActive("Microsoft Excel - 1","Worksheet Menu Bar")

Send("{CTRLDOWN}c{CTRLUP}")

If ClipGet() = @CRLF Then Exit MsgBox(4096, "Autimatico", "Work Over", 5000000)

;pega pa hace F9

WinWait("Wmsp.rsf:1 - WRQ Reflection - IBM 5250 Terminal","Standard")

If Not WinActive("Wmsp.rsf:1 - WRQ Reflection - IBM 5250 Terminal","Standard") Then WinActivate("Wmsp.rsf:1 - WRQ Reflection - IBM 5250 Terminal","Standard")

WinWaitActive("Wmsp.rsf:1 - WRQ Reflection - IBM 5250 Terminal","Standard")

Do

Sleep(50)

Until PixelChecksum(49,107,205,219) = 796576793

Sleep(50)

Send("{CTRLDOWN}v{CTRLUP}{ENTER}")

Do

Sleep(50)

Until PixelChecksum(121,910,207,949) = 2022966779

Sleep(50)

Send("{F9}")

Do

Sleep(50)

Until PixelChecksum(121,910,207,949) = 2022966779

Sleep(50)

;pega pal packout

WinWait("Wmsp.rsf:2 - WRQ Reflection - IBM 5250 Terminal","Standard")

If Not WinActive("Wmsp.rsf:2 - WRQ Reflection - IBM 5250 Terminal","Standard") Then WinActivate("Wmsp.rsf:2 - WRQ Reflection - IBM 5250 Terminal","Standard")

WinWaitActive("Wmsp.rsf:2 - WRQ Reflection - IBM 5250 Terminal","Standard")

Do

Sleep(50)

Until PixelChecksum(49,107,205,219) = 796576793

Sleep(50)

Send("{CTRLDOWN}v{CTRLUP}{ENTER}")

Do

Sleep(50)

Until PixelChecksum(121,910,207,949) = 2022966779

Sleep(50)

Send("{F6}")

Do

Sleep(50)

Until PixelChecksum(121,910,207,949) = 2022966779

Sleep(50)

Send("{F6}")

Do

Sleep(50)

Until PixelChecksum(121,910,207,949) = 2022966779

Sleep(50)

Send("{ENTER}")

Do

Sleep(50)

Until PixelChecksum(121,910,207,949) = 2022966779

Sleep(50)

Send("{UP}{UP}{UP}{UP}{SHIFTDOWN}{RIGHT}{RIGHT}{RIGHT}{RIGHT}{RIGHT}{RIGHT}{RIGHT}{RIGHT}{RIGHT}{RIGH

T}{RIGHT}{RIGHT}{RIGHT}{RIGHT}{RIGHT}{RIGHT}{RIGHT}{RIGHT}{RIGHT}{RIGHT}{SHIFTUP}{CTRLDOWN}c{CTRLUP}

{TAB}{TAB}{CTRLDOWN}v{CTRLUP}{ENTER}")

Do

Sleep(50)

Until PixelChecksum(121,910,207,949) = 2022966779

Sleep(50)

;condicionante de si termino

while 1

If PixelChecksum(51,362,911,684) = 3149463553 then

WinWait("Wmsp.rsf:1 - WRQ Reflection - IBM 5250 Terminal","Standard")

If Not WinActive("Wmsp.rsf:1 - WRQ Reflection - IBM 5250 Terminal","Standard") Then WinActivate("Wmsp.rsf:1 - WRQ Reflection - IBM 5250 Terminal","Standard")

WinWaitActive("Wmsp.rsf:1 - WRQ Reflection - IBM 5250 Terminal","Standard")

Send("{F3}")

Do

Sleep(50)

Until PixelChecksum(121,910,207,949) = 2022966779

Sleep(50)

send("{F3}")

Do

Sleep(50)

Until PixelChecksum(121,910,207,949) = 2022966779

Sleep(50)

WinWait("Wmsp.rsf:2 - WRQ Reflection - IBM 5250 Terminal","Standard")

If Not WinActive("Wmsp.rsf:2 - WRQ Reflection - IBM 5250 Terminal","Standard") Then WinActivate("Wmsp.rsf:2 - WRQ Reflection - IBM 5250 Terminal","Standard")

WinWaitActive("Wmsp.rsf:2 - WRQ Reflection - IBM 5250 Terminal","Standard")

Send("{F10}")

Do

Sleep(50)

Until PixelChecksum(121,910,207,949) = 2022966779

Sleep(50)

send("{F3}")

WinWait("Microsoft Excel - 1","Worksheet Menu Bar")

If Not WinActive("Microsoft Excel - 1","Worksheet Menu Bar") Then WinActivate("Microsoft Excel - 1","Worksheet Menu Bar")

WinWaitActive("Microsoft Excel - 1","Worksheet Menu Bar")

Send("{DOWN}")

exit

Endif

************************************* H E R E

;copia sku

WinWait("Wmsp.rsf:1 - WRQ Reflection - IBM 5250 Terminal","Standard")

If Not WinActive("Wmsp.rsf:1 - WRQ Reflection - IBM 5250 Terminal","Standard") Then WinActivate("Wmsp.rsf:1 - WRQ Reflection - IBM 5250 Terminal","Standard")

WinWaitActive("Wmsp.rsf:1 - WRQ Reflection - IBM 5250 Terminal","Standard")

Send("{DOWN}{SHIFTDOWN}{RIGHT}{RIGHT}{RIGHT}{RIGHT}{RIGHT}{RIGHT}{RIGHT}{RIGHT}{RIGHT}{RIGHT}{RIGHT}{

RIGHT}{RIGHT}{RIGHT}{RIGHT}{RIGHT}{RIGHT}{RIGHT}{RIGHT}{RIGHT}{SHIFTUP}{CTRLDOWN}c{CTRLUP}")

; pega sku

WinWait("Wmsp.rsf:2 - WRQ Reflection - IBM 5250 Terminal","Standard")

If Not WinActive("Wmsp.rsf:2 - WRQ Reflection - IBM 5250 Terminal","Standard") Then WinActivate("Wmsp.rsf:2 - WRQ Reflection - IBM 5250 Terminal","Standard")

WinWaitActive("Wmsp.rsf:2 - WRQ Reflection - IBM 5250 Terminal","Standard")

Send("{CTRLDOWN}v{CTRLUP}{TAB}")

;copia qty

WinWait("Wmsp.rsf:1 - WRQ Reflection - IBM 5250 Terminal","Standard")

If Not WinActive("Wmsp.rsf:1 - WRQ Reflection - IBM 5250 Terminal","Standard") Then WinActivate("Wmsp.rsf:1 - WRQ Reflection - IBM 5250 Terminal","Standard")

WinWaitActive("Wmsp.rsf:1 - WRQ Reflection - IBM 5250 Terminal","Standard")

Send("{RIGHT}{RIGHT}{RIGHT}{RIGHT}{RIGHT}{RIGHT}{RIGHT}{RIGHT}{RIGHT}{RIGHT}{RIGHT}{RIGHT}{RIGHT}{RIG

HT}{RIGHT}{RIGHT}{RIGHT}{RIGHT}{RIGHT}{RIGHT}{RIGHT}{RIGHT}{RIGHT}{SHIFTDOWN}{RIGHT}{RIGHT}{RIGHT}{R

IGHT}{RIGHT}{RIGHT}{SHIFTUP}{CTRLDOWN}c{CTRLUP}")

; pega Qty

WinWait("Wmsp.rsf:2 - WRQ Reflection - IBM 5250 Terminal","Standard")

If Not WinActive("Wmsp.rsf:2 - WRQ Reflection - IBM 5250 Terminal","Standard") Then WinActivate("Wmsp.rsf:2 - WRQ Reflection - IBM 5250 Terminal","Standard")

WinWaitActive("Wmsp.rsf:2 - WRQ Reflection - IBM 5250 Terminal","Standard")

Send("{CTRLDOWN}v{CTRLUP}{ENTER}")

Do

Sleep(50)

Until PixelChecksum(121,910,207,949) = 2022966779

Sleep(50)

WinWait("Wmsp.rsf:1 - WRQ Reflection - IBM 5250 Terminal","Standard")

If Not WinActive("Wmsp.rsf:1 - WRQ Reflection - IBM 5250 Terminal","Standard") Then WinActivate("Wmsp.rsf:1 - WRQ Reflection - IBM 5250 Terminal","Standard")

WinWaitActive("Wmsp.rsf:1 - WRQ Reflection - IBM 5250 Terminal","Standard")

Send("{F3}")

Do

Sleep(50)

Until PixelChecksum(121,910,207,949) = 2022966779

Sleep(50)

Send("{F9}")

Do

Sleep(50)

Until PixelChecksum(121,910,207,949) = 2022966779

Sleep(50)

Wend

End

Edited by MarcoCastro

Share this post


Link to post
Share on other sites



Please guys, is really important..

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Just some guidance for a better success rate on questions:

1. Post something simple that shows your issue and can be run/tested by others.

2. Be clear about what you want or what your real issue is ..

If you want to exit a while - wend loop just use ExitLoop ... (but not sure if that is what you are lookig for ..

:)

Edited by JdeB

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

I think you're looking for ContinueLoop. I didn't even glance at all that code though :)


IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font]

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