| View previous topic :: View next topic |
| Author |
Message |
iguru42
Joined: 02 Sep 2008 Posts: 26
|
Posted: Wed Sep 16, 2009 1:10 pm Post subject: Create my own functions and call them from inside a script. |
|
|
Not sure I'm using the correct terminology there but here's what I'd like to do.
I have this script, it works great, but I have this loop in it that I use to pause the script while it's executing.
This is sprinkled all over my script:
| Code: | Loop
{
Sleep, 1000
If A_Cursor not contains AppStarting,Wait
break
}
|
What I tried to do was make it a function (again not sure if that is the correct terminology) and call it with gosub:
| Code: | script excuting blah blah blah
gosub, pfp
more script excuting blah blah blah
; FUNCTIONS
PFP: ; Pause For Program
Loop
{
Sleep, 1000
If A_Cursor not contains AppStarting,Wait
break
}
|
But when I do that I the more script executing stuff doesn't excute. |
|
| Back to top |
|
 |
Guest
|
Posted: Wed Sep 16, 2009 1:17 pm Post subject: |
|
|
| Code: | script excuting blah blah blah
pfp()
more script excuting blah blah blah
; FUNCTIONS
PFP(){ ; Pause For Program
Loop
{
Sleep, 1000
If A_Cursor not contains AppStarting,Wait
return
}
} |
??? |
|
| Back to top |
|
 |
iguru42
Joined: 02 Sep 2008 Posts: 26
|
Posted: Wed Sep 16, 2009 2:36 pm Post subject: |
|
|
| That works perfectly, thanks! |
|
| Back to top |
|
 |
gargoyle888
Joined: 10 Jan 2009 Posts: 9
|
Posted: Wed Sep 16, 2009 5:51 pm Post subject: |
|
|
| Code: | script excuting blah blah blah
gosub, pfp
more script excuting blah blah blah
; FUNCTIONS
PFP: ; Pause For Program
Loop
{
Sleep, 1000
If A_Cursor not contains AppStarting,Wait
break
}
Return |
|
|
| Back to top |
|
 |
PurloinedHeart
Joined: 04 Apr 2008 Posts: 374 Location: Canada
|
|
| Back to top |
|
 |
|