Jump to content

How to know that script compltete its work..


Recommended Posts

Hi,

My query how to identify that script is over or complete its work. Visually i can see that work is over... but i just want add one message box or label to the script that will show message FINISHED... As under one script i am using more than one Stages of calculations.. These stages are dependent to one another & one loop could end at any stage...

So i have no clue that script is over or not... or you can say that i have no way to display message that script finished its work...

Any idea.. Please help...

Link to comment
Share on other sites

.matt 's "31337" solution results to an error :D

The right coding would be:

MsgBox(0, "This is a title", "This is the text you want")

or use a sound:

SoundPlay(@WindowsDir & "\media\ding.wav",1)

Both explained in AutoIt's help file (Look for them under the Index tab)

Link to comment
Share on other sites

Add this to the end

MsgBox ( 1, "MY 31337 ScripT is Teh FiNiSHzorzz")
At what End...

My script is something like this

Do

Some logic

_a()

Until this = this

Func _a()

--------------------------

--------------------

Logic---

IF something true then

_b()

Else

Exitloop

End Func

Func _b()

--------------------------

--------------------

Logic---

IF something true then

_c()

Else

Exitloop

End Func

Func _c()

--------------------------

--------------------

Logic---

IF something true then

---Some function

Else

Exitloop

End Func

In script like this where to to put this... as logic could ens at any Finction like A, B & C... depends upon conditions & loop will processed again & again UNTIL statments comes true... and when statement comes true this will process functions too..

I hope its clear now

Link to comment
Share on other sites

At what End...

:D Each function ends somewhere. Wherever you want a message that one stage is finished, you can either put it at the end of the function (one line *before* EndFunc) or after you call the function(one line *after* the call)

You kind of answered that yourself:

but i just want add one message box or label to the script that will show message FINISHED...

Edited by forger
Link to comment
Share on other sites

:D Each function ends somewhere. Wherever you want a message that one stage is finished, you can either put it at the end of the function (one line *before* EndFunc) or after you call the function(one line *after* the call)

You kind of answered that yourself:

Script is working for 30 -40 min depends upon data... Its easy to display message after completion of every function... but i dont want to display message after every function... i want to display only final message..

For example script is calculation some values depending upon one initial vale to final vale ... Initially values ranges form 10 to 100.. or more ... so for each vale all functions are called... i mean form fist to last value all functions are repeated until last vale....

So i want to display message only after last vale got processed ...

Link to comment
Share on other sites

Final("57")
Func Final($value)
If $value >= 10 and $value <= 100 then
Msgbox(0,"Script","Script is Done")
Else
Return
Endif
EndFunc

just send the function with the number variable and yeah tuh duh

if the value is greater then or equal to 10 and less then or equal to 100 then it will display the message

Edited by thatsgreat2345
Link to comment
Share on other sites

Do

Some logic

_a()

Until this = this

;;;;;

final msgbox goes here

;;;;;

Func _a()

--------------------------

--------------------

Logic---

IF something true then

_b()

Else

Exitloop

End Func

<snipped>

You showed no exits inside any of the functions - the psuedo code mentioned will either loop forever or "end" after the until. It is only code - just try the msgbox there.

Turn on TrayIconDebug and use traytips inside each function to debug,,,

[size="1"][font="Arial"].[u].[/u][/font][/size]

Link to comment
Share on other sites

If you want a message box to appear when you exit, just write a function named OnAutoItExit with a msgbox in it and you're good to go. Alternately, paste a msgbox code before every 'exit' command and at the last line.

My query how to identify that script is over or complete its work.

From what i understand is you're trying to make 2 scripts interact? For that i would suggest RegWrite and RegRead.

[edit] Typo

Edited by Manadar
Link to comment
Share on other sites

I recommend not to mess with the registry... better keep him out of it before he hurts himself...

Try out StdinWrite, StdoutRead, ConsoleWrite and ConsoleRead

#)

edit: also IniRead & IniWrite

Edited by nfwu
Link to comment
Share on other sites

Do

Some logic

_a()

Until this = this

;;;;;

final msgbox goes here

;;;;;

Func _a()

--------------------------

--------------------

Logic---

IF something true then

_b()

Else

Exitloop

End Func

<snipped>

You showed no exits inside any of the functions - the psuedo code mentioned will either loop forever or "end" after the until. It is only code - just try the msgbox there.

Turn on TrayIconDebug and use traytips inside each function to debug,,,

This option is working fine... Thx

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...