denjo Posted June 10, 2008 Share Posted June 10, 2008 Hello, I am try to make my own script and now I need your help. I want to close my script with a click on the right mouse button or on a letter on my keyboard (for exampe the "q"). Can you give me the right command for this action. regards, denjo Link to comment Share on other sites More sharing options...
d4rk Posted June 10, 2008 Share Posted June 10, 2008 _IsPress() [quote]Don't expect for a perfect life ... Expect a least troubles ones[/quote]Contact me : ass@kiss.toWhat I Have Done :Favorites Manager Mangage your favorite's folder, that's coolPC Waker For those who want to save stickersWebScipts Supporter For those who've just started with Web and WebScriptsTemporary Looker Simple but powerful to manage your Temporary folder, you know what you downloaded[UDF] _NumberFormat() Better performance on number display[UDF] _DirGet() What a folder contain [how many (hidden,normal,...) files], with one line of code[UDF] _IsPressEs() Just like _IsPress() but for a group of keys Link to comment Share on other sites More sharing options...
denjo Posted June 10, 2008 Author Share Posted June 10, 2008 (edited) can you give me a short explanation? Edited June 10, 2008 by denjo Link to comment Share on other sites More sharing options...
denjo Posted June 10, 2008 Author Share Posted June 10, 2008 (edited) ok sorry for my double-post Edited June 10, 2008 by denjo Link to comment Share on other sites More sharing options...
d4rk Posted June 10, 2008 Share Posted June 10, 2008 Ok, for shortest example and easiest to understand , do like this : HotKeySet("q","exit") Func exit() Exit EndFunc [quote]Don't expect for a perfect life ... Expect a least troubles ones[/quote]Contact me : ass@kiss.toWhat I Have Done :Favorites Manager Mangage your favorite's folder, that's coolPC Waker For those who want to save stickersWebScipts Supporter For those who've just started with Web and WebScriptsTemporary Looker Simple but powerful to manage your Temporary folder, you know what you downloaded[UDF] _NumberFormat() Better performance on number display[UDF] _DirGet() What a folder contain [how many (hidden,normal,...) files], with one line of code[UDF] _IsPressEs() Just like _IsPress() but for a group of keys Link to comment Share on other sites More sharing options...
denjo Posted June 10, 2008 Author Share Posted June 10, 2008 Ok, for shortest example and easiest to understand , do like this : HotKeySet("q","exit") Func exit() Exit EndFunc ok if I put the code into my script, I get a error-message. "Badly formatted "func" statement." Can you tell me what I have to modify in the code or should I insert something into the brackets after "func"? Link to comment Share on other sites More sharing options...
d4rk Posted June 10, 2008 Share Posted June 10, 2008 While 1 HotKeySet("q","exit") Wend Func exit() Exit EndFunc I myself don't have any error message with those little simple codes [quote]Don't expect for a perfect life ... Expect a least troubles ones[/quote]Contact me : ass@kiss.toWhat I Have Done :Favorites Manager Mangage your favorite's folder, that's coolPC Waker For those who want to save stickersWebScipts Supporter For those who've just started with Web and WebScriptsTemporary Looker Simple but powerful to manage your Temporary folder, you know what you downloaded[UDF] _NumberFormat() Better performance on number display[UDF] _DirGet() What a folder contain [how many (hidden,normal,...) files], with one line of code[UDF] _IsPressEs() Just like _IsPress() but for a group of keys Link to comment Share on other sites More sharing options...
denjo Posted June 10, 2008 Author Share Posted June 10, 2008 While 1 HotKeySet("q","exit") Wend Func exit() Exit EndFunc I myself don't have any error message with those little simple codes but I have :/ It has something to do with this line "Func exit()". Is there anything wrong or a possibility to take another command? Link to comment Share on other sites More sharing options...
d4rk Posted June 10, 2008 Share Posted June 10, 2008 do you use Scite ? [quote]Don't expect for a perfect life ... Expect a least troubles ones[/quote]Contact me : ass@kiss.toWhat I Have Done :Favorites Manager Mangage your favorite's folder, that's coolPC Waker For those who want to save stickersWebScipts Supporter For those who've just started with Web and WebScriptsTemporary Looker Simple but powerful to manage your Temporary folder, you know what you downloaded[UDF] _NumberFormat() Better performance on number display[UDF] _DirGet() What a folder contain [how many (hidden,normal,...) files], with one line of code[UDF] _IsPressEs() Just like _IsPress() but for a group of keys Link to comment Share on other sites More sharing options...
denjo Posted June 10, 2008 Author Share Posted June 10, 2008 do you use Scite ?SciTE4AutoIt3 Version 1.76 Link to comment Share on other sites More sharing options...
d4rk Posted June 10, 2008 Share Posted June 10, 2008 can you skip the error message and run the code ? [quote]Don't expect for a perfect life ... Expect a least troubles ones[/quote]Contact me : ass@kiss.toWhat I Have Done :Favorites Manager Mangage your favorite's folder, that's coolPC Waker For those who want to save stickersWebScipts Supporter For those who've just started with Web and WebScriptsTemporary Looker Simple but powerful to manage your Temporary folder, you know what you downloaded[UDF] _NumberFormat() Better performance on number display[UDF] _DirGet() What a folder contain [how many (hidden,normal,...) files], with one line of code[UDF] _IsPressEs() Just like _IsPress() but for a group of keys Link to comment Share on other sites More sharing options...
denjo Posted June 10, 2008 Author Share Posted June 10, 2008 can you skip the error message and run the code ?No.If I try to start it, I get the error-message and the script doesn't start. Link to comment Share on other sites More sharing options...
d4rk Posted June 10, 2008 Share Posted June 10, 2008 did you run only the code above or you mix it in your currently script ? can you post here all the codes ? [quote]Don't expect for a perfect life ... Expect a least troubles ones[/quote]Contact me : ass@kiss.toWhat I Have Done :Favorites Manager Mangage your favorite's folder, that's coolPC Waker For those who want to save stickersWebScipts Supporter For those who've just started with Web and WebScriptsTemporary Looker Simple but powerful to manage your Temporary folder, you know what you downloaded[UDF] _NumberFormat() Better performance on number display[UDF] _DirGet() What a folder contain [how many (hidden,normal,...) files], with one line of code[UDF] _IsPressEs() Just like _IsPress() but for a group of keys Link to comment Share on other sites More sharing options...
denjo Posted June 10, 2008 Author Share Posted June 10, 2008 did you run only the code above or you mix it in your currently script ? can you post here all the codes ? It's a very easy script and I think it has nothing to do with the other code but here the whole: MouseClick("left") Sleep(500) MouseClick("left") Sleep(500) MouseClick("left") Sleep(500) MouseClick("left") Sleep(500) MouseClick("left") Sleep(500) MouseClick("left") While 1 HotKeySet("q","exit") Wend Func exit () Exit EndFunc Link to comment Share on other sites More sharing options...
d4rk Posted June 10, 2008 Share Posted June 10, 2008 got it, here is the correct MouseClick("left") Sleep(500) MouseClick("left") Sleep(500) MouseClick("left") Sleep(500) MouseClick("left") Sleep(500) MouseClick("left") Sleep(500) MouseClick("left") While 1 HotKeySet("q","_exit") Wend Func _exit () Exit EndFunc it's my fault, i shouldn't declare a function with the same name as a command in autoit [quote]Don't expect for a perfect life ... Expect a least troubles ones[/quote]Contact me : ass@kiss.toWhat I Have Done :Favorites Manager Mangage your favorite's folder, that's coolPC Waker For those who want to save stickersWebScipts Supporter For those who've just started with Web and WebScriptsTemporary Looker Simple but powerful to manage your Temporary folder, you know what you downloaded[UDF] _NumberFormat() Better performance on number display[UDF] _DirGet() What a folder contain [how many (hidden,normal,...) files], with one line of code[UDF] _IsPressEs() Just like _IsPress() but for a group of keys Link to comment Share on other sites More sharing options...
denjo Posted June 10, 2008 Author Share Posted June 10, 2008 got it, here is the correct MouseClick("left") Sleep(500) MouseClick("left") Sleep(500) MouseClick("left") Sleep(500) MouseClick("left") Sleep(500) MouseClick("left") Sleep(500) MouseClick("left") While 1 HotKeySet("q","_exit") Wend Func _exit () Exit EndFunc it's my fault, i shouldn't declare a function with the same name as a command in autoit yes ok there is no error any more, but if I press "q" the script doesn't stop working. Link to comment Share on other sites More sharing options...
cartman380 Posted June 10, 2008 Share Posted June 10, 2008 (edited) You have to set the hotkey before you start doing the mouse clicks. EDIT: didn't need the While 1 Wend it was not doing anything HotKeySet("q","_exit") MouseClick("left") Sleep(500) MouseClick("left") Sleep(500) MouseClick("left") Sleep(500) MouseClick("left") Sleep(500) MouseClick("left") Sleep(500) MouseClick("left") Func _exit () Exit EndFunc Edited June 10, 2008 by cartman380 Link to comment Share on other sites More sharing options...
denjo Posted June 11, 2008 Author Share Posted June 11, 2008 You have to set the hotkey before you start doing the mouse clicks. EDIT: didn't need the While 1 Wend it was not doing anything HotKeySet("q","_exit") MouseClick("left") Sleep(500) MouseClick("left") Sleep(500) MouseClick("left") Sleep(500) MouseClick("left") Sleep(500) MouseClick("left") Sleep(500) MouseClick("left") Func _exit () Exit EndFunc but it doesn't work again, also with your hint of the hotkey Link to comment Share on other sites More sharing options...
d4rk Posted June 11, 2008 Share Posted June 11, 2008 @catman380 That's NOT True, i run the code i posted and it's ok you need to put the hotkeyset in a loop , otherwise, it's exit immediately ... please give advise when you know what you are doing [quote]Don't expect for a perfect life ... Expect a least troubles ones[/quote]Contact me : ass@kiss.toWhat I Have Done :Favorites Manager Mangage your favorite's folder, that's coolPC Waker For those who want to save stickersWebScipts Supporter For those who've just started with Web and WebScriptsTemporary Looker Simple but powerful to manage your Temporary folder, you know what you downloaded[UDF] _NumberFormat() Better performance on number display[UDF] _DirGet() What a folder contain [how many (hidden,normal,...) files], with one line of code[UDF] _IsPressEs() Just like _IsPress() but for a group of keys Link to comment Share on other sites More sharing options...
PantZ4 Posted June 11, 2008 Share Posted June 11, 2008 HotKeySet("q","_Terminate") While 1 Sleep(10) WEnd Func _Terminate() Exit EndFunc I would rather do this as HotKeySet only need to be set once and not all the time with a loop. Also you can't name your exit function "exit" as that is a predefined command. "_exit" or "_terminate" would be two other suggestions. 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