Jump to content

Recommended Posts

Posted

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

Posted

_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

Posted

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

Posted

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

Posted

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

Posted

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

Posted

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

Posted

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.

Posted

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

Posted

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
Posted

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

Posted

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.

Posted

@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

Posted

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.

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
×
×
  • Create New...