
argv1
Members-
Posts
18 -
Joined
-
Last visited
Everything posted by argv1
-
Works, perfect thanks
-
Hi, I would like to compare parts of an image with my saved images. The posts I found are pretty old and not helpful. could you please just tell me with funtion I need to compare image (in a browser from position x,y to position x2,y2) with my images. Thank you very much
-
Hi, I would like to know if there is an easier way than my current approach Send("{CTRLDOWN}{SHIFTDOWN}n{CTRLUP}{SHIFTUP}") Thank you
-
many thx
-
HI, I current got the following Input field: $Input1 = GUICtrlCreateInput("", 16, 48, 185, 21, $ES_NUMBER) everything works fine, but I would like to use $ES_PASSWORD as well, but if I change it to: $Input1 = GUICtrlCreateInput("", 16, 48, 185, 21, $ES_NUMBER, $ES_PASSWORD) I still can only enter digits but I can see the input. I also tried: $Input1 = GUICtrlCreateInput("", 16, 48, 185, 21, $ES_NUMBER) ;== nur Zahlen erlaubt GUICtrlSetStyle(-1, $ES_PASSWORD) but nothing changed. Is it possible to use both at the sam time and also limit the input length?
-
lock the screen via Send("#l") doens't work (win10)
argv1 replied to argv1's topic in AutoIt General Help and Support
that works, thank you very much -
Hi, I got some control lights, that should show if the program can run without any problems ATM the script will run a check once I hit the "Go" Button. But if would be nice, if the script can do this more often, i.e. every 3 minutes. Here is my current script #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("Crypter", 222, 208, 192, 124) $Input1 = GUICtrlCreateInput("", 16, 48, 185, 21, $ES_NUMBER) ;== only digits $Input2 = GUICtrlCreateInput("", 16, 88, 185, 21) $ButtonGo = GUICtrlCreateButton("Go", 48, 128, 113, 41) $Light1 = GUICtrlCreateGraphic(5, 5, 31, 32) GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0x000000, 0xFFCC33) ;== gelb GUICtrlSetGraphic(-1, $GUI_GR_ELLIPSE, 6, 8, 20, 19) $Light2 = GUICtrlCreateGraphic(35, 5, 31, 32) GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0x000000, 0xFFCC33) ;== gelb GUICtrlSetGraphic(-1, $GUI_GR_ELLIPSE, 6, 8, 20, 19) $Light3 = GUICtrlCreateGraphic(65, 5, 31, 32) GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0x000000, 0xFFCC33) ;== gelb GUICtrlSetGraphic(-1, $GUI_GR_ELLIPSE, 6, 8, 20, 19) $Light4 = GUICtrlCreateGraphic(95, 5, 31, 32) GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0x000000, 0xFFCC33) ;== gelb GUICtrlSetGraphic(-1, $GUI_GR_ELLIPSE, 6, 8, 20, 19) $Light5 = GUICtrlCreateGraphic(125, 5, 31, 32) GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0x000000, 0xFFCC33) ;== gelb GUICtrlSetGraphic(-1, $GUI_GR_ELLIPSE, 6, 8, 20, 19) GUISetState(@SW_SHOW) $dateinamensteil1 = "test" $dateinamensteil3 = ".enc" While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $ButtonGo if lights() Then Foobar() EndIf EndSwitch WEnd Func lights() ;==$Kontrolllampe1 If FileExists("C:\test\test.doc") Then GUICtrlSetGraphic($Light1, $GUI_GR_COLOR, 0x000000, 0x00FF00) ;== grün GUICtrlSetGraphic($Light1, $GUI_GR_ELLIPSE, 6, 8, 20, 19) GUICtrlSetGraphic ($Light1, $GUI_GR_REFRESH) $Kontrolle1 = 1 Else GUICtrlSetGraphic($Light1, $GUI_GR_COLOR, 0x000000, 0xFF0000) ;== rot GUICtrlSetGraphic($Light1, $GUI_GR_ELLIPSE, 6, 8, 20, 19) GUICtrlSetGraphic ($Light1, $GUI_GR_REFRESH) $Kontrolle1 = 0 EndIf ;==$Kontrolllampe2 If GUICtrlRead($Input1) THEN GUICtrlSetGraphic($Light2, $GUI_GR_COLOR, 0x000000, 0x00FF00) ;== grün GUICtrlSetGraphic($Light2, $GUI_GR_ELLIPSE, 6, 8, 20, 19) GUICtrlSetGraphic ($Light2, $GUI_GR_REFRESH) $Kontrolle2 = 1 Else GUICtrlSetGraphic($Light2, $GUI_GR_COLOR, 0x000000, 0xFF0000) ;== rot GUICtrlSetGraphic($Light2, $GUI_GR_ELLIPSE, 6, 8, 20, 19) GUICtrlSetGraphic ($Light2, $GUI_GR_REFRESH) $Kontrolle2 = 0 EndIf ;==$Kontrolllampe3 If FileExists(@ScriptDir & "\" & $dateinamensteil1 & $Input1 & $dateinamensteil3) THEN GUICtrlSetGraphic($Light3, $GUI_GR_COLOR, 0x000000, 0x00FF00) ;== grün GUICtrlSetGraphic($Light3, $GUI_GR_ELLIPSE, 6, 8, 20, 19) GUICtrlSetGraphic ($Light3, $GUI_GR_REFRESH) $Kontrolle3 = 1 Else GUICtrlSetGraphic($Light3, $GUI_GR_COLOR, 0x000000, 0xFF0000) ;== rot GUICtrlSetGraphic($Light3, $GUI_GR_ELLIPSE, 6, 8, 20, 19) GUICtrlSetGraphic ($Light3, $GUI_GR_REFRESH) $Kontrolle3 = 0 EndIf ;==$Kontrolllampe4 If GUICtrlRead($Input2) THEN GUICtrlSetGraphic($Light4, $GUI_GR_COLOR, 0x000000, 0x00FF00) ;== grün GUICtrlSetGraphic($Light4, $GUI_GR_ELLIPSE, 6, 8, 20, 19) GUICtrlSetGraphic ($Light4, $GUI_GR_REFRESH) $Kontrolle4 = 1 Else GUICtrlSetGraphic($Light4, $GUI_GR_COLOR, 0x000000, 0xFF0000) ;== rot GUICtrlSetGraphic($Light4, $GUI_GR_ELLIPSE, 6, 8, 20, 19) GUICtrlSetGraphic ($Light4, $GUI_GR_REFRESH) $Kontrolle4 = 0 EndIf ;==$Kontrolllampe5 If FileExists("C:\Program Files\Test.exe") THEN GUICtrlSetGraphic($Light5, $GUI_GR_COLOR, 0x000000, 0x00FF00) ;== grün GUICtrlSetGraphic($Light5, $GUI_GR_ELLIPSE, 6, 8, 20, 19) GUICtrlSetGraphic ($Light5, $GUI_GR_REFRESH) $Kontrolle5 = 1 Else GUICtrlSetGraphic($Light5, $GUI_GR_COLOR, 0x000000, 0xFF0000) ;== rot GUICtrlSetGraphic($Light5, $GUI_GR_ELLIPSE, 6, 8, 20, 19) GUICtrlSetGraphic ($Light5, $GUI_GR_REFRESH) $Kontrolle5 = 0 EndIf If $Kontrolle1 + $Kontrolle2 + $Kontrolle3 + $Kontrolle4 + $Kontrolle5 = 5 Then ; wenn alle Kontrolllampen grün dann sende 1 zurück ansonsten 0 Return 1 Else Return 0 EndIf EndFunc Func Foobar() ... EndFunc
-
Hi folks, I would like to create a traffic light like gui object, where the user (me) can see if something went well or not. For that I wrote this: $Kontrolllampe1 = GUICtrlCreateGraphic(432, 20, 31, 32) GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0x000000, 0xFFCC33) ;== yellow GUICtrlSetGraphic(-1, $GUI_GR_ELLIPSE, 6, 8, 20, 19) I got seven traffic lights. When I would like to change the color, what did I need to do? I tried this: Case $ButtonErstellen $Kontrolllampe1 = GUICtrlCreateGraphic(432, 20, 31, 32) GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0x000000, 0x00FF00) ;== green GUICtrlSetGraphic(-1, $GUI_GR_ELLIPSE, 6, 8, 20, 19) but I have to click the button twice to see a result Is there a possibility that I use something like Case $ButtonErstellen $Kontrolllampe1 = GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0x000000, 0x00FF00) ;== green (I know this doesn't work) Thank you in advance
-
Hi, working on my first autoit GUI an got some questions. Is it possible to get an action on the first menu level For example: $StartMenu = GUICtrlCreateMenu("Datei") ... while 1 Switch GUIGetMsg() Case $StartMenu MsgBox(0, "Test", "yes this works") (currently this does not work for me) Currently I have to create GUICtrlCreateMenuItem 's this will leed to a result And a 2nd question. I saw many time this: $StartMenu = GUICtrlCreateMenu("&Datei") For what does I need the ampersand? If I leave out the & nothing seems to change Thank you very much in advance
-
Ok a donwloaded 7a and change the script to this: ;Backup Script 29.11.09 Dim $BackupErfolgreich = Backuppen() If ($BackupErfolgreich) Then MsgBox (0, "Statusfenster", "Backup erstellt, altes Backup gelöscht") Else MsgBox (0, "Statusfenster", "Backup war nicht möglich") EndIf Func Backuppen() Local $BackupFileDate = @YEAR & '-' & @MON & '-' & @MDAY Local $DriveLetter1 = DriveLetterFinden('Linda') Local $DriveLetter2 = DriveLetterFinden('mitalles') Local $Ordnerliste[4] $Ordnerliste[0]= 'keep' $Ordnerliste[1]= 'web' $Ordnerliste[2]= 'Bilder' $Ordnerliste[3]= 'privat' Local $s7za = @ProgramFilesDir & '\7za\' For $counter = 0 to 1 If Not (HeuteSchonGebackuped($Ordnerliste[$counter])) Then RunWait($s7za & '7za.exe a "C:\Backup\"' & $BackupFileDate & '-Stick-' & $Ordnerliste[$counter] & ' ' & $DriveLetter1 & '\' & $Ordnerliste[$counter] ) AlteBackupsLoeschen($Ordnerliste[$counter]) Else MsgBox (0, "Statusfenster", "Heute wurde bereits ein Backup von " & $Ordnerliste[$counter] & " erstellt") EndIf Next For $counter = 2 to 3 If Not (HeuteSchonGebackuped($Ordnerliste[$counter])) Then RunWait($s7za & '7za.exe a "C:\Backup\"' & $BackupFileDate & '-' & $Ordnerliste[$counter] & ' ' & $DriveLetter2 & '\' & $Ordnerliste[$counter] ) AlteBackupsLoeschen($Ordnerliste[$counter]) Else MsgBox (0, "Statusfenster", "Heute wurde bereits ein Backup von " & $Ordnerliste[$counter] & " erstellt") EndIf Next If @error Then return False Else return True EndIf EndFunc Func DriveLetterFinden($x) Local $aDrives = DriveGetDrive("ALL") For $i = 1 To UBound($aDrives) -1 If DriveGetLabel($aDrives[$i]) = $x Then return $aDrives[$i] EndIf Next EndFunc Func AlteBackupsLoeschen($ZuLoeschen) Local $Search = FileFindFirstFile("C:\Backup\*.*") Local $File While 1 If $Search = -1 Then ExitLoop EndIf $File = FileFindNextFile($Search) If @error Then ExitLoop If Not StringInStr( $File, @YEAR & '-' & @MON & '-' & @MDAY) Then If StringInStr( $File, $ZuLoeschen) Then FileDelete("C:\Backup\" & $File) EndIf EndIf WEnd EndFunc Func HeuteSchonGebackuped($ZuPruefen) Local $Search = FileFindFirstFile("C:\Backup\*.*") Local $File While 1 If $Search = -1 Then ExitLoop EndIf $File = FileFindNextFile($Search) If @error Then ExitLoop If StringInStr( $File, @YEAR & '-' & @MON & '-' & @MDAY) Then If StringInStr( $File, $ZuPruefen) Then return True Else return False EndIf EndIf WEnd EndFunc I'll still recieve the msg that a backup for the folder Bilder already exists (Heute wurde bereits ein Backup von Bilder erstellt) what is right, but for the other 3 the program create new backups. Why, if they even exists? could the filesize be the problem? The Backup of Bilder is 1,78 GB, the other files are between 10 and 450 MB Is there a possibility to run 7za as a proccess in the background?
-
thanks a lot for the tipps with dim but currently I got a little challenge, I tried to optimize the script to this: ;Backup Script 29.11.09 Dim $BackupErfolgreich = Backuppen() If ($BackupErfolgreich) Then MsgBox (0, "Statusfenster", "Backup erstellt, altes Backup gelöscht") Else MsgBox (0, "Statusfenster", "Backup war nicht möglich") EndIf Func Backuppen() Local $BackupFileName = @YEAR & '-' & @MON & '-' & @MDAY Local $DriveLetter = DriveLetterFinden('Linda') Local $DriveLetter2 = DriveLetterFinden('mitalles') Local $Ordnerliste[4] $Ordnerliste[0]= 'keep' $Ordnerliste[1]= 'web' $Ordnerliste[2]= 'Bilder' $Ordnerliste[3]= 'privat' Local $sWinRAR = @ProgramFilesDir & '\winrar\' For $counter = 0 to 1 If Not (HeuteSchonGebackuped($Ordnerliste[$counter])) Then RunWait($sWinRAR & 'winrar a "C:\Backup\"' & $BackupFileName & '-Stick-' & $Ordnerliste[$counter] & ' ' & $DriveLetter & '\' & $Ordnerliste[$counter] ) AlteBackupsLoeschen($Ordnerliste[$counter]) Else MsgBox (0, "Statusfenster", "Heute wurde bereits ein Backup von " & $Ordnerliste[$counter] & " erstellt") EndIf Next For $counter = 2 to 3 If Not (HeuteSchonGebackuped($Ordnerliste[$counter])) Then RunWait($sWinRAR & 'winrar a "C:\Backup\"' & $BackupFileName & '-' & $Ordnerliste[$counter] & ' ' & $DriveLetter2 & '\' & $Ordnerliste[$counter] ) AlteBackupsLoeschen($Ordnerliste[$counter]) Else MsgBox (0, "Statusfenster", "Heute wurde bereits ein Backup von " & $Ordnerliste[$counter] & " erstellt") EndIf Next If @error Then return False Else return True EndIf EndFunc Func DriveLetterFinden($x) Local $aDrives = DriveGetDrive("ALL") For $i = 1 To UBound($aDrives) -1 If DriveGetLabel($aDrives[$i]) = $x Then return $aDrives[$i] EndIf Next EndFunc Func AlteBackupsLoeschen($ZuLoeschen) Local $Search = FileFindFirstFile("C:\Backup\*.*") Local $File While 1 If $Search = -1 Then ExitLoop EndIf $File = FileFindNextFile($Search) If @error Then ExitLoop If Not StringInStr( $File, @YEAR & '-' & @MON & '-' & @MDAY) Then If StringInStr( $File, $ZuLoeschen) Then FileDelete("C:\Backup\" & $File) EndIf EndIf WEnd EndFunc Func HeuteSchonGebackuped($ZuPruefen) Local $Search = FileFindFirstFile("C:\Backup\*.*") Local $File While 1 If $Search = -1 Then ExitLoop EndIf $File = FileFindNextFile($Search) If @error Then ExitLoop If StringInStr( $File, @YEAR & '-' & @MON & '-' & @MDAY) Then If StringInStr( $File, $ZuPruefen) Then return True Else return False EndIf EndIf WEnd EndFunc but the script will create new Backups of privat, keep and web even if the folder exists. Just for bilder it tells me that this file already exists, if it exist. what do I oversee here? I hope it is ok not to open a new thread for this
-
yes thanks I saw that I used {} instead of EndFunc but right now I just finished my first little autoit script ;Backup Script 29.11.09 Dim $BackupErfolgreich = Backuppen() If ($BackupErfolgreich) Then AlteBackupsLoeschen() MsgBox (0, "Statusfenster", "Backup erstellt, altes Backup gelöscht") Else MsgBox (0, "Statusfenster", "Backup war nicht möglich") EndIf Func Backuppen() Dim $BackupFileName = @YEAR & '-' & @MON & '-' & @MDAY Dim $DriveLetter = DriveLetterFinden('Linda') Dim $DriveLetter2 = DriveLetterFinden('mitalles') Local $Ordnerliste[4] $Ordnerliste[0]= 'keep' $Ordnerliste[1]= 'web' $Ordnerliste[2]= 'Bilder' $Ordnerliste[3]= 'privat' Dim $sWinRAR = @ProgramFilesDir & '\winrar\' For $counter = 0 to 1 RunWait($sWinRAR & 'winrar a "C:\Backup\"' & $BackupFileName & '-Stick-' & $Ordnerliste[$counter] & ' ' & $DriveLetter & '\' & $Ordnerliste[$counter] ) Next For $counter = 2 to 3 RunWait($sWinRAR & 'winrar a "C:\Backup\"' & $BackupFileName & '-' & $Ordnerliste[$counter] & ' ' & $DriveLetter2 & '\' & $Ordnerliste[$counter] ) Next If @error Then return False Else return True EndIf EndFunc Func DriveLetterFinden($x) $aDrives = DriveGetDrive("ALL") For $i = 1 To UBound($aDrives) -1 If DriveGetLabel($aDrives[$i]) = $x Then return $aDrives[$i] EndIf Next EndFunc Func AlteBackupsLoeschen() Local $Search = FileFindFirstFile("C:\Backup\*.*") Local $File While 1 If $Search = -1 Then ExitLoop EndIf $File = FileFindNextFile($Search) If @error Then ExitLoop If Not StringInStr( $File, @YEAR & '-' & @MON & '-' & @MDAY) Then FileDelete("C:\Backup\" & $File) EndIf WEnd EndFunc ... and it works. I'm proud and happy.
-
oh wait i found an error, plz ignor this post
-
hi and thx, I tried to use this in a function to also find not removable drives, but recieving 3 error msg Func FindingDriveLetter($x) { $aDrives = DriveGetDrive("ALL") For $i = 1 To UBound($aDrives) -1 If DriveGetLabel($aDrives[$i]) = $x Then return $aDrives[$i] EndIf Next } Dim $DriveLetter1 = FindingDriveLetter(Linda) Dim $DriveLetter2 = FindingDriveLetter(Paul) D:\backup.au3(3,28) : ERROR: syntax error (illegal character) Func FindingDriveLetter($x) { ~~~~~~~~~~~~~~~~~~~~~~~~~~~^ D:\backup.au3(5,31) : WARNING: $aDrives: possibly used before declaration. For $i = 1 To UBound($aDrives) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ D:\backup.au3(10,1) : ERROR: syntax error (illegal character) } ^ D:\backup.au3(5,31) : ERROR: $aDrives: undeclared global variable. For $i = 1 To UBound($aDrives) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ D:\backup.au3 - 3 error(s), 1 warning(s) Is it important to write the function first? I saw examples where the functions are at the end of the script, but if I do this I recieve even more error msgs
-
Hi, I would like to get the DriveLetter of my USB Stick called Linda. So the only way I know is to list all devices with DriveGetDrives and then check if one of the fetched drives got the name Linda. Is there an easier way to do this? Or did anybody got a piece of code for me, plz. :-)