Sign in to follow this  
Followers 0
MarcoCastro

Go to the begin the script..

6 posts in this topic

hi, i have the same problem yet.

start

code......

.........

........

IF PixelChecksum(78,422,306,499) = 1104243226 THEN

Send("{F3}{UP}{RIGHT}{RIGHT}{RIGHT}")

WinWait("Microsoft Excel - Carga paleatizado a Tls.xls","Barra de menús de la")

If Not WinActive("Microsoft Excel - Carga paleatizado a Tls.xls","Barra de menús de la") Then WinActivate("Microsoft Excel - Carga paleatizado a Tls.xls","Barra de menús de la")

WinWaitActive("Microsoft Excel - Carga paleatizado a Tls.xls","Barra de menús de la")

Send("{DOWN}{LEFT}{LEFT}{ESC}")

**** in this part i need to go to the beginning of the script ...

................

...................

Please help...

Share this post


Link to post
Share on other sites



Hi,

see help file. Loops like while wend for next and so on.

So long,

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

Try

Do
IF PixelChecksum(78,422,306,499) = 1104243226 THEN
Send("{F3}{UP}{RIGHT 3}")
WinWait("Microsoft Excel - Carga paleatizado a Tls.xls","Barra de menús de la")
else
WinActive("Microsoft Excel - Carga paleatizado a Tls.xls","Barra de menús de la")
WinActivate("Microsoft Excel - Carga paleatizado a Tls.xls","Barra de menús de la")
WinWaitActive("Microsoft Excel - Carga paleatizado a Tls.xls","Barra de menús de la")
Send("{DOWN}{LEFT 2}{ESC}")
endif
Until ;;Add something here that says its done with this part

I try but dont work.... please replace in my code.....

that is the code:

For $i= 1 to 500000

Opt("WinWaitDelay",100)

Opt("WinTitleMatchMode",4)

Opt("WinDetectHiddenText",1)

Opt("MouseCoordMode",0)

;Copia el Codigo

WinWait("Microsoft Excel - Carga paleatizado a Tls.xls","Barra de menús de la")

If Not WinActive("Microsoft Excel - Carga paleatizado a Tls.xls","Barra de menús de la") Then WinActivate("Microsoft Excel - Carga paleatizado a Tls.xls","Barra de menús de la")

WinWaitActive("Microsoft Excel - Carga paleatizado a Tls.xls","Barra de menús de la")

Send("{CTRLDOWN}c{CTRLUP}{ALTDOWN}{TAB}{ALTUP}")

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

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

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

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

;esperar la ventana del menu 9-1, Y PEGAR CODIGO

Do

Sleep(50)

Until PixelChecksum(37,88,135,132) = 1885248931

Send("{CTRLDOWN}v{CTRLUP}{SPACE}{SPACE}{SPACE}{SPACE}{SPACE}{SPACE}{SPACE}{SPACE}{ENTER}{DOWN}{LEFT}{

LEFT}{LEFT}10{ENTER}")

;COPIAR PR POR MC

WinWait("Microsoft Excel - Carga paleatizado a Tls.xls","Barra de menús de la")

If Not WinActive("Microsoft Excel - Carga paleatizado a Tls.xls","Barra de menús de la") Then WinActivate("Microsoft Excel - Carga paleatizado a Tls.xls","Barra de menús de la")

WinWaitActive("Microsoft Excel - Carga paleatizado a Tls.xls","Barra de menús de la")

Send("{RIGHT}{RIGHT}{CTRLDOWN}c{CTRLUP}{ALTDOWN}{TAB}{ALTUP}")

;ESPERAR LA VENTANA DE CONFIGURACION DE PALEATIZADO Y PEGAR PR POR MC

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

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

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

Do

Sleep(50)

Until PixelChecksum(37,88,135,132) = 2460458021

IF PixelChecksum(78,422,306,499) = 1104243226 THEN

Send("{F3}{UP}{RIGHT}{RIGHT}{RIGHT}")

WinWait("Microsoft Excel - Carga paleatizado a Tls.xls","Barra de menús de la")

If Not WinActive("Microsoft Excel - Carga paleatizado a Tls.xls","Barra de menús de la") Then WinActivate("Microsoft Excel - Carga paleatizado a Tls.xls","Barra de menús de la")

WinWaitActive("Microsoft Excel - Carga paleatizado a Tls.xls","Barra de menús de la")

Send("{DOWN}{LEFT}{LEFT}{ESC}")

EXIT --> here i need replace exit for for some command that repeats the script from the beginning again. . .

Endif

Send("{TAB}{TAB}WMC{TAB}{CTRLDOWN}v{CTRLUP}{TAB}PR{TAB}{TAB}PL{TAB}{ALTDOWN}{TAB}{ALTUP}")

;COPIAR Mc por Pallet

WinWait("Microsoft Excel - Carga paleatizado a Tls.xls","Barra de menús de la")

If Not WinActive("Microsoft Excel - Carga paleatizado a Tls.xls","Barra de menús de la") Then WinActivate("Microsoft Excel - Carga paleatizado a Tls.xls","Barra de menús de la")

WinWaitActive("Microsoft Excel - Carga paleatizado a Tls.xls","Barra de menús de la")

Send("{RIGHT}{CTRLDOWN}c{CTRLUP}{ALTDOWN}{TAB}{ALTUP}")

; PEGAR Mc por Pallet

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

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

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

Send("{CTRLDOWN}v{CTRLUP}{TAB}mc{TAB}{ENTER}{ALTDOWN}{TAB}{ALTUP}")

; COPIAR BASE

