jskov9850 Posted December 25, 2017 Posted December 25, 2017 I need some help here. I have the following code: Send("{ENTER}") Sleep( 300 ) Send("1") Send("{TAB}") Sleep( 400 ) I need it to repeat itself, but instead of Send("1"), it will increase to 2, then increase to 3, 4, 5 all the way up to 1000. Is this possible? I haven't been able to find anything, and I'm kind of new to this subject. Please give examples. Thank you.
Nunos Posted December 25, 2017 Posted December 25, 2017 Perhaps Do...Until ? https://www.autoitscript.com/autoit3/docs/keywords/Do.htm
jskov9850 Posted December 26, 2017 Author Posted December 26, 2017 Global $first $first = 1 Do Send("{ENTER}") Sleep( 200 ) Send("Number", $first) Sleep( 200 ) Send("{TAB}") Sleep( 200 ) Send("{TAB}") Sleep( 300 ) Until $first = 3 Whats wrong here? I want it to do " Send("Number", $first)" until the number that it sends, is 3. But its just typing "Number" and not the actual number.
spudw2k Posted December 26, 2017 Posted December 26, 2017 (edited) Firstly, you are not incrementing $first so it will loop forever. You either need to do this in a For loop or add a line to increment Secondly, you are not using the Send function quite correctly; Namely if you want to send the value of $first after the string "Number", you need to concatenate it to the string by using the the ampersand (&) character. Using a comma as you are is sending $first as the second parameter to the Send function (see helpfile). Also keep in mind you'll probably want to add a space at the end of the word "Number". Check out the different Loop functions in the help file and see if the For loop is the best fit for your needs. Let us know where you get stuck. Edited December 26, 2017 by spudw2k Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX Builder Misc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retrieve SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose Array Projects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalc Cool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF
badcoder123 Posted December 26, 2017 Posted December 26, 2017 ;Something like this? For $i = 1 To 3 Send("{ENTER}" & $i & "{TAB}{TAB}") Next
careca Posted December 26, 2017 Posted December 26, 2017 (edited) Yes. Is it working the way you want? Whoops, didn't notice you're not the OP, no profile pic. Edited December 26, 2017 by careca Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe
argumentum Posted December 26, 2017 Posted December 26, 2017 On 12/24/2017 at 11:04 PM, jskov9850 said: Please give examples. Some video tutorials in youtube. Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting.
jskov9850 Posted December 26, 2017 Author Posted December 26, 2017 Alright guys, I made it work. Though, I'm kind of interested in this. Can someone explain what it does? ;Something like this? For $i = 1 To 3 Send("{ENTER}" & $i & "{TAB}{TAB}") Next argumentum 1
Developers Jos Posted December 26, 2017 Developers Posted December 26, 2017 Which part in that code needs explanation after you tried reading/interpreting and checking the helpfile? Jos Earthshine 1 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.
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