markendsley Posted February 18, 2009 Share Posted February 18, 2009 I need a quick script that will push Tab and then K key in a loop into infinity. I would really appreciate the help, I don't know how to do it. Link to comment Share on other sites More sharing options...
jebus495 Posted February 18, 2009 Share Posted February 18, 2009 While 1 Send(something) Send(something) WEnd Prolly want some sleeps in there. Link to comment Share on other sites More sharing options...
motionman95 Posted February 18, 2009 Share Posted February 18, 2009 (edited) Why into infinity? Anyway, here's some code: Send("{TAB down}") ;Holds the Tab key down ;Send("{TAB up}") Releases the Tab key Send("{A down}") ;Holds the A key down ;Send("{A up}") Releases the A key You'll also want to use the help documentation, or even the forum search tool. You would have solved your problem much more quickly that way. Edited February 18, 2009 by motionman95 Link to comment Share on other sites More sharing options...
Manjish Posted February 18, 2009 Share Posted February 18, 2009 This will send tab +k to a notepad window.. only when it is active.. Script will exit when end key is pressed hotkeyset("{END}","Terminate") while 1 WinWaitActive("Untitled - Notepad","") Send("{Tab}K") WEnd Func Terminate() Exit EndFunc [font="Garamond"]Manjish Naik[/font]Engineer, Global Services - QPSHoneywell Automation India LimitedE-mail - Manjish.Naik@honeywell.com Link to comment Share on other sites More sharing options...
Drew Posted February 18, 2009 Share Posted February 18, 2009 This code will begin pressing "TAB" and then "k" over and over and over and over. Shift + G starts and pauses the script. HotKeySet("G", "_Go") global $paused While 1 Sleep(500) WEnd Func _Go() While $Paused $Paused = NOT $Paused Send("{TAB}") Send("k") WEnd EndFunc Link to comment Share on other sites More sharing options...
Manjish Posted February 18, 2009 Share Posted February 18, 2009 (edited) This code will begin pressing "TAB" and then "k" over and over and over and over. Shift + G starts and pauses the script.CODEHotKeySet("G", "_Go")global $pausedWhile 1 Sleep(500)WEndFunc _Go() While $Paused $Paused = NOT $Paused Send("{TAB}") Send("k") WEndEndFuncSleep in while loop?? that will pause the script for ever.. Did u test this?? coz i did.. nd it didn't do anything.. other than hang forever.. Edited February 18, 2009 by Manjish [font="Garamond"]Manjish Naik[/font]Engineer, Global Services - QPSHoneywell Automation India LimitedE-mail - Manjish.Naik@honeywell.com Link to comment Share on other sites More sharing options...
Inverted Posted February 18, 2009 Share Posted February 18, 2009 He set a hotkay. So the callback function will be called when htat key is pressed, even if the main script loop is sleep "forever" Link to comment Share on other sites More sharing options...
Manjish Posted February 18, 2009 Share Posted February 18, 2009 did u try it out?? When i tested it didn't do anything.. other than sleeping? [font="Garamond"]Manjish Naik[/font]Engineer, Global Services - QPSHoneywell Automation India LimitedE-mail - Manjish.Naik@honeywell.com Link to comment Share on other sites More sharing options...
Fi0da Posted February 18, 2009 Share Posted February 18, 2009 You'll also want to use the help documentation, or even the forum search tool. You would have solved your problem much more quickly that way.My dear friends .... Many people, even I prefer to use direct forum to resolve their doubts Xq You "pros" also cite examples of teaching still very rich. So the help of you is 1000% better than the help of Au3 ^^^^ I read ... I update ... I learn ... Link to comment Share on other sites More sharing options...
Manjish Posted February 18, 2009 Share Posted February 18, 2009 @ Fioda.. I agree.. It's much more easier here.. But to tell u the truth, one needs to be self sufficient.. as far as possible.. And one shoudl ask only for help when it is most needed.. Laziness is not a gr8 virtue.. Thats what my buddy motionman meant.. [font="Garamond"]Manjish Naik[/font]Engineer, Global Services - QPSHoneywell Automation India LimitedE-mail - Manjish.Naik@honeywell.com Link to comment Share on other sites More sharing options...
BrettF Posted February 18, 2009 Share Posted February 18, 2009 With something like this, I agree with motion man. If you got asked the same question every day, and it was always the same answer, would you get tired of answering? So that is why many of us prefer the OP to be proactive, try some stuff out, search the forums, try explore the help file. Just by doing that little bit, it saves them time, they might learn a bit more, and it saves our fingers and sanity! Cheers, Brett Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Fi0da Posted February 18, 2009 Share Posted February 18, 2009 @Manjish @BrettF Q I agree with everything you said ... I understand that there are too many lazy ... but I want to say is that the help of Au3 is not very explanatory. In the most simple script ... that you do not think a solution if anyone not quest. This to exercise constantly recycles knowledge. Already praised the great attention of many of you now and praise the dedication and commitment in teaching us. Lets see more that Au3Help "The excellence comes with time" Cheers Fi0da I read ... I update ... I learn ... Link to comment Share on other sites More sharing options...
BrettF Posted February 18, 2009 Share Posted February 18, 2009 The help file is one of the best you can get. No other language I've ever looked at has so much information and examples as it does. I think it is fairly explanatory if you sit down and study what you need to know.For example I chose a random topic in the help file. Here's me analyzing it:FileGetShortcutSecond line, I learn about what it does "Retrieves details about a shortcut.", next line is syntax. Then I see what each parameter is, and possible values in some cases. Then I see what it returns, an array or it sets @error. That tells me how I should go about testing for success or failure. Then in the remarks, it tells me what the array returns. Then I have related functions and then finally the code example. Which contains comments so you can see how it works. Your next step is to experiment (I might choose a random shortcut, and then see what is returned using _ArrayDisplay etc.)Can I ask what is not explanatory? What is hard to understand?CheersBrett Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Fi0da Posted February 18, 2009 Share Posted February 18, 2009 I agree with you to be lazy to get what we need ... It is much easier to ask and collect the exact response ... We need to more study. When I said that aid is not very conclusive, I meant to people newbies can not learn just for the help. If questions of beginners annoy you, make sure that my part of not more trouble. Regards Fi0da (Sad student) sorry to divert the topic I read ... I update ... I learn ... 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