muggl Posted January 27, 2005 Share Posted January 27, 2005 Hi guys, i m kinda new here and i got some trouble scripting some code. i wanted to make a script, that owns this function: While 1 MouseClick ("left") WEnd BUT !! i want to have endless mouseclicks only when i press down e.g. F4. and when i release f4 i want the script to stop. with my code that i pasted above, i got clicks everytime. steps : is f4 pressed? if yes mousclick left like hell if not, do nothing. so when i press f4 and hold it down. i want to have unlimited fast clicks. hope i expressed myself clearly enough to receive some help. take care. Link to comment Share on other sites More sharing options...
falconv Posted January 27, 2005 Share Posted January 27, 2005 (edited) Try this: HotKeySet("{Esc}", "MyExit") HotKeySet("{F4}", "click") While 1 WEnd Exit Func click() MouseClick("left") EndFunc Func MyExit() Exit EndFunc it will click as fast as holding down a key would repeat (and acts the same, it'll click once, wait a sec, then click like mad). Edit: whoops, it's MouseClick("left") for your actual script, not Send("a") for my test. I fixed it. Edited January 27, 2005 by falconv Link to comment Share on other sites More sharing options...
muggl Posted January 27, 2005 Author Share Posted January 27, 2005 Oh my god...thanks for your fast reply. i ll check that one! thank you so much Link to comment Share on other sites More sharing options...
muggl Posted January 27, 2005 Author Share Posted January 27, 2005 Oh my god...thanks for your fast reply. i ll check that one!thank you so much<{POST_SNAPBACK}>besides, is there a way to have like ... e.g. F3 pressed constantly instead ofthe left mousebutton?? Link to comment Share on other sites More sharing options...
falconv Posted January 27, 2005 Share Posted January 27, 2005 sure, just replace MouseClick("left") with Send("{F3}") or if you want both options, just copy the function "click", paste a copy of it, and rename it something else. Then replace Func click() with what you want the new function to be called, replace MouseClick("left") with what you want it to do, and add a copy of SetHotKey to the top with the new keypress followed by the new function: HotKeySet("{Esc}", "MyExit") HotKeySet("{F4}", "click") HotKeySet("{F3}", "keypress") While 1 WEnd Exit Func click() MouseClick("left") EndFunc Func keypress() Send("{Enter}") EndFunc Func MyExit() Exit EndFuncsee? Link to comment Share on other sites More sharing options...
muggl Posted January 27, 2005 Author Share Posted January 27, 2005 i really have to say, thanks a lot for your support ! Link to comment Share on other sites More sharing options...
falconv Posted January 27, 2005 Share Posted January 27, 2005 i really have to say, thanks a lot for your support !<{POST_SNAPBACK}>You're welcome Link to comment Share on other sites More sharing options...
muggl Posted January 27, 2005 Author Share Posted January 27, 2005 ok i swear to god..one last question. is there any possibility to get faster keystrokes? like right now there are remarkable stops between the automatic strokes...is there any way i cant fasten things up. and if so, where should that part of code be placed? thanks in advance ^^ Link to comment Share on other sites More sharing options...
Nova Posted January 27, 2005 Share Posted January 27, 2005 (edited) is there any possibility to get faster keystrokes ?Put this at the top of your scriptOpt("SendKeyDelay", 1) ;1 millisecondsok i swear to god..one last questionKeep asking questions !!! its the bestway to learn. Edited January 27, 2005 by Nova Link to comment Share on other sites More sharing options...
muggl Posted January 27, 2005 Author Share Posted January 27, 2005 Put this at the top of your scriptOpt("SendKeyDelay", 1) ;1 millisecondsKeep asking questions !!! its the bestway to learn.<{POST_SNAPBACK}>i do not know what to say. i have never ever received so many and fast support replies. thank you . Link to comment Share on other sites More sharing options...
Nova Posted January 27, 2005 Share Posted January 27, 2005 (edited) i do not know what to say. i have never ever received so many and fast support replies. thank you .Welcome to www.autoitscript.com Those who have recieved so much, are only just dieing to give something back. Edited January 27, 2005 by Nova 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