All Activity

This stream auto-updates   

  1. Past hour
  2. Windows Image Acquition Object https://msdn.microsoft.com/en-us/library/windows/desktop/ms630826(v=vs.85).aspx#SharedSample011 The "WIA.Vector" COM Example posted earlier, Object example let me to other WIA COM Objects local $v $v = ObjCreate("WIA.vector") $v.Add(1) $v.Add(42) $v.Add(3) $v.Remove(1) $v.Remove(2) ConsoleWrite("$v(1) = " & $v(1) & @CRLF) $v.Clear $v.Add("This") $v.Add("Is") $v.Add("Cool") $v.Remove(1) $v.Remove(1) ConsoleWrite("$v(1) = " & $v(1) & @CRLF) Here are some quick and dirty examples I converted found on the net. Image Convert Format ; $lFormat = 2 ; 0 = BMP, 1 = GIF, 2 = JPEG, 3 = PNG, 4 = TIFF $sInFile = "C:\Temp\Logo.jpg" $sOutFile = @ScriptDir WIA_ConvertImage($sInFile,$sOutFile, 4) Func WIA_ConvertImage($sInitialImage, _ $sOutputImage, _ $lFormat, _ $lQuality = 85) Select Case $lFormat = 0 $sFormatID = "{B96B3CAB-0728-11D3-9D7B-0000F81EF32E}" $sExt = "BMP" Case $lFormat = 1 $sFormatID = "{B96B3CB0-0728-11D3-9D7B-0000F81EF32E}" $sExt = "GIF" Case $lFormat = 2 $sFormatID = "{B96B3CAE-0728-11D3-9D7B-0000F81EF32E}" $sExt = "JPEG" Case $lFormat = 3 $sFormatID = "{B96B3CAF-0728-11D3-9D7B-0000F81EF32E}" $sExt = "PNG" Case $lFormat = 4 $sFormatID = "{B96B3CB1-0728-11D3-9D7B-0000F81EF32E}" $sExt = "TIFF" EndSelect If $lQuality > 100 Then $lQuality = 100 $oWIA = ObjCreate("WIA.ImageFile") $oIP = ObjCreate("WIA.ImageProcess") $oIP.Filters.Add ($oIP.FilterInfos("Convert").FilterID) $oIP.Filters(1).Properties("FormatID") = $sFormatID $oIP.Filters(1).Properties("Quality") = $lQuality $oWIA.LoadFile($sInitialImage) ; --- $oWIA = $oIP.Apply($oWIA) If FileExists($sOutputImage & "\OutFile." & $sExt) Then FileDelete($sOutputImage & "\OutFile." & $sExt) EndIf $oWIA.SaveFile ($sOutputImage & "\OutFile." & $sExt) ConsoleWrite("File Saved : " & $sOutputImage & "\OutFile." & $sExt & @CRLF) EndFunc Image Resize $sInFile = "C:\Temp\Test.jpg" $sOutFile = @ScriptDir & "\Test.jpg" WIA_ResizeImage($sInFile,$sOutFile,100,200) Func WIA_ResizeImage($sInitialImage, _ $sResizedImage, _ $lMaximumWidth, _ $lMaximumHeight) $oWIA = ObjCreate("WIA.ImageFile") $oIP = ObjCreate("WIA.ImageProcess") $oIP.Filters.Add ($oIP.FilterInfos("Scale").FilterID) $oIP.Filters(1).Properties("MaximumWidth") = $lMaximumWidth $oIP.Filters(1).Properties("MaximumHeight") = $lMaximumHeight $oWIA.LoadFile($sInitialImage) $oWIA = $oIP.Apply($oWIA) If FileExists($sOutFile) Then FileDelete($sOutFile) EndIf $oWIA.SaveFile($sResizedImage) EndFunc Image File Properties local $Img = ObjCreate("WIA.ImageFile") ; $Img.LoadFile ( "C:\Temp\Plastiflex Logo New.jpg") $Img.LoadFile (@ScriptDir & "\Vector.bmp") local $s = "Width = " & $Img.Width & @CrLf _ & "Height = " & $Img.Height & @CrLf _ & "Depth = " & $Img.PixelDepth & @CrLf _ & "HorizontalResolution = " & $Img.HorizontalResolution & @CrLf _ & "VerticalResolution = " & $Img.VerticalResolution & @CrLf _ & "FrameCount = " & $Img.FrameCount & @CrLf ;ConsoleWrite($s & @CRLF) If $Img.IsIndexedPixelFormat then $s = $s & "Pixel data contains palette indexes" & @CrLf EndIf If $Img.IsAlphaPixelFormat then $s = $s & "Pixel data has alpha information" & @CrLf EndIf If $Img.IsExtendedPixelFormat then $s = $s & "Pixel data has extended color information (16 bit/channel)" & @CrLf EndIf If $Img.IsAnimated then $s = $s & "Image is animated" & @CrLf EndIf If $Img.Properties.Exists("40091") then $v = $Img.Properties("40091").Value $s = $s & "Title = " & $v & @CrLf EndIf If $Img.Properties.Exists("40092") then $v = $Img.Properties("40092").Value $s = $s & "Comment = " & $v & @CrLf EndIf If $Img.Properties.Exists("40093") then $v = $Img.Properties("40093").Value $s = $s & "Author = " & $v & @CrLf EndIf If $Img.Properties.Exists("40094") then $v = $Img.Properties("40094").Value $s = $s & "Keywords = " & $v & @CrLf EndIf If $Img.Properties.Exists("40095") then $v = $Img.Properties("40095").Value $s = $s & "Subject = " & $v & @CrLf EndIf ConsoleWrite($s & @CRLF) Local $IP = ObjCreate("WIA.ImageProcess") For $fi In $IP.FilterInfos $s = $fi.Name & @CRLF & _ "==================================================" & @CRLF & _ $fi.Description ConsoleWrite( $s & @CRLF) Next Enjoy ptrex
  3. @smartkey AutoIt comes with a StringReplace function, to which yours seems very similar. What would this provide that the original does not, except two fewer parameters?
  4. Today
  5. RunWait stops the script until whatever you ran with it closes, that's probably half the problem you were having.
  6. Ok this seems wrong/sloppy but i got it working (i cleaned up the sleeps too). i compiled the install script with the installer. then compiled that script with the rest of of it and added a RunWait :-/ is there a way around this maybe incorporating ProcessWaitClose? Step 1 (compiled as 'CCleaner1.exe') #RequireAdmin #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_UseX64=n #AutoIt3Wrapper_Add_Constants=n #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** FileInstall("C:\Users\ccsetup.exe", "C:\ccsetup.exe", 1) AutoItSetOption('MouseCoordMode', 0) Run('C:\ccsetup.exe') Install() Func Install() Local $CCHandle = WinGetHandle("[CLASS:#32770]", "CCleaner v5.39 Setup") While $CCHandle = 0x00000000 Sleep(1500) $CCHandle = WinGetHandle("[CLASS:#32770]", "CCleaner v5.39 Setup") WEnd WinWait($CCHandle) WinActivate($CCHandle) WinWaitActive($CCHandle, '', 18) ControlClick($CCHandle, "", 1005) ControlCommand($CCHandle, "", 'Button4', 'UnCheck') ControlCommand($CCHandle, "", 'Button5', 'Check') ControlCommand($CCHandle, "", 'Button6', 'UnCheck') ControlCommand($CCHandle, "", 'Button7', 'UnCheck') ControlCommand($CCHandle, "", 'Button8', 'UnCheck') ControlClick($CCHandle, "", 'Button3') EndFunc ;==>Install Step 2 #RequireAdmin #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_UseX64=n #AutoIt3Wrapper_Run_Tidy=y #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** FileInstall("C:\Users\CCleaner1.exe", "C:\CCleaner1.exe", 1) SplashTextOn("CCleaner", "Installing Please do not touch the keyboard or mouse until installation is complete.", 300, 100) AutoItSetOption('MouseCoordMode', 0) RunWait('C:\CCleaner1.exe') While 1 Local $CCHandle1 = WinGetHandle("[CLASS:#32770]", "CCleaner v5.39 Setup Completed") While $CCHandle1 = 0x00000000 Sleep(1500) $CCHandle1 = WinGetHandle("[CLASS:#32770]", "CCleaner v5.39 Setup Completed") WEnd WinWait($CCHandle1) WinActivate($CCHandle1) WinWaitActive($CCHandle1, '', 18) ControlCommand($CCHandle1, "", 'Button3', 'UnCheck') ControlClick($CCHandle1, "", 'Button1') Local $CCHandle2 = WinGetHandle("Piriform CCleaner") While $CCHandle2 = 0x00000000 Sleep(1500) $CCHandle2 = WinGetHandle("Piriform CCleaner") WEnd WinWait($CCHandle2) WinActivate($CCHandle2) WinWaitActive($CCHandle2, '', 18) ControlClick($CCHandle2, "&Options", 1003) WinWaitActive($CCHandle2) ControlClick($CCHandle2, "Monitoring", 1021) Send("{ESC}") WinWaitActive($CCHandle2, "Enable &system monitoring") ControlCommand($CCHandle2, "Enable &system monitoring", "Button12", 'UnCheck') WinWaitActive($CCHandle2, "&Enable Active Monitoring") ControlCommand($CCHandle2, "&Enable Active Monitoring", "Button15", 'UnCheck') Local $CCHandle3 = WinGetHandle("Disable Active Monitoring") While $CCHandle3 = 0x00000000 Sleep(1500) $CCHandle3 = WinGetHandle("Disable Active Monitoring") WEnd WinWait($CCHandle3) WinActivate($CCHandle3) WinWaitActive($CCHandle3, '', 18) Sleep(50) Send("{TAB 2}") Send("{ENTER}") ControlClick($CCHandle2, "&Cleaner", 1000) FileDelete('C:\CCleaner1.exe') FileDelete('C:\ccsetup.exe') If Not FileExists('C:\ccsetup.exe') Then Exit EndIf WEnd
  7. I use the following code to paste in a hard-coded file link to a file upload dialog box in IE WinWait("Choose File to Upload") $hChoose = WinGetHandle("Choose File to Upload") Sleep(1000) ControlSetText($hChoose, "", "Edit1", "C:\Path\To\File.doc") Sleep(1000) Send("{ENTER}") Sleep(1000) It may work fine without the Sleep's but on the particular box I have this running on I was getting inconsistent results without them.
  8. http://lmgtfy.com/?q=rtfm
  9. thats all i needed. thanks I don't know your nerd lingo.
  10. Look at function InputBox()
  11. RTFM. Look up InputBox in the help file.
  12. Please don't say read the help files and be nice. I am super new to doing this kind of stuff... I have tried and cannot find something that prompts a box that says: How many times do you want to loop? (then you type in a number like 12) and it loops 12 times. Here is my script below. I want to start this script, input the number of times I want to loop, and then start. Then it stops after it goes through that number of times. MouseClick("left",942,409,1) sleep(500) MouseClick("left",942,409,1) sleep(500) Send("{CTRLDOWN}{HOME}{CTRLUP}") sleep(500) Send("{CTRLDOWN}c{CTRLUP}") MouseClick("left",567,-833,1) sleep(500) Send("{CTRLDOWN}v{CTRLUP}") sleep(100) Send("{ENTER}") sleep(100) Send("{TAB}") sleep(100) Send("{TAB}") sleep(100) Send("{TAB}") sleep(100) Send("{TAB}") sleep(100) Send("hardware{ENTER}") sleep(400) Send("{TAB}laptop{ENTER}") sleep(400) MouseClick("left",942,409,1) sleep(500) MouseClick("left",942,409,1) sleep(500) Send("{CTRLDOWN}{HOME}{CTRLUP}") sleep(100) Send("{RIGHT}") sleep(100) Send("{CTRLDOWN}c{CTRLUP}") sleep(400) MouseClick("left",642,-457,1) sleep(400) Send("{CTRLDOWN}v{CTRLUP}") sleep(400) MouseClick("left",942,409,1) sleep(500) MouseClick("left",942,409,1) sleep(500) Send("{CTRLDOWN}{HOME}{CTRLUP}") sleep(100) Send("{RIGHT}") sleep(100) Send("{RIGHT}") sleep(100) Send("{CTRLDOWN}c{CTRLUP}") sleep(400) MouseClick("left",642,-457,1) sleep(400) Send("{TAB}") sleep(100) Send("{TAB}") sleep(100) Send("{TAB}") sleep(100) Send("{ENTER}") sleep(400) Send("{TAB}") sleep(100) Send("{TAB}") sleep(100) Send("{TAB}") sleep(100) Send("{TAB}") sleep(100) Send("{CTRLDOWN}v{CTRLUP}") sleep(400) Send("{TAB}") sleep(100) Send("{ENTER}") sleep(400) MouseClick("left",942,409,1) sleep(500) MouseClick("left",942,409,1) Send("{CTRLDOWN}{HOME}{CTRLUP}") sleep(100) Send("{SHIFTDOWN}{RIGHT}{RIGHT}{SHIFTUP}{CTRLDOWN}-{CTRLUP}") sleep(100) Send("{ENTER}") sleep(100) MouseClick("left",411,-937,1)
  13. @BusterProg, Welcome to the AutoIt forum. Unfortunately you appear to have missed the Forum rules on your way in. (there is also a link in my signature) Please read them now particularly the bit about not discussing game automation - and then you will understand why you will get no help and this thread will now be locked. See you soon with a legitimate question I hope. Jos
  14. Yeah I imagine thats faster I suppose it depends how many files he has to drop/ how often and If he wants to subclass his control..
  15. You might also use _WinAPI_DragQueryFileEx (with flag 1 - files only)
  16. I haven't been able to locate any explanation of how to detect and process an Undo request (ctrl+z ... not a GUI button) while a GUI is active in GUIOnEventMode. What is a good method to define a function for that specific keyboard input? (All the buttons and "click on label" elements of my GUI work fine, BTW ... so I'm pleased with OnEventMode.) If I can catch the key input, my GUI can determine what, if anything, to do. IOW, the key input shouldn't be associated with any particular control. Thanks in advance for any help.
  17. Hmm... good to know. Thanks for that orbs. But regarding running as SYSTEM, I thought that only applied if using the -s switch. But maybe it always does run as SYSTEM, but launches the executable separately according to the psexec params (ie. -i [session])? I'm sure this can be done, but am under the impression that's a bit beyond me currently. That said, the paexec source is available and could be studied to determine the exact mechanisms used. Who knows, maybe if I get more time I can start digging into this. I was actually kind of wondering if any UDF's are out there already, but looks like that isn't the case. No big deal, though. I've already been playing with the TCP listen and send functions more. With those, it's looking very doable to get where I want to go. So like you said, short term I'm going to be working around psexec's limitations, and hopefully long term I can come up with something native. Thanks Chimp. Wondering if WMI is what psexec is using to do its thing?
  18. Step 1: Go and ask on another forum. Game bot talk is banned here.
  19. I want to create the macro for a game and I need use my pc at the same time, so I'm a beginner and don't know how to create a macro just for one software and using my mouse and keyboard without any problem. I would be very happy if you help me
  20. You could use either MouseClick or ControlClick, because it's not going to be using the touchscreen part of the computer at all.
  21. Today I want to share this little project made to check and notify the expiration of domain users password, in a Microsoft domain. Briefly, the script check users domain password expiration and takes actions. The script can work on multiple domain groups, taking different actions for every group, there is an .ini file with some options. Groups to be checked are defined in the .ini, and the groups must contain only users no other groups. The list of users of every group is obtained and if the password expiration in (remaining) days is matched (two possibilities) an email is sent. It can be a mail sent directly to the user (ini file : tomail=user) or it can be a mail sent to only one address (ini file : tomail=the@mail.it) (like domain admins...) and in this case the mail contains a report with the users approaching expiration. An operation log is always generated. In the ini (also the posted one) you can set to have no mail sent (for testing) and/or to have a GUI, but also the GUI is intended only for test, this script is scheduled on a server not logged in, so normally no GUI . The code: #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Icon=Icone\Faenza\117.ico #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** ; PEG ; Password Expiration Guardian ; (C) NSC 2018 ; check user domain password expiration and takes actions ; the script can work on multiple domain groups, taking differente actions for every group. ; the groups must contains only users no other groups ; the list of users of every group is obtained and if the password expiration in day is matched (two possibilities) an email is sent. ; It can be a mail sent directly to the user (ini file : tomail=user) ; or it can be a mail sent to only one address (ini file : tomail=the@mail.it) ; and in this case the mail contains a report with the users approaching expiration ; V.0.5 check based on one domain group ; V.1.0 ini file and check based on multiple domain groups ; V.1.5 ini file with general section to activate "test" GUI, and to enable disable mail send #include <AD.au3> #include <File.au3> #include <GuiEdit.au3> #include <_zip.au3> #include <Date.au3> #include <Inet.au3> #include <GUIConstantsEx.au3> #include <GuiEdit.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Global $appname = "PEG", $appver = "V.1.5" Global $inifile = @ScriptDir & "\" & $appname & ".ini" Global $geleft = 5, $getop = 5, $gewidth = 790, $geheight = 540 Global $gollogcount = 0, $lastlog = "sicrlf", $cachelog = "", $guititle = "PEG " & $appver, $Gollogedit, $logfile = @ScriptDir & "\" & $appname & "_LOG_", $months2NOTzip = 3 Global $INIgroup, $INItomail, $INImailsubject, $INIsmpt, $INIfromname, $INIfromaddress, $INIdays1, $INIdays2, $INItosend, $arrayINIsections, $guiactive ; START program GOLLOG(">>>>>> " & $appname & " " & $appver & " START >>>>>>") CFGctrl() If $guiactive = 1 Then GUI() $groupnumber = 0 While $groupnumber < $arrayINIsections[0] $groupnumber += 1 If $arrayINIsections[$groupnumber] <> "general" Then CFGload($arrayINIsections[$groupnumber]) loaduserS() EndIf WEnd If $guiactive = 1 Then While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE GOLLOG("<<<< STOP <<<<") Exit EndSwitch WEnd EndIf GOLLOG("<<<<<< PEG STOP <<<<<<<") Exit ;STOP program Func GUI() GUICreate($guititle, 800, 560, 100, 200, -1) GUISetBkColor(0x693F54) ; will change background color $Gollogedit = GUICtrlCreateEdit("", $geleft, $getop, $gewidth, $geheight, BitOR($ES_AUTOVSCROLL, $ES_AUTOHSCROLL, $ES_WANTRETURN, $WS_BORDER, $WS_VSCROLL)) GUICtrlSetBkColor(-1, 0xC7BBC1) GUICtrlSetData(-1, "" & @CRLF) GUICtrlSetFont(-1, 9, 800, 0, "consolas") GUICtrlSetColor(-1, 0x090608) GUISetState(@SW_SHOW) GOLLOG("PEG " & $appver & " gui STARTED") EndFunc ;==>GUI Func loaduserS() GOLLOG("workin on group: " & $INIgroup) Local $Nscad = 0 Dim $report[1] = ["Report:"] Local $singlereport = "" Local $usermail = "" local $username = "" Local $datediff = "" Local $arrayuserpsw Local $iErr _AD_Open() $search1 = _AD_GetGroupMembers($INIgroup) ;$search1 = _AD_RecursiveGetGroupMembers($INIgroup); testing recursive .. in the future maybe If @error = 0 Then Local $conta1 = 0 While $search1[0] > $conta1 $conta1 += 1 $arrayuserpsw = _AD_GetPasswordInfo($search1[$conta1]) $datediff = _DateDiff("D", _NowCalc(), $arrayuserpsw[9]) GOLLOG("USER: " & $search1[$conta1]) GOLLOG("Password expires on: " & $arrayuserpsw[9] & " in " & $datediff & " days") If $datediff = $INIdays1 Or $datediff = $INIdays2 Then GOLLOG("expiration match !") If $INItomail = "user" Then $usermail = _AD_GetObjectAttribute($search1[$conta1], "mail") GOLLOG("sending mail to: " & $usermail) Dim $report[1] = ["La tua password scadra' " & _DateTimeFormat($arrayuserpsw[9], 1) & ", entro " & $datediff & " giorni."] _ArrayAdd($report, "Modificala per tempo !") If $INItosend = 0 Then GOLLOG("Not sent mail " & $Nscad & ": ") GOLLOG("from :" & $INIfromname & " | " & $INIfromaddress) GOLLOG("to :" & $usermail & " | subject: " & $INImailsubject) Local $reporttext = _ArrayToString($report) GOLLOG("text :" & $reporttext) Else Local $iResponse = _INetSmtpMail($INIsmpt, $INIfromname, $INIfromaddress, $usermail, $INImailsubject, $report, "EHLO " & @ComputerName, "-1") ; perla pearl mail send HS smtp (ehlo required) $iErr = @error If $iResponse = 1 Then GOLLOG("Success! " & "Mail to user sent") Else GOLLOG("Error! " & "Mail failed with error code " & $iErr) EndIf EndIf Else $username = _AD_GetObjectAttribute($search1[$conta1], "displayname") _ArrayAdd($report, "USER: " & $username) _ArrayAdd($report, "Password expires on: " & $arrayuserpsw[9] & " in " & $datediff & " days") $Nscad += 1 EndIf EndIf WEnd If $Nscad > 0 And $INItomail <> "user" Then _ArrayAdd($report, $Nscad & " user passwords near expiration") If $INItosend = 0 Then GOLLOG("Not sent mail " & $Nscad & ": ") GOLLOG("from :" & $INIfromname & " | " & $INIfromaddress) GOLLOG("to :" & $INItomail & " | subject: " & $INImailsubject) Local $reporttext = _ArrayToString($report) GOLLOG("text :" & $reporttext) Else Local $iResponse = _INetSmtpMail($INIsmpt, $INIfromname, $INIfromaddress, $INItomail, $INImailsubject, $report, "EHLO " & @ComputerName, "-1") ; perla pearl mail send HS smtp (ehlo required) Local $iErr = @error If $iResponse = 1 Then GOLLOG("Success! " & "Mail sent") Else GOLLOG("Error! " & "Mail failed with error code " & $iErr) EndIf EndIf EndIf GOLLOG("checked n° " & $conta1 & " users") Else GOLLOG("error in user search " & @error) EndIf _AD_Close() EndFunc ;==>loaduserS Func GOLLOG($logtext) ; Gollog V.2.3 gestione CRLF si o no ; gestione a capo automatico oltre i xx caratteri; gestione pulitura ogni totmila char Perla pearl ; basta aggiungere |nocrlf50 a fine stringa, dove 50 sono gli xx caratteri, conta la prima riga dove si supera quel limite. ; to declare $gollogcount = 0,$lastlog="sicrlf",$cachelog="",$guititle = "nomegui",$Gollogedit,$logfile = @ScriptDir & "\GOLLOG_LOG_", $months2NOTzip = 3 ; e anche le misure dell'edit: $geleft = 32, $getop = 32, $gewidth = 553, $geheight = 377 ; #include <File.au3> #include <GuiEdit.au3> #include <_zip.au3> ; to insert FUNCs: GOLLOG CLEANEDIT GOLzipZIP $gollogcount += StringLen($logtext) ;Local $logfile = @ScriptDir & "\GOLLOG_LOG_" ; now global Local $logfiletimerange = @YEAR & @MON Local $linelimit = StringRight($logtext, 2) If StringRight($logtext, 9) = "|nocrlf" & $linelimit Then $logtext = StringTrimRight($logtext, 9) Local $acapo = "no" Else Local $acapo = "si" $gollogcount += 4 If $gollogcount > 13000 Then Sleep(3000) cleanedit() ; MsgBox(64, "debug", $conta) $gollogcount = 0 EndIf EndIf If $acapo = "no" And (StringLen($cachelog) <= $linelimit) Then ;pearl perla non a capo se If $lastlog = "nocrlf" Then If WinExists($guititle) Then ; per non scrivere in gui se questa non esiste _GUICtrlEdit_AppendText($Gollogedit, $logtext) EndIf Else If WinExists($guititle) Then ; per non scrivere in gui se questa non esiste _GUICtrlEdit_AppendText($Gollogedit, @MDAY & "/" & @MON & "_" & @HOUR & ":" & @MIN & " " & $logtext) EndIf EndIf $cachelog = $cachelog & $logtext $lastlog = "nocrlf" Else If $lastlog = "nocrlf" Then If WinExists($guititle) Then ; per non scrivere in gui se questa non esiste _GUICtrlEdit_AppendText($Gollogedit, $logtext & @CRLF) EndIf $cachelog = $cachelog & $logtext _FileWriteLog($logfile & $logfiletimerange & ".txt", $cachelog) $cachelog = "" Else If WinExists($guititle) Then ; per non scrivere in gui se questa non esiste _GUICtrlEdit_AppendText($Gollogedit, @MDAY & "/" & @MON & "_" & @HOUR & ":" & @MIN & " " & $logtext & @CRLF) EndIf _FileWriteLog($logfile & $logfiletimerange & ".txt", $logtext) EndIf $lastlog = "sicrlf" EndIf EndFunc ;==>GOLLOG Func cleanedit() ; cleaning of edit every n° lines (in program put if $nlines > xlines then this function) GUICtrlDelete($Gollogedit) $Gollogedit = GUICtrlCreateEdit("", $geleft, $getop, $gewidth, $geheight) ;, BitOR($ES_AUTOVSCROLL, $ES_AUTOHSCROLL, $ES_WANTRETURN, $WS_BORDER)) GUICtrlSetData(-1, "" & @CRLF) GUICtrlSetFont(-1, 9, 800, 0, "consolas") GUICtrlSetColor(-1, 0090608) GUICtrlSetBkColor(-1, 0xF0DAE5) GUICtrlSetCursor(-1, 3) EndFunc ;==>cleanedit Func GOLzipLOG($months2NOTzip) ; zipping old log leaving unzipped only n months GOLLOG("Starting old logs zipping..") ; path extraction zone Local $logfiletimerange = @YEAR & @MON Local $sDrive = "", $sDir = "", $sFileName = "", $sExtension = "" Local $arraylogpath = _PathSplit($logfile & $logfiletimerange & ".txt", $sDrive, $sDir, $sFileName, $sExtension) Local $logpath = $arraylogpath[1] & $arraylogpath[2] Local $hSearch = FileFindFirstFile($logfile & "*.txt") ; searching for logs Local $logconta = 0 While 1 ; single file processing cycle Local $sFileName = FileFindNextFile($hSearch) ; If there is no more file matching the search. If @error Then ExitLoop Local $stringtime = StringTrimRight(StringRight($sFileName, 10), 4) ;obtaining year-month like 201609 If $logfiletimerange - $stringtime > $months2NOTzip Then ;zipping If Not FileExists($logfile & ".zip") Then If Not _Zip_Create($logfile & ".zip", 1) Then GOLLOG("Error " & @error & " creating " & $logfile & ".zip") Else GOLLOG("Created new log archive: " & $logfile & ".zip") EndIf Else GOLLOG("adding to archive: " & $logfile & ".zip") EndIf If Not _zip_additem($logfile & ".zip", $logpath & $sFileName) Then GOLLOG("Error " & @error & " zipping: " & $logpath & $sFileName) Else GOLLOG("Added: " & $logpath & $sFileName) $logconta += 1 If Not FileDelete($logpath & $sFileName) Then GOLLOG("ERROR - Unable to DELETE log file " & $logpath & $sFileName) EndIf EndIf EndIf WEnd GOLLOG("Finished = " & $logconta & " log files zipped") EndFunc ;==>GOLzipLOG Func CFGctrl() ; check ini files and load section names GOLLOG("checkin' INI file..|nocrlf50") If FileExists($inifile) Then $guiactive = IniRead($inifile, "general", "GUI", "?") If $guiactive = "?" Then GOLLOG("INI incomplete, missing section 'general', value GUI") ExitwithError() EndIf GOLLOG("reading section names...|nocrlf50") $arrayINIsections = IniReadSectionNames($inifile) GOLLOG("N°" & $arrayINIsections[0] - 1 & " groups to process") Else $message1 = "error: no saved settings !?" GOLLOG($message1) ExitwithError() EndIf GOLLOG("..completed") EndFunc ;==>CFGctrl Func CFGload($section) ; load single ini file section values $INIgroup = IniRead($inifile, $section, "group", "?") $INItomail = IniRead($inifile, $section, "tomail", "?") $INItosend = IniRead($inifile, $section, "tosend", "?") $INIdays1 = IniRead($inifile, $section, "days1", "?") $INIdays2 = IniRead($inifile, $section, "days2", "?") $INImailsubject = IniRead($inifile, $section, "mailsubject", "?") $INIsmpt = IniRead($inifile, $section, "smtp", "?") $INIfromname = IniRead($inifile, $section, "fromname", "?") $INIfromaddress = IniRead($inifile, $section, "fromaddress", "?") EndFunc ;==>CFGload Func ExitwithError() GOLLOG("**********ERROR and STOP****************") Exit EndFunc ;==>ExitwithError The example .ini [group1] group=G_IT_PASSWORD_MONITORED days1=5 days2=2 tomail=yourgroup@yourdomain.it ;tosend=user; send mails to the domain user mail address, otherwise send to specified address tosend=0 ;tosend ;1 send mails, 0 disable mails for testing mailsubject=Domain users going to expire passwords smtp=smtp.your.own.server fromname=Password Expiration Guardian fromaddress=PEG@NSC.it [group2] group=G_IT_PASSWORD_NOTIFIED days1=5 days2=2 tomail=user ;tosend=user; send mails to the domain user mail address, otherwise send to specified address tosend=0 ;tosend ;1 send mails, 0 disable mails for testing mailsubject=Password is expiring ! smtp=smtp.your.own.server fromname=Password Expiration Guardian fromaddress=PEG@NSC.it [general] GUI=1 ;1 gui ON for testing, 0 gui disabled PEG.zip
  22. Top job Holder, trying this in a project and looks good. Found an interesting issue when used and you set the background colour of a button on a gui though; ...even without using any of the functions and by just including ModernMenu.au3 a coloured button is blanked. It is still there and functions but not visible. Example: (un-comment the include to see issue) #include <GUIConstantsEx.au3> #include <ColorConstants.au3> ;#include <ModernMenu.au3> Example() Func Example() Local $hGUI = GUICreate("Example", 300, 200) Local $idHello = GUICtrlCreateButton("Hello", 120, 170, 85, 25) Local $idClose = GUICtrlCreateButton("Close", 210, 170, 85, 25) GUICtrlSetBkColor($idHello, $COLOR_SKYBLUE) GUISetState(@SW_SHOW, $hGUI) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $idClose ExitLoop Case $idHello MsgBox(0, "Still Here", "Hi there") EndSwitch WEnd GUIDelete($hGUI) EndFunc ;==>Example Any suggestions ?
  23. WinGetCaretPos() returns position relative to foreground window but MouseClick() has absolute (desktop) position. So you have to get position of your window by WinGetPos() and add your caret's X value to window's X value.
  24. I just learned about IPAM ( Explained - Windows Server 2016 ) thanks to you posting, now, how does phpIPAM does what ?, could not find an explanation in english ( video that is ). Thanks for sharing PS: I may have found an explanation on this video of solarwinds.
  25. Greetings all, I'm trying to use WinGetCaretPos and MouseClick in concert. I *think* this should work, but it doesn't. Any ideas would be much appreciated. ;Below this fills out a field and moves the carat into the position to copy the x/y location SEND("loc{TAB}") ;LOCATION FIELD, I want this to grab the x coord position from the array and put it into the mouseclick below. Local $aCaretPos3 = WinGetCaretPos() local $sVariable1 = $aCaretPos3[0] ;plug the variable into the mouseclick. It changes every instance, so it needs to refresh with loop. _WinWaitActivate("New service work order","") MouseClick("left",$sVariable1,385,1,0) ;rest of script that works great. Working script with carat trials.au3
  26. Probably getting the wrong handle on win10 ( wrong instance number ) $hSysTray = ControlGetHandle("[Class:Shell_TrayWnd]", "", "[Class:ToolbarWindow32;Instance:" & (@OSVersion = "WIN_10" ? 3 : 1) & "]")
  27. @Melleys, Welcome to the AutoIt forum. Unfortunately you appear to have missed the Forum rules on your way in. (there is also a link in my signature) Please read them now particularly the bit about not discussing game automation - and then you will understand why you will get no help and this thread will now be locked. See you soon with a legitimate question I hope. Jos
  1. Load more activity