Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 05/23/2018 in all areas

  1. ProgAndy

    AutoItObject UDF

    The AutoItObject team is proud to announce that the first version of our AutoItObject UDF is complete and ready to use. The project page is located at [currently missing] Please, report bugs and any other issues at our [currently missing], and not here. An overview of all the functions can be found in the online documentation [currently missing] or in the offline .chm documentation file which is included with the [currently missing]. If Origo has problems providing the download, the current version will be mirrored here The UDF requires the current AutoIt version v3.3.4.0! AutoItObject 1.2.8.2.exe AutoItObject 1.2.8.2.zip Please, leave your comments and experiences here. Regards, - trancexx - ProgAndy - monoceres - Kip Our work is published under the Artistic License 2.0 A copy of the FAQ to answer your most urgent questions right away: (can also be found at the online documentation: Some helper-functions: When using the Wrapper, this are some simple methods to get a return value from the resulting array. ; #FUNCTION# ==================================================================================================================== ; Name...........: _AIOResult ; Description ...: Returns the return value of the Call to a WraperObject function ; Syntax.........: _AIOResult(Const $aResult [, $vError=0] ) ; Parameters ....: $aResult - the resulting array ; $vError - [optional] value to be returned if result is no array (default: 0) ; Return values .: Success - Returnvalue ($aResult[0]) ; Failure - $vError, @error set to 1 ; Author ........: Prog@ndy ; Modified.......: ; Remarks .......: ; Related .......: ; Link ..........; ; Example .......; ; =============================================================================================================================== Func _AIOResult(Const $aResult, $vError=0) ; Author: Prog@ndy If IsArray($aResult) Then Return $aResult[0] Return SetError(1,0,$vError) EndFunc ; #FUNCTION# ==================================================================================================================== ; Name...........: _AIOParam ; Description ...: Returns the parameter value of the Call to a WraperObject function ; Syntax.........: _AIOParam(Const $aResult, $iParam, $vError=0) ; Parameters ....: $aResult - the resulting array ; $iParam - The parameterindex to return (0: result, 1: first parameter, 2: 2nd parameter, ...) ; $vError - [optional] value to be returned if result is no array (default: 0) ; Return values .: Success - Parameter value ; Failure - $vError, @error set to 1 ; Author ........: Prog@ndy ; Modified.......: ; Remarks .......: ; Related .......: ; Link ..........; ; Example .......; ; =============================================================================================================================== Func _AIOParam(Const $aResult, $iParam, $vError=0) ; Author: Prog@ndy If UBound($aResult)-1 < $iParam Then Return SetError(1,0,$vError) Return SetExtended($aResult[0], $aResult[$iParam]) EndFunc
    1 point
  2. I made an example for one of your functions, you can read in help file all documentation about how you can call function from dll. ConsoleWrite('Handle: ' & WlanOpenHandle(2) & @CRLF) Func WlanOpenHandle($dwClientVersion) Local $aRet = DllCall('Wlanapi.dll','dword','WlanOpenHandle', 'dword', $dwClientVersion, 'ptr', Null, 'dword*', 0, 'handle*', 0) If IsArray($aRet) Then If $aRet[0] = 0 Then Return $aRet[4] Else Return SetError(1) EndIf Else Return SetError(2) EndIf EndFunc
    1 point
  3. Keep in mind, that case statement works because the control IDs are contiguous. If they were not created one after another then that case statement wouldn't work.
    1 point
  4. Why do you have an ampersand in your code above? The first parameter should be a folder, the second parameter the filter. $aFileList = _FileListToArray(@ScriptDir & "\Documents\" & "*.txt") It should be $aFileList = _FileListToArray(@ScriptDir & "\Documents\", "*.txt")
    1 point
  5. It looks like this site is already using jQuery, so I would recommend that you look at the jQuerify solution from @Chimp. Here's a prior thread where I discussed using it -- It's difficult to tell you the correct syntax without having access to the site. In this case, I would suggest trying something like -- Local $jQuery = _jQuerify($oIE) ConsoleWrite("value = " & $jQuery(".aggregate_value[aggregate_field='monday']")[0].innerText & @CRLF) FYI, this may not work as-is due to the frames.
    1 point
  6. Earthshine

    log4a - A logging UDF

    you have to add the debug, trace, etc.. type of messages you want where you want them in the code. I log lots of things. First, in your main script, include the log4a.au3 file and configure the logging for your application or main script like so: that way it will log to console if run under editor, or log to a .log file when compiled. #include "log4a.au3" #Region ;**** Logging **** ; Enable logging and don't write to stderr _log4a_SetEnable() ; Write to stderr, set min level to warn, customize message format _log4a_SetErrorStream() _log4a_SetMinLevel($LOG4A_LEVEL_TRACE) If @compiled Then _log4a_SetMinLevel($LOG4A_LEVEL_WARN) ; Change the min level if the script is compiled _log4a_SetFormat("${date} | ${host} | ${level} | ${message}") #EndRegion ;**** Logging **** Then you can do stuff like this in other modules #include-once #include <Timers.au3> #include "log4a.au3" ; #FUNCTION# ==================================================================================================================== ; Name ..........: _waitControlClick ; Description ...: Automatically wait for a control to exist. Forever or Limited ; Syntax ........: _waitControlClick($formclass, $text, $ctrl, $ctrltxt, $timeout, $delayafter ; Parameters ....: $formclass - Form Class info. ; $text - Windows Forms text to match ; $ctrl - Class of Copntrol ; $ctrltxt - Text of the Control you search for ; $timeout - [Optional] Timeout, Default = 0, millisecond timer ; $delayafter - [Optional] Time to delay after operation carried out ; Return values .: None ; Author ........: Earthshine ; Modified ......: ; Remarks .......: Waits for each button indefinatly. ; Logger found here: https://www.autoitscript.com/forum/topic/156196-log4a-a-logging-udf/ ; Related .......: ; Link ..........: ; Example(s) ....: _waitControlClick ('[CLASS:#32770]', 'ApplicationX - InstallShield Wizard', '[CLASS:Button; INSTANCE:1]', , '&Next >' 5000, 0) ; _waitControlClick($formclass, $text, $button2, $TD_BTN_REMOVE, 0, 0) ; _waitControlClick($formclass, $text, $button3, $TD_BTN_NEXT, 0, 500) ; _waitControlClick($formclass, $text, $button1, $TD_BTN_YES, 0, 0) ; _waitControlClick($formclass, $text, $button4, $TD_BTN_FINISH, 0, 0) ; =============================================================================================================================== Func _waitControlClick($formclass, $text, $ctrl, $ctrltxt, $timeout = 0, $delayafter = 0) _log4a_Info("_waitControlClick():Begin") _log4a_Info("Searching for Formclass: " & $formclass) _log4a_Info("Searching for Text: " & $text) _log4a_Info("Searching for Control: " & $ctrl) _log4a_Info("Searching for Ctrl Txt: " & $ctrltxt) _log4a_Info("Timeout: " & $timeout) _log4a_Info("Time Delay (after click): " & $delayafter) Local $time_run = _Timer_Init() While (1) If WinExists($formclass) Then Local $hCtrl = ControlGetHandle($text, '', $ctrl) If $hCtrl Then If ($timeout > 0) Then _log4a_Info(_Timer_Diff($time_run)) If (_Timer_Diff($time_run) > $timeout) Then _log4a_Info("ExitLoop:Timeout - " & $ctrl) ExitLoop EndIf EndIf Local $hCtrlHandle = ControlGetText($text, '', $ctrl) _log4a_Info("Control Text Search: " & $ctrltxt) _log4a_Info("Control Text Found: " & $hCtrlHandle) If ($hCtrlHandle == $ctrltxt) Then ; we got the handle, so the button is there ; now do whatever you need to do _log4a_Info("Found Formclass: " & $formclass) _log4a_Info("Found Text: " & $text) _log4a_Info("Found Control: " & $ctrl) _log4a_Info("Found Ctrl Txt: " & $ctrltxt) _log4a_Info("Timeout: " & $timeout) _log4a_Info("Time Delay (after click): " & $delayafter) _log4a_Info('Control ' & $ctrl & ' Clicked') ControlClick($formclass, '', $ctrl) If ($delayafter > 0) Then Sleep($delayafter) EndIf _log4a_Info("ExitLoop:Normal - " & $ctrl) ExitLoop EndIf EndIf EndIf WEnd _log4a_Info("_waitControlClick():End") EndFunc ;==>_waitControlClick Here is the sample script listed above, using each type of message and how you log it. The log_messages() function is only a crude example to show you the different ways you can configure the logger. Notice you call that little function to show you the log settings you are configuring. You are just supposed to use the methods provided by the UDF to log your Warnings, Errors, Information or Fatal types #include "log4a.au3" ; Enable logging and don't write to stderr _log4a_SetEnable() _log4a_SetErrorStream(False) log_messages() ; Write to stderr, set min level to warn, customize message format _log4a_SetErrorStream() _log4a_SetMinLevel($LOG4A_LEVEL_INFO) If @compiled Then _log4a_SetMinLevel($LOG4A_LEVEL_WARN) ; Change the min level if the script is compiled _log4a_SetFormat("${shortdate} | ${host} | ${level} | ${message}") log_messages() ; Disable logging (except for those that override) _log4a_SetEnable(False) log_messages() Func log_messages() _log4a_Trace("A TRACE message", True) ; overrides filters _log4a_Debug("A DEBUG message") _log4a_Info("A INFO message") _log4a_Warn("A WARN message") _log4a_Error("A ERROR message", True) ; overrides filters _log4a_Fatal("A FATAL message") EndFunc
    1 point
  7. Yashied

    WinAPIEx UDF

    LAST VERSION - 3.8 03-Jul-12 This library contains the WinAPI functions are not included for unknown reasons to the native AutoIt WinAPI library. I use this UDF in nearly all of my programs, and decided to share it with the AutoIt community. I agree that over time some of these functions will be part of the native AutoIt library, but still... The library includes some undocumented, but useful functions (eg _WinAPI_GetFontResourceInfo()). The library also contains all the necessary constants to work with the appropriate functions. Most functions from this UDF intended for experienced users, but beginners will find the same lot of useful information for yourself. I will be to periodically add new functions to the library. The archive contains WinAPIEx library, and as usual an excellent examples from me. Some examples I took from this forum and to simplify them for better understanding. For those who use SciTE (full version) I have prepared the au3.userudfs.properties and au3.user.calltips.api files to highlight functions from this UDF in your scripts. Just copy this files to ...SciTEProperties and ...SciTEAPI, respectively. I hope this UDF will be useful for many as for me. I look forward to any feedback and suggestions. Maybe somebody wants to add new WinAPI functions? Credits Available functions Files to download WinAPIEx UDF v3.8 for AutoIt 3.3.6.1 Previous downloads: 27953 WinAPIEx UDF v3.8 for AutoIt 3.3.8.x Previous downloads: 14850
    1 point
  8. Hey, I've already seen the sticky thread on autoit virusses but the first post doesn't mention windows defender and the thread is quite inactive so I made a new one. I tried sending a simple keycombination to a program when my pc starts using 1) task scheduler and then 2) windows autostart folder. In both cases it's detected as a virus. I also tried adding the files as exeptions to windows defender while they were in their original folder, the autostart folder and I chose the .exes as well as the .au3s I also tried to add an exeption using the process name you can find on the task manager. (Tried to type in the name with .exe as well as without) I also changed the properties of the scripts so that they are started as an administrator. My script looks like this Sleep(15000) ControlSend ( "OBS 21.1.0 (64bit, windows) - Profil: Unbenannt - Szenen: Unbenannt", "", "[CLASS:Qt5QWindowIcon; INSTANCE:1]", "+{f8}" ) please help me... those guys from microsoft are mental
    0 points
×
×
  • Create New...