Sign in to follow this  
Followers 0
denjo

end script with press the right-mouse-button or a letter

24 posts in this topic

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

Share this post


Link to post
Share on other sites



_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

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

can you give me a short explanation?

Edited by denjo

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

ok sorry for my double-post

Edited by denjo

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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"?

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

do you use Scite ?

SciTE4AutoIt3

Version 1.76

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

#17 ·  Posted (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 by cartman380

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

@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

Share this post


Link to post
Share on other sites

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.

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  
Followers 0