Jump to content
Sign in to follow this  
TK_Incorperate

help with loop

Recommended Posts

TK_Incorperate

ok, i'm wondering how how i can make an auto-it script loop, but... i want it to stop once i press D..

ok so i looked in the help file, and either i passed it up or it isnt in there, but i know this is possible cuz i have seen scripts that do such things....

ok so say i want a script something like this..... just as an example, say i want something like this to loop throu

Send("{ALT}")
Send("{RCTRL}")
Sleep(1000)

someone told me it'd go something like this

$i = D
Do
Send("{ALT}")
Send("{RCTRL}")
Sleep(1000)
Until Keypress = $i

but im about 99% sure that isnt even close.... can sum1 help me out here?

Share this post


Link to post
Share on other sites
BigDod

ok, i'm wondering how how i can make an auto-it script loop, but... i want it to stop once i press D..

ok so i looked in the help file, and either i passed it up or it isnt in there, but i know this is possible cuz i have seen scripts that do such things....

ok so say i want a script something like this..... just as an example, say i want something like this to loop throu

Send("{ALT}")
Send("{RCTRL}")
Sleep(1000)

someone told me it'd go something like this

$i = D
Do
Send("{ALT}")
Send("{RCTRL}")
Sleep(1000)
Until Keypress = $i

but im about 99% sure that isnt even close.... can sum1 help me out here?

How about

HotKeySet("d", "Terminate")

While 1
    Send("{ALT}")
Send("{RCTRL}")
Sleep(1000)
WEnd

Func Terminate()
    Exit 0
EndFunc


Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post


Link to post
Share on other sites
TK_Incorperate

thank you very much ;) very appreceated

Share this post


Link to post
Share on other sites
jonk

ok, i'm wondering how how i can make an auto-it script loop, but... i want it to stop once i press D..

ok so i looked in the help file, and either i passed it up or it isnt in there, but i know this is possible cuz i have seen scripts that do such things....

ok so say i want a script something like this..... just as an example, say i want something like this to loop throu

Send("{ALT}")
Send("{RCTRL}")
Sleep(1000)

someone told me it'd go something like this

$i = D
Do
Send("{ALT}")
Send("{RCTRL}")
Sleep(1000)
Until Keypress = $i

but im about 99% sure that isnt even close.... can sum1 help me out here?

Hi,

i modified the example out of the helpfile a bit ;)

HotKeySet ( "d" , "_exitScript")

While 1
  Send("{ALT}")
  Send("{RCTRL}")
  Sleep(1000)
WEnd

Func _exitScript()
    exit 0
Endfunc

eh, BigDod was faster than me :P

Edited by jonk

Share this post


Link to post
Share on other sites
TK_Incorperate

thanks guys, but now i got another question.... tell me if this would work lol cuz i aint too sure.....

i wanna know if this would work to use F to pause the script, and un-pause it all in the same.... like say i press F to pause it so i can do something else, press F to start it again, then whenever i'm done D to terminate, would this script work properly for that?

HotKeySet("d", "Terminate")
HotKeySet("f", "Pause")

While 1
    Send("{ALT}")
Send("{RCTRL}")
Sleep(1000)
WEnd

Func Terminate()
    Exit 0
EndFunc

Func Pause()
    $Paused = NOT $Paused
    While $Paused
        sleep(100)
    WEnd
EndFunc

Share this post


Link to post
Share on other sites
TK_Incorperate

ok that didnt work, it gave me an error witch terminated the script.... now i tried this one, and it STILL doesnt work, no error.... but it dont pause (someone told me to do these lol)

HotKeySet("d", "Terminate")

While 1
    Send("{ALT}")
Send("{RCTRL}")
Sleep(1000)
WEnd

Func Terminate()
    Exit 0
EndFunc

HotKeySet("f", "Pause")

While 1
    Sleep(9000)
WEnd

Func Pause()
    $Paused = NOT $Paused
    While $Paused
    Sleep(9000)
    WEnd
EndFunc

Share this post


Link to post
Share on other sites
Skruge

(someone told me to do these lol)

You should listen to the other voices in your head...
HotKeySet("d", "Terminate")
    HotKeySet("f", "Pause")
    dim $Paused = 0
    
    While 1
        TrayTip("State", "Running", 10)
        Send("{ALT}")
        Send("{RCTRL}")
        Sleep(1000)
    WEnd
    
    Func Terminate()
        Exit 0
    EndFunc
    
    Func Pause()
        $Paused = NOT $Paused
        HotKeySet("f", "UnPause")
        TrayTip("State", "Paused", 10)
        While $Paused
            sleep(100)
        WEnd
    EndFunc
    
    Func UnPause()
        $Paused = NOT $Paused
        HotKeySet("f", "Pause")
    EndFunc

Edit: Removed useless comment indicators.

Edited by Skruge

[font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font]

Share this post


Link to post
Share on other sites
TK_Incorperate

thanks worked fine.... after i deleted those ;~ things, lol those were kinda useless... :| lmao

thanks alot tho, very awsome ;) works like a dream hehe, pplz using this will be very pleased wit da new feature

Edited by TK_Incorperate

Share this post


Link to post
Share on other sites
Skruge

thanks worked fine.... after i deleted those ;~ things, lol those were kinda useless... :| lmao

Yeah, for testing, I commented out those Send(...) things. They were kinda useless. ;)

[font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/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  

×