John404 Posted December 17, 2011 Share Posted December 17, 2011 Hello, I'm stuck with this: Here's an example of my current code While True Send("{LCTRL}") Sleep(1000) WEnd Now basically what I am trying to do is make it follow a sequence of commands, e.g... First it hits ctrl, then it hits .... H(example) then it hits G(example) So here's what I thought would work While True Send("{LCTRL}") Sleep(1000) Send("{H}") Sleep(1000) Send("{G}") Sleep1000 WEnd Could anyone help me with this? Link to comment Share on other sites More sharing options...
JohnOne Posted December 17, 2011 Share Posted December 17, 2011 (edited) With what? please explain your needs. EDIT: Perhaps you mean... Send("H") Send("G") Edited December 17, 2011 by JohnOne AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
John404 Posted December 17, 2011 Author Share Posted December 17, 2011 With what? please explain your needs.EDIT:Perhaps you mean...Send("H")Send("G")Oh whoops, OkI want it to hit ctrl first, then wait a certain interval (which is why I used the sleep) then go to the next Send key Link to comment Share on other sites More sharing options...
John404 Posted December 17, 2011 Author Share Posted December 17, 2011 help. Link to comment Share on other sites More sharing options...
water Posted December 17, 2011 Share Posted December 17, 2011 Please wait at least 24 hours before you bump a thread. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
JohnOne Posted December 17, 2011 Share Posted December 17, 2011 Oh whoops,OkI want it to hit ctrl first, then wait a certain interval (which is why I used the sleep) then go to the next Send keySo what is wrong with the code you have? AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
John404 Posted December 18, 2011 Author Share Posted December 18, 2011 (edited) So what is wrong with the code you have?It sends both keys at the same time + only follows the sleep at the bottom Edited December 18, 2011 by John404 Link to comment Share on other sites More sharing options...
JohnOne Posted December 18, 2011 Share Posted December 18, 2011 (edited) I don't think you are examining what is actually going on in your script. There are three things wrong with what you are saying. The first is that autoit3 can not send 2 keys at the same time. The second is that I have never ever heard of autoit3 disobeying a sleep function. The third is that the bottom Sleep is the only one that would not work as it is not even written correctly. That loop would take 3 seconds to complete once if it were written correctly. May I ask if you are just bored and trolling? Edited December 18, 2011 by JohnOne AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Blue_Drache Posted December 18, 2011 Share Posted December 18, 2011 What program are you attempting to automate, anyway? Perhaps we can give you a more efficient way if we know what you're trying to fiddle with. Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache Link to comment Share on other sites More sharing options...
John404 Posted December 18, 2011 Author Share Posted December 18, 2011 What program are you attempting to automate, anyway? Perhaps we can give you a more efficient way if we know what you're trying to fiddle with.I'm trying to make it so it sends the key H, then it sleeps for 2000, then it sends the key G, then it sleeps for 5000, and it repeatsI'm trying to understand this Link to comment Share on other sites More sharing options...
Blue_Drache Posted December 18, 2011 Share Posted December 18, 2011 (edited) Does this have anything at all to do with your " Because ... what you're describing sounds like Cool-Down Timers for a game. Edited December 18, 2011 by Blue_Drache Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache Link to comment Share on other sites More sharing options...
John404 Posted December 18, 2011 Author Share Posted December 18, 2011 Does this have anything at all to do with your " Because ... what you're describing sounds like Cool-Down Timers for a game.No... Is there a problem with actually learning the language? Link to comment Share on other sites More sharing options...
guinness Posted December 19, 2011 Share Posted December 19, 2011 (edited) There's no problem in learning but if you're not paying attention to what people are saying then how can you learn? Those that have posted above have asked the following questions, please take the time to answer this time around. 1. What program are you trying to send the command(s) to? 2. What's wrong with the code JohnOne posted? Did it not work? In the future please make the title of your post more descriptive, 'Then' doesn't really tell anyone much about your problem & please make sure you've understood the forum rules. Edited December 19, 2011 by guinness UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
jaberwacky Posted December 19, 2011 Share Posted December 19, 2011 ... it sends the key H, then it sleeps for 2000, then it sends the key G, then it sleeps for 5000, and it repeatsUm, dude, you like so totally posted what you need. Just like replace the english with autoit and stuff.... was going to post the solution but I want to see you put in some work ... Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum? Link to comment Share on other sites More sharing options...
Blue_Drache Posted December 19, 2011 Share Posted December 19, 2011 No... Is there a problem with actually learning the language?I don't have a problem with you learning the language ... if you get off your ass and learn it. Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache Link to comment Share on other sites More sharing options...
John404 Posted December 20, 2011 Author Share Posted December 20, 2011 nope dont work Link to comment Share on other sites More sharing options...
guinness Posted December 20, 2011 Share Posted December 20, 2011 (edited) John404 did you see my post at all? The less descriptive you become the less likely I'm (and others are) inclined to help you. You've failed to mention on numerous occasions the application you're using, so I'm going to guess it's Notepad you want to send to, therefore here is an example: Run("notepad.exe") Local $hWnd = WinWait("[CLASS:Notepad]") Send("^") Send("H") Send("G") ConsoleWrite($hWnd & @LF) Edited December 20, 2011 by guinness UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
John404 Posted December 25, 2011 Author Share Posted December 25, 2011 Ok, I"ll try to be descriptive. If I do send("{A}") sleep(50) It will send A every 50 miliseconds(or whatever sleep is) Now, if I do send("{A}") sleep(50) send("{B}") send(100) It'll send a and b every 100 seconds, but that's the problem, I want it to send A every 50 seconds and send B every 100 seconds. Hope this can clarify some things. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted December 25, 2011 Moderators Share Posted December 25, 2011 John404,Look at Adlib in the Help file - it lets you run a function at a predetermined interval. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Developers Jos Posted December 25, 2011 Developers Share Posted December 25, 2011 ... and read the previous given answers where you have been given a pointer not to use {} which you seem not to have read. Now as to learning the language: We are all fine with that but you could try to work on something that works on another program than a game. (Just a hint) Merry Christmas Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Recommended Posts