All Activity

This stream auto-updates   

  1. Past hour
  2. 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.
  3. http://lmgtfy.com/?q=rtfm
  4. thats all i needed. thanks I don't know your nerd lingo.
  5. Look at function InputBox()
  6. RTFM. Look up InputBox in the help file.
  7. 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)
  8. Today
  9. @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
  10. 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..
  11. You might also use _WinAPI_DragQueryFileEx (with flag 1 - files only)
  12. 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.
  13. 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?
  14. Step 1: Go and ask on another forum. Game bot talk is banned here.
  15. 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
  16. You could use either MouseClick or ControlClick, because it's not going to be using the touchscreen part of the computer at all.
  17. 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
  18. 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 ?
  19. 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.
  20. 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.
  21. 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
  22. Probably getting the wrong handle on win10 ( wrong instance number ) $hSysTray = ControlGetHandle("[Class:Shell_TrayWnd]", "", "[Class:ToolbarWindow32;Instance:" & (@OSVersion = "WIN_10" ? 3 : 1) & "]")
  23. @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
  24. I'm creating a bot to play this discord game for me, pok├ęcord. In this game, we actually flood the chat to gain xp with our pokemon and to catch another. To catch a pokemon, we have to wait it appears in the chat, like the photo (https://prnt.sc/iisiu7). I start programming actually today, but i really want to resoolve this problem. -snip- OBS: Sorry about my english, hope u can help me
  25. I use this to log into a website. #include <ie.au3> $oIE = _IECreate ("https://YourWebSite.com",Default, Default, Default, Default) Sleep (3000) _IEErrorHandlerRegister() ;$HWND = _IEPropertyGet($oIE, "hwnd") WinMove("Virtual Office - Internet Explorer", "", 0, 0, 400, 400) Sleep (6000) WinSetState("Virtual Office - Internet Explorer", "", @SW_MAXIMIZE) Sleep (2000) Send("YourUserName") Sleep(2000) Send("{TAB}") Sleep(2000) Send("YourPassword") Sleep(2000) MouseClick($MOUSE_CLICK_LEFT, 587, 560, 2) You will have to change the mouse cords to where they are on your website. I run this daily with very little issues. I do the WinMove to get Internet Explorer to my main screen (run dual screens). Then maximize the IE windows so that the mouse cords are always in the correct location. Hope this helps you
  26. Have you checked out the ControlClick command? Sends a mouse click command to a given control.
  27. Hello, I've been searching the autoit forums for a while now and had a look through the autoit documentation But I cant seem to find an answer to my question: What would be the equivalent of the Mouseclick() function if I wanted my script to interact through the touchscreen I have no idea how Windows 10 handles such an event. Thank you for any help.
  1. Load more activity