CookieCop Posted August 27, 2006 Share Posted August 27, 2006 Hello, I'm new to AutoIt and the forums. Anyway, I need a macro so that when left-click it waits 0.2 seconds then presses R. Judging by what I know of AutoIt so far (Very little) I think it goes something like: If MouseClick("Left") Sleep(200) Send("R") Sorry if that doesn't help, but as I already said, I know very little about AutoIt coding. Could someone make this please? Thanks in advance, CookieCop. Link to comment Share on other sites More sharing options...
MHz Posted August 27, 2006 Share Posted August 27, 2006 If...Then...EndIf If condition Then action EndIf Link to comment Share on other sites More sharing options...
CookieCop Posted August 27, 2006 Author Share Posted August 27, 2006 (edited) Thanks for the quick reply. It works, but there's a problem. I forgot to mention that I want this to run continuously.. Sorry about that. The script you just posted only runs once, could you improve it please? =) EDIT: Ok, so I fixed it up a bit While 1 If MouseClick("Left") Then Send("R") Endif WEnd But, there is still 1 problem. It Left-Clicks automatically, which I don't want to happen. I'd like it so that WHEN I Left-Click, it presses R. Not, it continuously Left-Clicks and presses R. Someone please fix? Edited August 27, 2006 by CookieCop Link to comment Share on other sites More sharing options...
MHz Posted August 27, 2006 Share Posted August 27, 2006 Just use While...WEnd While 1 If MouseClick("Left") Then Sleep(200) Send("R") EndIf WEnd Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted August 27, 2006 Moderators Share Posted August 27, 2006 (edited) Misc.au3 + _IsPressed('01') + Send('R') Edit: So it would look like:#include <Misc.au3> While 1 If _IsPressed('01') Then Sleep(200) Send("R") EndIf Sleep(10) WEnd Edited August 27, 2006 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
CookieCop Posted August 27, 2006 Author Share Posted August 27, 2006 (edited) SmOke_N and MHz thankyou so much. It's working now. Edited August 27, 2006 by CookieCop Link to comment Share on other sites More sharing options...
MHz Posted August 27, 2006 Share Posted August 27, 2006 Sorry, MouseClick seems to always return 1, so Smoke's code is the working solution. Link to comment Share on other sites More sharing options...
CookieCop Posted August 27, 2006 Author Share Posted August 27, 2006 Alright, so #include <Misc.au3> While 1 If _IsPressed('01') Then Sleep(80) Send("r") EndIf Sleep(10) WEnd is working perfectly BUT, I'd like a little adjustment if possible. (Also, I changed the Sleep Delay to 80) I want it so that if the number 2 or 3 is pressed during that 80 Sleep Delay it won't press "r" afterwards. Could someone please make this adjustment? Thanks in advance, CookieCop. Link to comment Share on other sites More sharing options...
Paulie Posted August 27, 2006 Share Posted August 27, 2006 (edited) Alright, so #include <Misc.au3> While 1 If _IsPressed('01') Then Sleep(80) Send("r") EndIf Sleep(10) WEndoÝ÷ Ú+0¢¹" ^÷¶Q27õÙbæ¥Ûey§cºËfz{b~,²&åx l !jxvØ^JW¤7¥k+hóB0j{b¶Ê-«b~Ø^éz½¨¯x¬¦·¬±ç]º¸§ØZ·Íç© éZÊ+p¢}ý¶Þ²Ê®¢ÚêºZ~׫ÁªÝ°*.Û(ê'z^jǦjG+v;¬¶g§µ8ZK"§ojw $ਧú®¢×ºÚ"µÍÒ[ÛYH ÓZØË]LÉÝÂÝÙ^TÙ] ][ÝÌ][ÝË ][ÝÕÙÙÛT]ÙI][ÝÊBÝÙ^TÙ] ][ÝÌÉ][ÝË ][ÝÕÙÙÛT]ÙI][ÝÊBÛØ[ ÌÍÔ]ÙYHBÚ[HBYÒÔÜÙY ÌÎNÌIÌÎNÊH[ÛY BÙ[ ][ÝÜ][ÝÊB[YÛY L BÛÛ ][ÝÔØÜÈ[[É][ÝË BÑ[[ÈÙÙÛT]ÙJ BÌÍÔ]ÙYSÝ ÌÍÔ]ÙYÚ[H ÌÍÔ]ÙYÛY Ì BÛÛ ][ÝÔØÜÈ]ÙY ][ÝË BÙ[[[ Works for me just push 2 or 3 again and it will send again Edited August 27, 2006 by Paulie Link to comment Share on other sites More sharing options...
CookieCop Posted August 28, 2006 Author Share Posted August 28, 2006 (edited) That's great, although, could you make it so that you don't have to press 2 or 3 again to resume running the script? But I like how that hotkey pause works, could you reassign that to "`" please? (The key left of "1") Edited August 28, 2006 by CookieCop Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted August 28, 2006 Moderators Share Posted August 28, 2006 That's great, although, could you make it so that you don't have to press 2 or 3 again to resume running the script? But I like how that hotkey pause works, could you reassign that to "`" please? (The key left of "1")Did you make your donation ? Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
CookieCop Posted August 28, 2006 Author Share Posted August 28, 2006 Donation? :S Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted August 28, 2006 Moderators Share Posted August 28, 2006 Donation? :SYes, you have people making scripts for you, and you've put no work other than what you "want" it to do... I figure you could either A.) Go to RentACoder.com or B.) Make an AutoIt donation to continue to get help, and post the transaction ID to verify Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
CookieCop Posted August 28, 2006 Author Share Posted August 28, 2006 o_O I never knew I had to pay for scripts. Heh, does giving drafts or ideas for a script count as a donation? Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted August 28, 2006 Moderators Share Posted August 28, 2006 o_O I never knew I had to pay for scripts. Heh, does giving drafts or ideas for a script count as a donation?No, my 7 year old can do that Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
CookieCop Posted August 28, 2006 Author Share Posted August 28, 2006 Rofl. Alright then, guess I'll have to browse around for some tutorial and learn by myself. =/ 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