Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/20/2019 in all areas

  1. Here you are: ; given this: Local $sIn = "doberman, spots, labrador, poodle, white, grey, small, pug, greyhound" ; and this (unique replacements) Local $aRepl = [ _ ["spots", "dalmatian"], _ ["chinook", "robust"], _ ["chihuahua", "minuscule"], _ ["grey", "wolf"], _ ["poodle", "very big"], _ ["husky", "very cold there"] _ ] ; build that: Local $oRepl = ObjCreate("Scripting.Dictionary") For $i = 0 To UBound($aRepl) - 1 $oRepl.add($aRepl[$i][0], $aRepl[$i][1]) Next ; apply recipe Local $sOut = Execute("'" & StringRegExpReplace($sIn, "(\b\w+\b)", "' & ($oRepl.exists('$1') ? $oRepl.item('$1') : '$1') & '") & "'") ConsoleWrite($sOut & @LF)
    3 points
  2. To make it 100% fool-proof I would add a GUID to the OPEN and CLOSE token. So the script would be able to identify the correct pair. I would then use a dictionary to store the OPEN/CLOSE information and the overall usage. On success I would remove the OPEN/CLOSE info from the dictionary. At the end the problems you describe would be solved. Example: 2019-08-15 13:50:33 : Open {0335E874-FBD1-4CBF-A354-8B9D536B40A7} 2019-08-15 13:51:16 : Close {0335E874-FBD1-4CBF-A354-8B9D536B40A7} Instead of a GUID you could store the time including milliseconds. I would then add this exact start time to the CLOSE token. Rest as described above. Example: 2019-08-15 13:49:38.102 : Open 2019-08-15 13:51:16.582 : Close 13:49:38.102
    2 points
  3. MrCreatoR

    AutoIt Loader

    AutoIt Loader is basically an AutoIt environment loader that allows you to fully use AutoIt as a portable development environment. The idea is to load all the necessary AutoIt resources into the system while you work with it (there is an option to add it to autorun), allowing you to use AutoIt as if it was installed in the system, without conflict with another installed AutoIt version. It is a good solution if you want to use AutoIt on different computers that not allow you to install programs. The main ability is to change AutoIt version in a few clicks, and after changing the version, the whole environment adjusts to work with this version. It is also possible to “download” (update) new versions to the development environment, either from an official source or from another source on your PC. After unloading (exit from loader from system tray), all resources and registry entries are cleared completely, leaving no traces. The loader includes 4 of the most popular and critical versions of AutoIt, which were published by the largest number of changes. Also, the loader has a module called AutoIt Tools (see screenshots), which has a number of tools and utilities that are necessary for development in my opinion. AutoIt Tools loaded with the loader (can be disabled), and appears when the mouse cursor is in the lower left corner of the screen. The menu of this module is dynamic, and it can be very easily changed using built-in editor, which is called from the context menu of the module (RMB). As a base code editor was used SciTE assembly by Yashied, in my opinion the most functional and portable of those that I have seen. Download: AutoIt_Loader.zip Credits and copyright for tools and utilities used in this project: Screenshots:
    1 point
  4. not sure why you post that zip here. its just on github https://github.com/google/access-bridge-explorer/releases
    1 point
  5. For all who wants to find out how to do that. In the recent ADO.au3 UDF 2.1.16 BETA version: There are : _ADO_OpenSchema_Catalogs(..) _ADO_OpenSchema_Columns(..) _ADO_OpenSchema_Indexes(..) _ADO_OpenSchema_Procedures(..) _ADO_OpenSchema_Tables(..) _ADO_Schema_GetAllCatalogs(..) _ADO_Schema_GetAllTables(..) All these functions can be used to analyze DataBase structure. Maybe some day I make a complex example.
    1 point
  6. A scripting.dictionary is an associative array (a key-value pair) object natively supported by Windows. Looking up a key to find its associated item value is very fast. Building a scripting.dictionary and feeding key-value pairs is often faster than manipulating AutoIt arrays thru loops (albeit arrays have their own use as well). Once we've done that part, the rest of the job is essentially a replacement of words in input by either themselves or the alternative word stored in the dictionary, when key is present. (\b\w+\b) is the regexp pattern to capture a word (\b stands for "word boundary", see StringRegExp help). When this word is present as a key in the dictionary, we replace the word by the stored alternative value, else we leave it in place. We do that using the ternary operator <test> ? <true branch> : <false branch> The surrounding quotes + & and the final Execute() function concatenate all string pieces together. Keys in dictionary need to be unique, or else a test is required before .add
    1 point
  7. Nine

    TrayMenu Issues

    OK, post your code here...I'll look at it.
    1 point
  8. Here's the "traditional" method -- #include <IE.au3> SignIn() Func SignIn () Global $oIE = _IECreate ("https://www.asrpro.com/Login.aspx") Local $oForm = _IEFormGetCollection($oIE, 0) Local $username = _IEFormElementGetObjByName ($oForm, "username") Local $password = _IEFormElementGetObjByName ($oForm, "Password") Local $context = _IEFormElementGetObjByName ($oForm, "Context") _IEFormElementSetValue ($username, "myname") _IEFormElementSetValue ($password, "myPassword") _IEFormElementSetValue ($Context, "myID") _IEFormSubmit($oForm) EndFunc
    1 point
  9. Genos, You need the handle, not the ControlID: #include <GUIConstantsEx.au3> #Include <WinAPI.au3> $hGUI = GUICreate("Test", 500, 500) $hInput = GUICtrlCreateInput("", 10, 10, 400, 20) GUICtrlCreateButton("Test", 10, 100, 80, 30) GUICtrlSetState(-1, $GUI_FOCUS) GUISetState() Sleep(5000) _WinAPI_SetFocus(ControlGetHandle("Test", "", $hInput)) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd M23
    1 point
×
×
  • Create New...