WinWait("Microsoft Excel - Carga paleatizado a Tls.xls","Barra de menús de la")

If Not WinActive("Microsoft Excel - Carga paleatizado a Tls.xls","Barra de menús de la") Then WinActivate("Microsoft Excel - Carga paleatizado a Tls.xls","Barra de menús de la")

WinWaitActive("Microsoft Excel - Carga paleatizado a Tls.xls","Barra de menús de la")

Send("{RIGHT}{CTRLDOWN}c{CTRLUP}{ALTDOWN}{TAB}{ALTUP}")

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

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

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

;ESPERAR CAMBIO DE PANTALLA A VENTANA TIE & tIER

Do

Sleep(50)

Until PixelChecksum(92,154,641,251) = 3763317481

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

;COPIA ALTURA

WinWait("Microsoft Excel - Carga paleatizado a Tls.xls","Barra de menús de la")

If Not WinActive("Microsoft Excel - Carga paleatizado a Tls.xls","Barra de menús de la") Then WinActivate("Microsoft Excel - Carga paleatizado a Tls.xls","Barra de menús de la")

WinWaitActive("Microsoft Excel - Carga paleatizado a Tls.xls","Barra de menús de la")

Send("{RIGHT}{CTRLDOWN}c{CTRLUP}{ALTDOWN}{TAB}{ALTUP}")

;PEGA ALTURA

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

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

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

Send("{CTRLDOWN}v{CTRLUP}{TAB}{ENTER}{F3}{UP}{RIGHT}{RIGHT}{RIGHT}{ALTDOWN}{TAB}{ALTUP}")

WinWait("Microsoft Excel - Carga paleatizado a Tls.xls","Barra de menús de la")

If Not WinActive("Microsoft Excel - Carga paleatizado a Tls.xls","Barra de menús de la") Then WinActivate("Microsoft Excel - Carga paleatizado a Tls.xls","Barra de menús de la")

WinWaitActive("Microsoft Excel - Carga paleatizado a Tls.xls","Barra de menús de la")

Send("{DOWN}{LEFT}{LEFT}{LEFT}{LEFT}{LEFT}{ESC}")

Next

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

I try but dont work.... please replace in my code.....

The point of a loop is to repeat blocks of code. This loop will go on until you set $bContinue to False
dim $bContinue = True
while $bContinue
  ... do some things
  ... check to see if we should exit the loop, if so then
      $bContinue = false
  ... maybe do some more things
wend

The "$bContinue" determines whether AutoIt should continue looping or not.

So, for you, two questions:

1) How do you know when you need to go back to the beginning of the script?

2) If you keep going back to the beginning, when do you continue on instead?

This will help us to help you determine what kind of code you need.

EDIT: Just noticed that your full code is already executing inside a FOR loop. So maybe all you need is a ContinueLoop statement at the point you indicate? This will take you onto the enxt iteration of your FOR loop - at the beginning of the script.

Edited by MisterBates

Share this post


Link to post
Share on other sites

The point of a loop is to repeat blocks of code. This loop will go on until you set $bContinue to False

dim $bContinue = True
while $bContinue
  ... do some things
  ... check to see if we should exit the loop, if so then
      $bContinue = false
  ... maybe do some more things
wend

The "$bContinue" determines whether AutoIt should continue looping or not.

So, for you, two questions:

1) How do you know when you need to go back to the beginning of the script?

2) If you keep going back to the beginning, when do you continue on instead?

This will help us to help you determine what kind of code you need.

EDIT: Just noticed that your full code is already executing inside a FOR loop. So maybe all you need is a ContinueLoop statement at the point you indicate? This will take you onto the enxt iteration of your FOR loop - at the beginning of the script.

1) when, IF PixelChecksum(78,422,306,499) = 1104243226 , but before it should execute this sequence. . .

Send("{F3}{UP}{RIGHT}{RIGHT}{RIGHT}")

WinWait("Microsoft Excel - Carga paleatizado a Tls.xls","Barra de menús de la")

If Not WinActive("Microsoft Excel - Carga paleatizado a Tls.xls","Barra de menús de la") Then WinActivate("Microsoft Excel - Carga paleatizado a Tls.xls","Barra de menús de la")

WinWaitActive("Microsoft Excel - Carga paleatizado a Tls.xls","Barra de menús de la")

Send("{DOWN}{LEFT}{LEFT}{ESC}")

; Go to the first line of the script....

Endif

2) This sequence only works when the condition is IF PixelChecksum(78,422,306,499) = 1104243226. If the condition is not real continuous the loop without considering the sequence inside the If,Endif in the number 1.

Share this post


Link to post
Share on other sites

1) when, IF PixelChecksum(78,422,306,499) = 1104243226 , but before it should execute this sequence. . .

Send("{F3}{UP}{RIGHT}{RIGHT}{RIGHT}")

WinWait("Microsoft Excel - Carga paleatizado a Tls.xls","Barra de menús de la")

If Not WinActive("Microsoft Excel - Carga paleatizado a Tls.xls","Barra de menús de la") Then WinActivate("Microsoft Excel - Carga paleatizado a Tls.xls","Barra de menús de la")

WinWaitActive("Microsoft Excel - Carga paleatizado a Tls.xls","Barra de menús de la")

Send("{DOWN}{LEFT}{LEFT}{ESC}")

; Go to the first line of the script....

Endif

2) This sequence only works when the condition is IF PixelChecksum(78,422,306,499) = 1104243226. If the condition is not real continuous the loop without considering the sequence inside the If,Endif in the number 1.

Your code is all inside a single For/Next loop. Try putting "ContinueLoop" at the point you need to go to the first line of the script.

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