Jump to content

fede97

Members
  • Posts

    10
  • Joined

  • Last visited

About fede97

  • Birthday August 16

Profile Information

  • Location
    Italy

fede97's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. Yes, it's used outside of the function which created it
  2. Sorry but I've just seen your post. If i'm not mistaken you're telling me to use a Local instead of a Global but since i'm creating the fileopen handle inside a function, wouldn't fileclose fail if i declare the handle as local? Am i missing something?
  3. Perfect, i'll have a look at your UDF. Thanks again
  4. May i ask another thing here just to avoid creating another topic for a simple question? Is there any potential problem using OnAutoItExitRegister in and UDF to close a file handle?
  5. I'm not even using it in another script. I'm just inserting _Aut2Log_Settings() after the #include-once like this #include-once _Aut2Log_Settings() ; #INDEX# ======================================================================================================================= ; Title .........: Aut2Log ; AutoIt Version : 3.3.12.0 ; Language ......: English ; Description ...: Logging UDF ; =============================================================================================================================== ... Jibba Jabba... --Edit-- Oh, by the way, i'm using the latest autoit stable version --Edit2-- I hate myself. Told you i was missing something stupid and i realized right now my error! :ranting: Really sorry, thanks and goodbye
  6. Hey all, i've what i suppose to be a stupid problem with this script. I've been writing my logging udf (nothing fancy, just to help me in my next scripts) and i get this error "...\Aut2Log.au3" (52) : ==> Variable used without being declared.: Func _Aut2Log_Settings($bLogging = True, $iLogOutput = $__LOG_OUTPUT, $sFile = $__LOG_STANDARDFILEPATH) Func _Aut2Log_Settings($bLogging = True, $iLogOutput = ^ ERROR My code: #include-once ; #INDEX# ======================================================================================================================= ; Title .........: Aut2Log ; AutoIt Version : 3.3.12.0 ; Language ......: English ; Description ...: Logging UDF ; =============================================================================================================================== ; #CONSTANTS# =================================================================================================================== Global Const $__A2L_OUT_CONSOLE = 1 Global Const $__A2L_OUT_FILE = 2 Global Const $__A2L_OUT_BOTH = $__A2L_OUT_CONSOLE + $__A2L_OUT_FILE Global Enum $__A2L_TYPE_MESSAGE, $__A2L_TYPE_ARRAY, $__A2L_TYPE_RETURNVALUE, $__A2L_TYPE_ENVINFO ; =============================================================================================================================== ; #INTERNAL CONFIGS# ============================================================================================================ Global $__LOG_ENABLE = False Global $__LOG_OUTPUT = $__A2L_OUT_CONSOLE If StringRight (@ScriptDir, 1) <> '\' Then Global $__LOG_STANDARDFILEPATH = @ScriptDir & StringFormat("\logs\%04i\%02i\logfile_%02i-%02i-%02i", @YEAR, @MON, @MDAY, @HOUR, @MIN) Else Global $__LOG_STANDARDFILEPATH = @ScriptDir & StringFormat("logs\%04i\%02i\logfile_%02i-%02i-%02i", @YEAR, @MON, @MDAY, @HOUR, @MIN) EndIf ; =============================================================================================================================== ; #CURRENT# ===================================================================================================================== ;_Aut2Log_Settings ;_Aut2Log_WriteEnvironment ;_Aut2Log_Write ; =============================================================================================================================== ; #FUNCTION# ==================================================================================================================== ; Name...........: _Aut2Log_Settings ; Description ...: Configure logging options ; Syntax.........: _Aut2Log_Settings($bLogging [, $sFile = $__LOG_STANDARDFILEPATH]) ; Parameters ....: $bLogging - Enable/Disable logging ; $iLogOutput - $__A2L_OUT_CONSOLE = Output to console (Default) ; | $__A2L_OUT_FILE = Output to file ; | $__A2L_OUT_BOTH = Output to both ; $sFile - [optional] Logfile path, if not present and file logging is enabled python's logging rules ; will be used ; Return values .: Success - @error = 0 ; Failure - How is this even possible? You failed really bad man... ; Author ........: fede.97 ; Modified.......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: ; =============================================================================================================================== Func _Aut2Log_Settings($bLogging = True, $iLogOutput = $__LOG_OUTPUT, $sFile = $__LOG_STANDARDFILEPATH) $__LOG_ENABLE = $bLogging $__LOG_OUTPUT = $iLogOutput $__LOG_STANDARDFILEPATH = $sFile Return SetError (0) EndFunc ;==>_Aut2Log_Settings ; #FUNCTION# ==================================================================================================================== ; Name...........: _Aut2Log_WriteEnvironment ; Description ...: Configure logging options ; Syntax.........: _Aut2Log_WriteEnvironment(ByRef $avAnArray, $iAnInt[, $hAHandle = 0[, $nSomeNumber = 42]]) ; Parameters ....: $avAnArray - [byref] An array of anything. The value of anything is changed and passed out using this ; parameter. The array should only have one dimension ; $iAnInt - An integer that does very little. ; $hAHandle - [optional] A handle. Default is zero. ; $nSomeNumber - [optional] A number of some kind. Default is 42. ; Return values .: Success - A MYSTRUCT structure. ; Failure - Returns zero and sets the @error flag: ; |1 - The $avAnArray is invalid. ; Author ........: fede.97 ; Modified.......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: ; =============================================================================================================================== Func _Aut2Log_WriteEnvironment() $sEnvStats = '<Autoit>' & @CRLF & _ 'Compiled: ' & @OSBuild = 1 & @CRLF & _ 'ScriptFullPath: ' & @ScriptFullPath & @CRLF & _ 'AutoItVersion: ' & @AutoItVersion & @CRLF & _ 'AutoItX64: ' & @AutoItX64 = 1 & @CRLF & _ '<Current User Directory>' & @CRLF & _ 'AppDataDir: ' & @AppDataDir & @CRLF & _ 'DesktopDir: ' & @DesktopDir & @CRLF & _ 'UserProfileDir: ' & @UserProfileDir & @CRLF & _ 'HomeDrive: ' & @HomeDrive & @CRLF & _ 'ProgramFilesDir: ' & @ProgramFilesDir & @CRLF & _ 'SystemDir: ' & @SystemDir & @CRLF & _ 'TempDir: ' & @TempDir & @CRLF & _ '<System>' & @CRLF & _ 'CPUArch: ' & @CPUArch & @CRLF & _ 'KBLayout: ' & @KBLayout & @CRLF & _ 'OSLang: ' & @OSLang & @CRLF & _ 'OSVersion: ' & @OSVersion & @CRLF & _ 'OSBuild: ' & @OSBuild & @CRLF & _ 'ComputerName: ' & @ComputerName & @CRLF & _ 'UserName: ' & @UserName & @CRLF & _ 'OSBuild: ' & @OSBuild & @CRLF _Aut2Log_Write($sEnvStats, $__A2L_TYPE_ENVINFO) EndFunc ;==>_Aut2Log_WriteEnvironment ; #FUNCTION# ==================================================================================================================== ; Name...........: _Aut2Log_Write ; Description ...: Configure logging options ; Syntax.........: _Aut2Log_Write(ByRef $avAnArray, $iAnInt[, $hAHandle = 0[, $nSomeNumber = 42]]) ; Parameters ....: $avAnArray - [byref] An array of anything. The value of anything is changed and passed out using this ; parameter. The array should only have one dimension ; $iAnInt - An integer that does very little. ; $hAHandle - [optional] A handle. Default is zero. ; $nSomeNumber - [optional] A number of some kind. Default is 42. ; Return values .: Success - ... ; Failure - ... ; Author ........: fede.97 ; Modified.......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: ; =============================================================================================================================== Func _Aut2Log_Write(ByRef $sMessage, $iOutType, $sOutFile = $__LOG_STANDARDFILEPATH, $bOverride = False) If $__LOG_ENABLE = False Or $bOverride = False Then Return Switch $iOutType Case $__A2L_TYPE_ENVINFO Local $sLine = 'ENVIRONMENT INFO' & @CRLF & '[' & @HOUR & ':' & @MIN & ':' & @SEC &'] "' & $sMessage & '"' EndSwitch Switch $__LOG_OUTPUT Case $__A2L_OUT_CONSOLE ConsoleWrite ($sLine) ;~ Case ;~ Case EndSwitch EndFunc ;==>_Aut2Log_Write It's really simple and, of course, incomplete but i'm stuck. Any help would be greatly appreciated
  7. From helpfile: So, this does the trick $var = GuiCtrlRead($Input1) Send("{" & $var & "down}", 1) sleep(20) Send("{" & $var & "up}", 1)
  8. Thanks, i'll read it after i finished my homwork. I have searched on google for that for hours but i never think about looking for "Native applications" cause i never heard about them. (Sorry for my ignorance )
  9. Thanks but the function you linked me is a general startup. I wanted to use the registry key i linked (there are many others to do approx the same ) cause when you put a program in this one you can use a "console" like the one shown below in the spoiler
  10. Hi all, i'm here to ask some informations about starting up a program on windows startup. That's not for a simple operation, like putting the exe in the startup folder. I want to boot it first on system boot using this reg key: "HKLMSystemCurrentControlSetControlSession ManagerBootExecute" I ask here cause i found an exe that uses this function but it's not a simple exe, when i try to start it up windows says me that the file isn't a win32 app. So i can't understand how it's written (It was avast's antivirus boot scan exe). PS That's just a proof of concept i want to code (if it's possible), not malware or any other bad software.
×
×
  • Create New...