Necrotarch Posted October 25, 2012 Share Posted October 25, 2012 Hey there, I'm currently writing on a small function library for some automatic testing tools. I noticed that there will be a lot of repeated commands in those testing tools. For example send("{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}") You can see how crappy that style is. I allready managed to shorten this special case to: Func _tabrepeat ($repetitions) For $counter = 0 To $repetitions Step +1 Send("{TAB}") Next EndFunc A call for that shortens the example to: _tabrepeat(11) Now i don't want to writea _XXXrepeat($repetitions) for every command i might Need. The idea would be about this _dotimes($command, $repetitions) to load the command i Need repeated into the function and reproduce it $repetition times. So the example called would look about like this: _dotimes(Send("{TAB}"), 11) Now i have to load the command "Send("{TAB}")" or any other command from the variable in a way i can actually use it. Is that possible somehow? Link to comment Share on other sites More sharing options...
JohnOne Posted October 25, 2012 Share Posted October 25, 2012 Send("{TAB 11}") from help file. 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...
PlayHD Posted October 25, 2012 Share Posted October 25, 2012 (edited) or Run("notepad.exe") WinWaitActive("Untitled") $ToDo = 'Send("{TAB}")' _DoTimes($ToDo,11) Func _DoTimes($dString,$dRepead) For $i = 1 To $dRepead Execute($dString) Next EndFunc Edited October 25, 2012 by PlayHD My UDF : _WinShake, _WinSplitMy Apps : Google Guitar Bot, PuzzleGameDesign Gui : Interesting Tabs Design, RBox Project (abandoned), Animated Gui on Exit Link to comment Share on other sites More sharing options...
water Posted October 25, 2012 Share Posted October 25, 2012 Which automation tool are you talking about? There are some threads on the forum talking about software automation tools. 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...
Necrotarch Posted October 25, 2012 Author Share Posted October 25, 2012 First of all: sorry for noobing around like this. @Wayfarer Thanks that was just what I ment! @ AutoIt MVPs (MVP) Well the tools dont even exist yet to be honest ^^'' in the end ist supposed to perform various checks on a certain programm that is under constant further decelopment. Regardless of that the in the end tool's suposed to run over night, check if everything is still working properly after changes in in the code, check for 0,00€ prices on articles in the integrated catalogue and basicly write an error protocoll to a .txt file Link to comment Share on other sites More sharing options...
water Posted October 25, 2012 Share Posted October 25, 2012 Hi Necrotarch, our names are PlayHD and Water, Wayfarer and AutoIt MVPs (MVP) are our titles As you are about to write a library I would stick with JohnOne's proposal. IIRC I have seen such an automation library on the forum - but can't remember where. Will have a look. 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...
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