BALA Posted December 12, 2006 Share Posted December 12, 2006 Func Play() For $n = 1 to $click MouseClick("left", $x, $y, 1) Next EndFuncWhen $n = $click I want the For-Next loop to start all over again. How can I do that? [font="Comic Sans MS"]BA-LA[/font]http://ba-la.110mb.comJoin my community, CLICK HEREAlternative links to my site:http://www.ba-la.tkhttp://www.ba-la.co.nrContact me if you would like to help with some of my projects: joeythepirate@gmail.com Link to comment Share on other sites More sharing options...
Valuater Posted December 12, 2006 Share Posted December 12, 2006 Place this above your function While 1 Play() Sleep(10) Wend 8) Link to comment Share on other sites More sharing options...
BALA Posted December 12, 2006 Author Share Posted December 12, 2006 Place this above your functionWhile 1Play()Sleep(10)Wend8)Do I put my function within that While-WEnd? [font="Comic Sans MS"]BA-LA[/font]http://ba-la.110mb.comJoin my community, CLICK HEREAlternative links to my site:http://www.ba-la.tkhttp://www.ba-la.co.nrContact me if you would like to help with some of my projects: joeythepirate@gmail.com Link to comment Share on other sites More sharing options...
Developers Jos Posted December 12, 2006 Developers Share Posted December 12, 2006 Do I put my function within that While-WEnd?What do you think ? SciTE4AutoIt3 Full installer Download page  - Beta files    Read before posting   How to post scriptsource   Forum etiquette Forum Rules  Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
herewasplato Posted December 12, 2006 Share Posted December 12, 2006 Place this above your function... [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
BALA Posted December 12, 2006 Author Share Posted December 12, 2006 (edited) Well I wasn't sure if that was a mistake or something. In addition, how could I have the loop stop when I press a key for example. Edited December 12, 2006 by BALA [font="Comic Sans MS"]BA-LA[/font]http://ba-la.110mb.comJoin my community, CLICK HEREAlternative links to my site:http://www.ba-la.tkhttp://www.ba-la.co.nrContact me if you would like to help with some of my projects: joeythepirate@gmail.com Link to comment Share on other sites More sharing options...
herewasplato Posted December 12, 2006 Share Posted December 12, 2006 Well I wasn't sure if that was a mistake or something. try it - it is pretty safe code - it is not like it said format.... :-)While 1 Play() Sleep(10) WEnd Func Play() For $n = 1 To $click MouseClick("left", $x, $y, 1) Next EndFunc ;==>Play [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
BALA Posted December 12, 2006 Author Share Posted December 12, 2006 (edited) Oh, wait I made a mistake, the function only goes when the F3 key is pressed, so the code is actually:HotKeySet("{F3}", "Play") Func Play() For $n = 1 to $click MouseClick("left", $x, $y, 1) Next EndFuncSo how could I make the For-Next start over when $n = $click? Same way? Edited December 12, 2006 by BALA [font="Comic Sans MS"]BA-LA[/font]http://ba-la.110mb.comJoin my community, CLICK HEREAlternative links to my site:http://www.ba-la.tkhttp://www.ba-la.co.nrContact me if you would like to help with some of my projects: joeythepirate@gmail.com Link to comment Share on other sites More sharing options...
herewasplato Posted December 12, 2006 Share Posted December 12, 2006 Press the F3 key again??? I do not understand your question... [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
BALA Posted December 12, 2006 Author Share Posted December 12, 2006 (edited) When I pressed the F3 key I want the For-Next to continuously loop by itself until another key is pressed. Edited December 12, 2006 by BALA [font="Comic Sans MS"]BA-LA[/font]http://ba-la.110mb.comJoin my community, CLICK HEREAlternative links to my site:http://www.ba-la.tkhttp://www.ba-la.co.nrContact me if you would like to help with some of my projects: joeythepirate@gmail.com Link to comment Share on other sites More sharing options...
herewasplato Posted December 12, 2006 Share Posted December 12, 2006 When I pressed the F3 key I want the For-Next to continuously loop by itself until another key is pressed.; Press Esc to terminate script, Pause/Break to "pause" Global $Paused HotKeySet("{PAUSE}", "TogglePause") HotKeySet("{ESC}", "Terminate") HotKeySet("+!d", "ShowMessage") ;Shift-Alt-d ;;;; Body of program would go here ;;;; While 1 For $n = 1 To $click MouseClick("left", $x, $y, 1) Next Sleep(100) WEnd ;;;;;;;; Func TogglePause() $Paused = Not $Paused While $Paused Sleep(100) ToolTip('Script is "Paused"', 0, 0) WEnd ToolTip("") EndFunc ;==>TogglePause Func Terminate() Exit 0 EndFunc ;==>Terminate Func ShowMessage() MsgBox(4096, "", "This is a message.") EndFunc ;==>ShowMessage [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
Valuater Posted December 12, 2006 Share Posted December 12, 2006 (edited) take a look at "HotKeySet()" in help at the bottom is a GREAT example 8) NVM - plato was good enough to do it for you Edited December 12, 2006 by Valuater Link to comment Share on other sites More sharing options...
BALA Posted December 12, 2006 Author Share Posted December 12, 2006 Again my ignorance has made a fool of me [font="Comic Sans MS"]BA-LA[/font]http://ba-la.110mb.comJoin my community, CLICK HEREAlternative links to my site:http://www.ba-la.tkhttp://www.ba-la.co.nrContact me if you would like to help with some of my projects: joeythepirate@gmail.com Link to comment Share on other sites More sharing options...
BALA Posted December 13, 2006 Author Share Posted December 13, 2006 Ya, could someone explain what the example does.... [font="Comic Sans MS"]BA-LA[/font]http://ba-la.110mb.comJoin my community, CLICK HEREAlternative links to my site:http://www.ba-la.tkhttp://www.ba-la.co.nrContact me if you would like to help with some of my projects: joeythepirate@gmail.com Link to comment Share on other sites More sharing options...
herewasplato Posted December 13, 2006 Share Posted December 13, 2006 (edited) Ya, could someone explain what the example does....here is a simpler version that does what you asked for... but you have to add your code for $click, $x and $y HotKeySet("{ESC}", "Terminate") HotKeySet("{F3}", "Play") Global $trigger = 0 While 1 If $trigger = 1 Then For $n = 1 To $click MouseClick("left", $x, $y, 1) Next EndIf Sleep(100) WEnd Func Terminate() Exit 0 EndFunc ;==>Terminate Func Play() $trigger = 1 EndFunc ;==>PlayWhich line do you not understand? Edited December 13, 2006 by herewasplato [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
BALA Posted December 13, 2006 Author Share Posted December 13, 2006 Okay I get now, thanks for baring with me [font="Comic Sans MS"]BA-LA[/font]http://ba-la.110mb.comJoin my community, CLICK HEREAlternative links to my site:http://www.ba-la.tkhttp://www.ba-la.co.nrContact me if you would like to help with some of my projects: joeythepirate@gmail.com Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now