Jump to content

EdDyreen

Active Members
  • Posts

    78
  • Joined

  • Last visited

About EdDyreen

  • Birthday 01/01/2011

EdDyreen's Achievements

Wayfarer

Wayfarer (2/7)

0

Reputation

  1. ' Ok, thanks for having helped me with my game bot, it is fully functional now, no further assistance needed, thanks !
  2. ' spy++ control detection logic was enabled during detection, it is enabled by default. Can I assume that if the first detected button is an instance 2 an instance 1 must always exist ? If so, a develloper might decide to make hidden buttons last so they would have the higher instance, and noone would notice unless they tested explicitly.
  3. ' I have an application with several buttons that all show up in Window Info as one and the same button. These 'child' buttons look like a comboSelectionBox, an editBox and a button. Then there are several other buttons and edit boxes. Dunno how I figured it out, maybe a code remainder after a version update or I noticed the first detectable button/editBox/.. is an instance 2 ! No idea why I can click button1/Edit1/... that isn't detected by Window Info. Some sort of overLay going on ? But if it is overLayed, then why can I click these individual child buttons !? Can I assume that if the first detected button is an instance 2 an instance 1 must always exist ? Any idea's how to detect secret 'child' buttons, that are not detected by window Info ?
  4. Thanks to the overwelming amount of replies, I figured it out Maybe of interest to the AutoIT develloping team, AutoIT will fail to initialize if the environment is not set !
  5. Trying to execute an AutoIT executable, my Perl executable returns error: application failed to initialize properly (0xc0150004) no further error information. Microsoft Windows XP [versie 5.1.2600] AutoIt v3 Script 3.3.8.1
  6. Ofcourse you are right, $PID = Run( ' "...FL.Studio.Producer.XXL v6.04 update.EXE" ' ) I'm such an idiot sometimes Thanks, JohnOne
  7. Microsoft Windows XP [versie 5.1.2600] AutoIt v3 Script 3.3.8.1 I have 2 files, 'E:ADMINVIPTMPTMPFL.Studio.Producer.XXL v6.04FL.Studio.Producer.XXL v6.04.EXE' 'E:ADMINVIPTMPTMPFL.Studio.Producer.XXL v6.04FL.Studio.Producer.XXL v6.04 update.EXE' When issuing the run command the first file gets executed. $PID = Run( 'E:ADMINVIPTMPTMPFL.Studio.Producer.XXL v6.04FL.Studio.Producer.XXL v6.04 update.EXE' )Rename the first file its extension to .EXE_, and the intended program is run. ; handle AutoIt v3 Script 3.3.8.1 bug: run( 'may run the wrong file' ) FileMove ( _ 'E:ADMINVIPTMPTMPFL.Studio.Producer.XXL v6.04FL.Studio.Producer.XXL v6.04.EXE', _ 'E:ADMINVIPTMPTMPFL.Studio.Producer.XXL v6.04FL.Studio.Producer.XXL v6.04.EXE_' _ )I wonder why ?
  8. @Country73 Your code to get the environment using the set command is prone to failure as it does not take into account variables may contain linefeeds. But my code was wrong too. I debugged it though, here is an example that proves $LF can be part of a variable and corrupt the code. @echo off &setlocal enableDelayedExpansion set var=^ )hello^<^>"<>"there echo.this is obviously wrong echo. set echo. echo.this is better echo. for /f "tokens=1 delims==" %%? in ( 'set' ) do ( set "?=%%~?" &if "%%~?" == "!?: =!" ( 2>nul >nul set "%%~?" &&(echo.%%~?) ) ) pause exit@BrewManNH Very interesting link indeed
  9. You could at least have read this thread to understand what all the fuss is about, before posting, I am a little tired of people responding to threads without reading carefully, thus spoiling it and blurring usefull posts. Some have their bleep in their bleep, and I need to be carefull what I say, cause negative opinions are censored here. This is what I have now, After running the EnvUpdate_() function the host process'es variables are no longer propageted through applications, and the default environment variables are restored to the ones you would get after logging off and then on again. I did not use WMI after all because many variables were missing, I found it easier to just enumerate the registry, unfortunately I had to add some values manually. I did not include all functions the code refers to, you get the idea ; ---------------------------------------------------------------------------------------------------------------------------------- Func EnvUpdate_() ; ---------------------------------------------------------------------------------------------------------------------------------- ; last updated : 06/06/2012 ; ; EnvUpdate() bugfix replacement ; ; Similar effect as logging off and then on again. ; For example, changes to the %path% environment might not take effect until you call EnvUpdate (or you logoff/reboot). ; ; ;debugOn_( $func ) debug_( @CRLF &'inside: ' &$func ) ; ( debug_( 'valid ' &$func &'( ' &$args &' )' ) ; ( Local $array1[1], $array2[1], $regPath, $colRegKey, $regKey, $count, $i, $dim Local $cmdFullPathFile, $ouFullPathFile Local $err = 0 ; ) debug_( 'perform ' &$func &'( ' &$args &' )' ) ; ( ; Get environment from registry in $array2 ; ( ReDim $array1[3] $array1[0] = 'HKLMSYSTEMControlSet001ControlSession ManagerEnvironment' $array1[1] = 'HKCUVolatile Environment' $array1[2] = 'HKCUEnvironment' $count = 0 For $regPath In $array1 ; $colRegKey = call9_( 'regKeyEnum_', $regPath ) For $regKey In $colRegKey ; ReDim $array2[ $count + 1 ][2] $array2[$count][0] = $regKey $array2[$count][1] = RegRead( $regPath, $regKey ) $count += 1 ; Next ; Next ; ) ; Remove duplicates, conflicts &manually add values to $array2 ; ( ReDim $array1[13] $array1[0] = 'TEMP' $array1[1] = 'TMP' $array1[2] = 'USERDOMAIN' $array1[3] = 'USERNAME' $array1[4] = 'USERPROFILE' $array1[5] = 'LOGONSERVER' $array1[6] = 'ALLUSERSPROFILE' $array1[7] = 'CommonProgramFiles' $array1[8] = 'COMPUTERNAME' $array1[9] = 'ComSpec' $array1[10] = 'ProgramFiles' $array1[11] = 'SystemDrive' $array1[12] = 'SystemRoot' $array2 = arrayDelete_( $array2, 'HOMESHARE' ) For $i = 0 To UBound( $array1 ) - 1 ; $array2 = arrayDelete_( $array2, $array1[$i] ) $dim = UBound( $array2 ) + 1 ReDim $array2[$dim][2] $array2[ $dim - 1 ][0] = $array1[$i] $array2[ $dim - 1 ][1] = '%%' &$array1[$i] &'%%' ; Next ; ) ; persistent $array2 ( ExpandEnvStrings ) ; ( For $i = 0 To UBound( $array2 ) - 1 ; $array2[$i][1] = $array2[$i][1] ; Next ; ) ;_ArrayDisplay( $array2 ) ; Get active environment in $array1 ; ( $cmdFullPathFile = _TempFile( @TempDir, 'cmd', '.CMD' ) $ouFullPathFile = _TempFile( @TempDir, 'ou', '.CMD' ) fileWrite_( $cmdFullPathFile, _ '@echo off &setlocal enableDelayedExpansion' &@CRLF & _ '' &@CRLF & _ '( for /f "tokens=1 delims=^^=&|+/() " %%%%%%%%? in ( ' &"'set 2^>nul'" &' ) do (echo.%%%%%%%%~?) )> "' &$ouFullPathFile &'"' &@CRLF & _ '' &@CRLF & _ 'endlocal &exit 0' _ ) RunWait( @COMSPEC & ' /k "' &$cmdFullPathFile &'"', @TempDir, @SW_HIDE ) call9_( 'fileDelete_', $cmdFullPathFile, 1 ) $array1 = call9_( 'fileRead_', $ouFullPathFile, 1 ) call9_( 'fileDelete_', $ouFullPathFile, 1 ) ; ) _ArrayDisplay( $array1 ) ; Clean the active environment ( remove all propagated values ) ;MsgBox_( 'TMP=%TMP%' ) ; ( For $i In $array1 ; EnvSet( $i ) ; Next ; ) ; Restore the default environment ;MsgBox_( 'TMP=%TMP%' ) ; ( For $i = 0 To UBound( $array2 ) - 1 ; EnvSet( $array2[$i][0], $array2[$i][1] ) ; Next ; ) ;MsgBox_( 'TMP=%TMP%' ) ; ) ; debug_( 'outside: ' &$func ) SetError( $err ) EndFunc ; ) ; ---------------------------------------------------------------------------------------------------------------------------------- #cs MsgBox( 0, '', 'begintest' ) MsgBox( 0, '', 'endoftest' ) Exit #ce ; ) ; ---------------------------------------------------------------------------------------------------------------------------------- Func fileRead_( $fullPathFile = '', $sErr = False ) ; ---------------------------------------------------------------------------------------------------------------------------------- ; last updated : 05/06/2012 ; ;debugOn_( $func ) debug_( @CRLF &'inside: ' &$func ) ; ( debug_( 'valid ' &$func &'( ' &$args &' )' ) ; ( Local $handle, $array[1], $line, $count Local $err = 0 ; ) debug_( 'perform ' &$func &'( ' &$args &' )' ) ; ( If call9_( 'fileExist_', $fullPathFile, $sErr ) Then ; $handle = FileOpen( $fullPathFile ) $count = 0 $line = True While $line ; $line = FileReadLine( $handle ) If $line <> '' Then ; ReDim $array[ $count + 1 ] $array[$count] = $line $count += 1 ; EndIf ; WEnd FileClose( $handle ) ; Else ; $err = @error ; EndIf ; ) ; debug_( 'outside: ' &$func ) SetError( $err ) Return $array EndFunc ; ) ; ---------------------------------------------------------------------------------------------------------------------------------- #cs MsgBox( 0, '', 'begintest' ) MsgBox( 0, '', 'endoftest' ) Exit #ce ; ) ; ---------------------------------------------------------------------------------------------------------------------------------- Func arrayDelete_( $array, $value ) ; ---------------------------------------------------------------------------------------------------------------------------------- ; last updated : 06/06/2012 ; ;debugOn_( $func ) debug_( @CRLF &'inside: ' &$func ) ; ( debug_( 'valid ' &$func &'( ' &$args &' )' ) ; ( Local $i Local $err = 0 ; ) debug_( 'perform ' &$func &'( ' &$args &' )' ) ; ( If IsArray( $array ) Then ; Do ; $err = 0 For $i = 0 To UBound( $array ) - 1 ; If $array[$i][0] = $value Then ; _ArrayDelete( $array, $i ) $err = 1 ExitLoop ; EndIf ; Next ; Until Not $err ; Else ; call9_( 'panic_', 21 ); $error[21] = 'object type invalid' ; EndIf ; ) ; debug_( 'outside: ' &$func ) SetError( $err ) Return $array EndFunc ; ) ; ---------------------------------------------------------------------------------------------------------------------------------- #cs MsgBox( 0, '', 'begintest' ) MsgBox( 0, '', 'endoftest' ) Exit #ce ; ) And it works, conventional memory is freed and programs depending on it can run fast and safely. Someone from Microsoft once told me, what we hate even more than helping people, is to help people that are trying to help people
  10. Console based applications have been around since computers were invented and will continiue to be around long after we die. Will I also need to use autoIT for writing my website ? Which is currently a combo of php, html, css and javascript ? I only use autoIT because it is has good GUI support, and if I want to write a serious cross-platform program, I use java not autoIT. What are you banging on about ?Besides, it's not even a batch, maybe it's a vbscript or a C# program, I dunno, because it doesn't matter what the host program is written in. The only thing that matters is whether autoIT can make sure 3th party programs I did not design have enough free conventional memory to run properly. @BrewManNH Good idea, some variables like 'userdomain', 'userprofile', 'username' appear to be missing though. I can always do a regRead of the 'HKLM..CurrentVersionSeCEdit' 'EnvironmentVariables' though. Thanks for the suggestions made
  11. The batch file isn't broken, it does exactly what I want it to do, filling the memory with variables and then spawn some progams. The funny thing is, autoIT programs seem to run normally, but some other programs I did not design nor do I know which language they were written in seem to crash if conventional memory gets low.I want my autoIT scripts to restore the default environment. Is there some kind of winAPI or COM that I can use then, to forfill my need to know what all the environment variable names are ? I don't like having to resort to batch, because it is slow and inneficient.
  12. I am not trying to solve an error, nor am I trying to eliminate a batch file, I am trying to unset all variables propagated by the host program that spawned this instance ( except for the default onces like path and comspec ) I'll try something different then, I will unset all loaded variables manually, but I can't find a command in autoIT that provides me an array of all set variables ?
  13. I'll try something different then, I will unset all loaded variables manually, but I can't find a command in autoIT that provides me an array of all set variables ? I see no other option than to spawn a hidden cmd window to provide me a list @for /f "tokens=1 delims==" %%? in ( 'set 2^>nul' ) do >envList.TXT (echo.%%?) I can then use EnvSet() on the list to free the memory I will probably need to backup the comspec variable... I then spawn a new instance of cmd to restore the original environment @for /f "delims=" %%? in ( 'set 2^>nul' ) do >envSet.TXT (echo.%%?) I can then use EnvSet() on the list to restore the original environment I wish someone knew a better way of doing it, ah well...
  14. I want autoIT not to be aware off or unload these variables propagated by the batch. I want the environment to become the original environment that was passed to cmd.EXE and not the active environment. I did a test to see whether autoIT cleared one of the variables, unfortunately it failed as the second msgBox showed a variable set by the batch and EnvUpdate() did not unset it. MsgBox_( EnvGet( 'processStart_' ) ) EnvUpdate() MsgBox_( EnvGet( 'processStart_' ) ) Exit No, I am not running out of memory when running the batch file, the theoretical max for DOS is 655360 bytes.
  15. ' My compiled autoIT program can run a certain program just fine. if I start my compiled autoIT program from the console or a simple program, it still runs this program just fine. But when I spawn my compiled autoIT program from a program that uses a lot ( 19.056 kB ) of conventional memory, the program launched by autoIT exits with an error. If I reduce the memory the problem goes away. Now I want to reset all environment variables from within autoIT. I tried EnvUpdate() but it didn't work ?
×
×
  • Create New...