Harmor
Joined: 06 Nov 2005 Posts: 183
|
Posted: Fri Jan 18, 2008 2:25 pm Post subject: New Command Request: LoopUntil |
|
|
Perhaps there's a better way to do this, but I would like to Loop until a key is pressed or condition is occurs.
LoopUntil [,Expr] [,Count]
After before and after each line in the loop the Expr is checked. If it is true then the next line of the loop continues, otherwise the loop breaks.
Example:
| Code: | Loop
{
if(x=5)
break;
MouseClick, left, 222, 333
if(x=5)
break;
Sleep 200
if(x=5)
break;
MouseClick, left, 444, 555
if(x=5)
break;
Sleep 200
}
LoopUntil Example of above:
LoopUntil, x=5
{
MouseClick, left, 222, 333
Sleep 200
MouseClick, left, 444, 555
Sleep 200
} |
Again, perhaps theres another way to do this, but I haven't found a way.
Thanks. _________________ //TODO: Create kewl sig... |
|
Titan
Joined: 11 Aug 2004 Posts: 5026 Location: imaginationland
|
Posted: Fri Jan 18, 2008 4:38 pm Post subject: |
|
|
| AutoHotkey Planned Features wrote: | | New syntax: 1) While-loops and Do-Loops (to improve script readability and maintainability); 2) A simple select/switch/case structure as an alternative to a series of ""else if"" statements. |
_________________
RegExReplace("irc.freenode.net/autohotkey", "^(?=(.(?=[\0-r\[]*((?<=\.).))))(?:[c-\x73]{2,8}(\S))+((2)|\b[^\2-]){2}\D++$", "$u3$1$3$4$2") |
|