Jump to content

Search the Community

Showing results for tags 'script'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • Forum
  • AutoIt

Calendars

  • Community Calendar

Found 52 results

  1. Hi. I can open the editor with out problems but I can not compile because it is placed on another partition diferent from C. Can you provide an update of this bug?
  2. Hi guys, Some functions of my script are running slowly. Very slow. What is the reason? My Code: <snip>
  3. !!AUTOIT SCRIPT LOOP!!

    While 1 / / / A whole bunch of codes found in help and here: https://www.autoitscript.com/autoit3/docs/ / / / WEnd OR: HotKeySet("{ESC}", "Terminate") While 1 MouseClick("Right",674,422) MouseClick("Left",673,447) Sleep(2000) / / / A whole bunch of codes found in help and here: https://www.autoitscript.com/autoit3/docs/ / / / MouseClick("Left",675,339) SLeep(3000) WEnd Func Terminate()     Exit 0 EndFunc Sorry if i should't let this here to be found by newbies like me -.-'
  4. Hello all I found this function in the Internet It is to play audio files from the compiled script I did not understand just one thing on this function func play($name, $wait = 0) local Const $SND_RESOURCE = 0x00040004 local Const $SND_ASYNC = 1 ; Play the file - the script will pause as it sounds if $wait = 0 then DllCall("winmm.dll", "int", "PlaySound", "str", $name, "hwnd", 0, "int", BitOR($SND_RESOURCE, $SND_ASYNC)) else DllCall("winmm.dll", "int", "PlaySound", "str", $name, "hwnd", 0, "int", $SND_RESOURCE) endIf return 1 endFunc What I did not understand was this variable local Const $SND_RESOURCE = 0x00040004 I know that this variable is contains the resource name But what if I want to change the name of the resource what i'll do? can i do that? Thanks in advance
  5. Restart the script

    Hello forum users! At some point I had a need to restart my script. Is it possible to do this with autoit or do I need to connect additional scripts like .cmd or .bat? For example: i have only script.au3 and it's running. Wich code shoud i use to exit from the script and start it again?
  6. Hello, How can I automatically download a list of zip files, like the ones in the quote, using a AutoIt script? Is it possible with AutoIt script?
  7. Hi, Ich hab ein Script für Windows Updates, dass nach dem OOBE aufgerufen werden soll. Run/RunOnce ist daher nicht möglich. Stattdessen möchte ich das Script in den Autostart schreiben lasse. Wenn die OOBE beendet wird und der Administrator angemeldet wird, soll das Update-Script einmalig aufgerufen werden und sich anschl. selbst löschen. Lang rede, kurzer Sinn: Wie kann ich folgendes Script in den Autostart schreiben? RunWait(@ComSpec & " /c " & "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -File C:\UA\Scripts\win-updates.ps1 -MaxUpdatesPerCycle 100 -RestartRequired 1", "") Ich würde ungern eine BAT oder EXE reinkopieren, da ich es unsauber finde. Die müsste ja auch zusätzlich irgendwo liegen. Danke Eggsplorer
  8. Good morning everyone I worked a bit on a little project of mine, and I managed to do what I was trying to do, or, automate a quiz in AutoIt. Now, everything works fine but, in order to achieve what I'm trying to achive, I'd like to make this script run faster. I'll attach a portion of the code in order to let you understand what my script does. $objIE_h1 = _IETagNameGetCollection($objIE, "h1") ; Take the text of the answer If @error Then ConsoleWrite("Errore durante la lettura degli h1 nella pagina. - Errore: " & @error & @CRLF) Else For $objElement In $objIE_h1 $strInnerText = $objElement.innerText Next Select Case StringInStr($strInnerText, "QUESTION") ; Here is the question ; PS4 PRO $objSpans = _IETagNameGetCollection($objIE, "span") ; Answers are stored here For $objElement In $objSpans If $i >= 4 Then $strAnswer = $objElement.innerText ; Take the text of the answer n° 0, 1, 2, 3 If StringInStr($strAnswer, "CORRECT ANSWER") Then ; If I match the correct answer, then, I have to click on the input with answer id = answer_i $j = $i - 4 $objInput = _IEGetObjById($objIE, "answer_" & $j) If @error Then ConsoleWrite("Errore durante la lettura della risposta #" & $i & " - Errore: " & @error & @CRLF) Else _IEAction($objInput, "click") If @error Then ConsoleWrite("Errore durante il click sull'elemento. - Errore: " & @error) Else ConsoleWrite($j & ") Risposta: " & $strAnswer & @CRLF) ExitLoop EndIf EndIf EndIf $i+=1 Else $i+=1 EndIf Next $i = 0 $j = 0 This is what my script does. Questions are 20, in which I have 15 multiple choice question, 2 images ( on which I use _IEImgClick() ), and 3 text inputs ( a simple send with the text I have to enter ). How can I make all of these, faster? If I reach this goal, I've probably done one of my best goals in life, and I'd like to share my happiness with you, giving a huge donation to this fantastic community! Thanks for your help
  9. Hellow everybody, I tryed to manipulate a game called "Assault Cube" which is a easy beginning in coding. I run the code but the wished value doesn't change, i don't understand why. The Pointers are fine, I checked that the pointers don't change every time while restart the game. My Code: <snip> _____________________________________________________________________________________________________________________________________________________________________________________________ Checklist: The Offsets are 18C & 4 In Cheat Engine: ("ac_client.exe"+0010F418) <- Pointer 4 Bytes = 'dword'
  10. Hello How are you I have a question, please. I've created a window and i need when i run the script if it detect an other copy from the same script was runing the script close the first copy Automatically and run a new copy I want an example to understand it
  11. Please Somebody Help me i am trying to create new script but, i don't know how to create it. I am Creating script like this : ; My script here [First Script] Check the internet connection, if internet connected then ; My Script here [Second Script] If internet not connected, wait for connect, after connected run my second script If Control id/windows/title matched do nothing and end/exit autoit script If Control id/windows/title not matched repeat my first and second script again until control id/windows/tittle not matched match with : >>>> Window <<<< Title: PS :: Version - 2.8.0.0 - [PS Bill] Class: WindowsForm734a Position: -8, -8 Size: 1382, 744 Style: 0x17CD0000 ExStyle: 0x00050100 Handle: 0x0000000000130572 >>>> Control <<<< Class: WindowsForm734a Instance: 15 ClassnameNN: WindowsForm34a15 Name: BillPrint Advanced (Class): [NAME:BillPrint] ID: 7875 Text: Position: 39, 310 Size: 1221, 306 ControlClick Coords: 745, 20 Style: 0x56010000 ExStyle: 0x00000000 Handle: 0x00000000000C0468
  12. I am attempting to run an Autoit.exe with schtasks every weekday @ 9:05 am. I have the below C:\>SchTasks /Create /TN "P10Run" /TR "O:\AUTOIT\P40 Run.au3" /SC WEEKLY /D MON, TUE,WED,THU,FRI /ST 09:05:00 SUCCESS: The scheduled task "P10Run" has successfully been created. I also did a "test" run : C:\>Schtasks /Run /TN "P10Run SUCCESS: Attempted to run the scheduled task "P10Run". But when I run my query to verify success my "Last Result" seems to indicate that the script did not run: C:\>SCHTASKS /QUERY /FO LIST /V /TN "P10RUN" Folder: \ HostName: xxxxxxxxxxxxxxxx TaskName: \P10RUN Next Run Time: N/A Status: Could not start Logon Mode: Interactive only Last Run Time: 6/14/2017 9:08:56 AM Last Result: -2147024894 Author: xxxxxxx Task To Run: O:\AUTOIT\P40 Run.au3 Start In: N/A Comment: N/A Scheduled Task State: Enabled Idle Time: Disabled Power Management: Stop On Battery Mode, No Start On Batterie s Run As User: xxxxxxxxx\xxxxxxxx Delete Task If Not Rescheduled: Enabled Stop Task If Runs X Hours and X Mins: 72:00:00 Schedule: Scheduling data is not available in this f ormat. Schedule Type: Weekly Start Time: 9:05:00 AM Start Date: 6/14/2017 End Date: N/A Days: MON, TUE, WED, THU, FRI Months: Every 1 week(s) Repeat: Every: Disabled Repeat: Until: Time: Disabled Repeat: Until: Duration: Disabled Repeat: Stop If Still Running: Disabled C:\> Is there something missing in my command? Also is there a better way to make sure that the script does in fact sun successfully? Thanks In Advance!
  13. please help, how to write script for multiple choice question in GUI -single program -add more question to program example: 1. this is the question a. answer a b. answer b c. answer c d.answer d - 300 questions + 700 answers please give me some tips to create a script read and write file from notepad, that mean u need notepad attach?
  14. Hi, I have a problem, my functions do not work with each other. Separately, each works very well. Features that do not work together it's loot() and pos1(). It looks that after spreadsheet function loot() script stops working even though everything is in the While 1-Wend loop. Can someone help me please?  
  15. Hi, I'm new to AutoIt but it looks great. I want to get the text from Internet Explorer when hovering the mouse over an image, the statusbargettext function appears to be the way to go. When running via a hotkey I return a blank, but the msgbox works. Do you know what I'm doing wrong? Thanks HotKeySet("!x", "RecordURL") ;wait for ALT-a keystroke While 1 ;loop forever to wait for the keypress Sleep(100) ;no need to kill the CPU WEnd Func RecordURL() #include <MsgBoxConstants.au3> AutoItSetOption("WinTitleMatchMode", 2) Local $sText = StatusbarGetText("Internet Explorer") MsgBox($MB_SYSTEMMODAL, "", "Internet Explorer's status bar says: " & $sText) EndFunc
  16. Hi there, not sure if this is the right place, but I'm building a script for using premade answers in chat. It works and outputs the answers (stored in an ini file based on: answer name = answer it also works with a new line if there is a tag <enter> in the answer text in the ini file. Now the problem is, that after the answer is pasted in the chat (you bring up the interface with ctrl+1) it gives an enter, thus sending the output straight away. I would like to be able to review the answer before sending it. can anyone help me by telling what's wrong in the script, I tried replacing the @crlf in the script with other options, no luck. Thanks in advance! antwoorden.au3 antwoorden.ini
  17. Hi, I newbie here, my english not so good my first post and first script, I learn make sofware with autoit, and to want share with other forumer just simple autoit script in my first try (and not full follow autoit format(yet, in learning and understand)) Screenshot http://www.xyplorer.com/xyfc/download/file.php?id=9726 #include <Array.au3> #include <IE.au3> #NoTrayIcon Global $g_sUrlList, $g_sHelpPath, $g_sNavPath, $g_sKeyword, $hWnd, $g_RegexP Global $sChmUrl_L, $g_sClipbord, $sFileN $sFileN = StringRegExpReplace(@ScriptFullPath, "(.+\\)([^\\]+)\.(au3|a3x|exe)", "$2", 1) $sSDir = StringRegExpReplace(@ScriptFullPath, "(.+\\)[^\\]+\.(au3|a3x|exe)", "$1", 1) Global Const $g_sIniPath = $sSDir & '_IncludePart\' & $sFileN & '.ini' _sClipGet() $sTitl = WinGetTitle("[ACTIVE]") $sExt = StringRegExpReplace($sTitl, "(.+\.)(\w{1,6}).*", "$2", 1) Local $sCount, $sDefault $sCext = "~" $i = 0 $pi = 1 If FileExists($g_sIniPath) = 0 Then _IniWriteSection() Sleep(1000) EndIf If FileExists($g_sIniPath) = 1 Then $j = 0 $sCount = IniRead($g_sIniPath, "MainHChmData", "TotalItems", "") Do $j += 1 $sKeyt = " " & IniRead($g_sIniPath, "HChmData" & $j, "FileExt", "") Until $j = 20 Or $sKeyt = " " $j -= 1 If $sCount <> $j Then IniWrite($g_sIniPath, "MainHChmData", "TotalItems", $j) $sCount = $j EndIf $sDefault = IniRead($g_sIniPath, "MainHChmData", "DefaultItems", "") For $i = 1 To $sCount Local $sCext = " " & IniRead($g_sIniPath, "HChmData" & $i, "FileExt", "") $Cext = StringInStr($sCext, $sExt & ";") If $Cext > 1 Then ExitLoop EndIf Next EndIf If $sCext = "~" Or $sDefault = "" Then $sDefault = 1 If $i > $sCount Then $i = $sDefault $g_sHelpPath = IniRead($g_sIniPath, "HChmData" & $i, "HChmPath", "") $hWndT = '[' & IniRead($g_sIniPath, "HChmData" & $i, "hWnd", "") & ']' $g_sNavPath = IniRead($g_sIniPath, "HChmData" & $i, "ChmUrlList", "") $sDef = IniRead($g_sIniPath, "HChmData" & $i, "DefaultPage", "") $g_RegexP = IniRead($g_sIniPath, "HChmData" & $i, "RegexMatches", "") If FileExists($g_sHelpPath) = 0 Or FileExists($g_sNavPath) = 0 Or $hWndT = "[]" Then MsgBox(0, "Missing Or Invalid Path :", "Note: Make Sure Correct Ini Data In : " & @CRLF & $g_sIniPath & @CRLF & @CRLF & "Bellow Information Data :" & @CRLF & @CRLF & "HelpFile.chm : " & @CRLF & $g_sHelpPath & @CRLF & @CRLF & "ChmUrlList : " & @CRLF & $g_sNavPath & @CRLF & @CRLF & "HelpWindowsHwnd : " & @CRLF & $hWndT & @CRLF) EndIf $sChf = "::" & $sDef If $sDef = "" Then $sChf = "" If WinExists($hWndT) = 0 Then Run('"hh.exe" "' & $g_sHelpPath & $sChf & '"') WinWaitActive($hWndT) Sleep(500) EndIf $hWnd = WinGetHandle($hWndT) If IsHWnd($hWnd) = 0 Then MsgBox(0, "Not Valid Help Windows Hwnd", 'Make Sure Correct Help Windows Hwnd' & @CRLF & @CRLF & "HelpWindowsHwnd : " & @CRLF & $hWndT & @CRLF & @CRLF & "Sample Correct Hwnd (Windows Help Title & Class)" & @CRLF & "REGEXPTITLE:AutoIt Help.+; REGEXPCLASS:HH Parent" & @CRLF & "OR" & @CRLF & "TITLE:AutoIt Help (v3.3.14.2); CLASS:HH Parent") EndIf _sGetUrl() Exit Func _IniWriteSection() If FileExists($g_sIniPath) = 0 Then DirCreate(@ScriptDir & "\_IncludePart") EndIf Local $sAutoItInstallDir = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE" & ((@OSArch = 'X64') ? "\Wow6432Node" : "") & "\AutoIt v3\AutoIt", "InstallDir") If $sAutoItInstallDir = "" Then $sAutoItInstallDir = "Replace This Note In _IncludePart\" & $sFileN & ".Ini File With Valid Path " Local $aGeneral[3][2] = [[2, ""], ["TotalItems", "1"], ["DefaultItems", "1"]] Local $aSection[7][2] = [[5, ""], ["HChmPath", $sAutoItInstallDir & "\AutoIt.chm"], ["hWnd", "REGEXPTITLE:AutoIt Help.+; REGEXPCLASS:HH Parent"], _ ["ChmUrlList", @ScriptDir & "\_IncludePart\HHChmAutoIt3.au3t"], ["FileExt", "au3;a3x;"], ["DefaultPage", "html/functions/Window Management.htm"], _ ["RegexMatches", ""]] IniWriteSection($g_sIniPath, "MainHChmData", $aGeneral) IniWriteSection($g_sIniPath, "HChmData1", $aSection) EndFunc ;==>_IniWriteSection Func _sClipGet() $ClipBord = ClipGet() ClipPut("") Sleep(10) Send("^c") $g_sClipbord = ClipGet() ClipPut($ClipBord) Local $iLength = StringLen($g_sClipbord) EndFunc ;==>_sClipGet Func _sGetUrl() Local $iLength = StringLen($g_sClipbord) $aData = StringRegExp($g_sClipbord, '[^"()$\s\n]+', $STR_REGEXPARRAYFULLMATCH) If $aData = 1 Then MsgBox(0, "Abort :", "Clipbord : " & $g_sClipbord & @CRLF & @CRLF & "Noting Selected Or Macth With Regex" & @CRLF & @CRLF) Exit EndIf $g_sKeyword = StringLower(StringFormat("%s", $aData[0])) $iLength2 = StringLen($g_sKeyword) If $iLength2 < 3 Then MsgBox(0, "Note :", "Abort : Word Letter Below 4" & @CRLF & "Seleted = " & $g_sKeyword & @CRLF & "Length = " & $iLength2) Exit Else _aFileRead($g_sNavPath) _sChmUrl() EndIf EndFunc ;==>_sGetUrl Func _sChmUrl() $Reg = '(?i)([^\n]+' & $g_sKeyword & '[^\n]*)' _StringRegex($g_sUrlList, $Reg) $aRegx = "[^\n]+/()\.htm;;[^\n]+/()\w\w?\.htm;;[^\n]+#();;[^\n]+#()\w\w?;;[^\n]+/()[^\n/]+\.htm;;[^\n]+#[^\n#/]*()[^\n]*;;[^\n]+/[^\n/]+()[^\n/]*\.htm;;[^\n]+()[^\n/]*\r" If $g_RegexP <> "" Then $aRegx = $g_RegexP & ";;" & $aRegx EndIf $aRegx = StringSplit("(" & StringReplace(StringReplace($aRegx, "()", $g_sKeyword), ";;", "\r)¦(") & "\r)", "¦", 1) _StringRegexUrl($sChmUrl_L, $aRegx) Exit EndFunc ;==>_sChmUrl Func _NavigateCHM($sFilePath, $sSection) If IsHWnd($hWnd) Then Local $oIE = _IEAttach($hWnd, 'Embedded') _IENavigate($oIE, 'mk:@MSITStore:' & $sFilePath & '::/' & $sSection) WinActivate($hWnd) ; ControlFocus($hWnd,"","[ID:201]") ; ControlClick($hWnd,"","[ID:201]","",1,625, 155) ; ControlClick($hWnd,"","[CLASS:Button; TEXT:Hide;]","") EndIf Exit EndFunc ;==>_NavigateCHM Func _StringRegexUrl($sList, $aRegx) Local $sChmUrl For $i = 1 To $aRegx[0] - 1 $sChmUrl = StringRegExp($sList, '(?i)' & $aRegx[$i], 1) If IsArray($sChmUrl) Then $sChmUrl = StringTrimRight($sChmUrl[0], 1) _NavigateCHM($g_sHelpPath, $sChmUrl) EndIf Next Exit EndFunc ;==>_StringRegexUrl Func _StringRegex($sConten, $Reg) $aGetChmUrl = StringRegExp($sConten, $Reg, 3) If $aGetChmUrl = 1 Then MsgBox(0, "Abort :", "Keyword : " & $g_sKeyword & @CRLF & @CRLF & "Noting Macth Any Chm Url By Keyword" & @CRLF & @CRLF) Exit Else $sCChm = UBound($aGetChmUrl) For $i = 0 To $sCChm - 1 $sChmUrl_L &= $aGetChmUrl[$i] & @CRLF Next EndIf Return $sChmUrl_L EndFunc ;==>_StringRegex Func _aFileRead($g_sNavPath) Local $hFileOpen = FileOpen($g_sNavPath, $FO_READ) If $hFileOpen = -1 Then MsgBox($MB_SYSTEMMODAL, "", "An error occurred when reading the file.") Return False EndIf $g_sUrlList = FileRead($hFileOpen) FileClose($hFileOpen) Return $g_sUrlList EndFunc ;==>_aFileRead LearningTools.7z Info in ReadMe.txt Just to ask other forumer, Correct way or keyword command to autoit click Hide button in AutoIt.chm windows? ControlFocus($hWnd,"","[ID:201]") ControlClick($hWnd,"","[ID:201]","left",1) ControlClick($hWnd,"","[CLASS:Button; TEXT:Hide;]","left",1) I try using ControlClick, sendkey or mouseclick, but not work LearningTools.7z
  18. Hi all, Ctrl+Break stops script only if AutoIt window is active. It doesn't work while automation is going on elsewhere. Is there a way to stop the script regardless of where the automation is happening? Thanks
  19. Trying to automate the sideload of a Windows Store app via .ps1 script... RunWait(@ComSpec & ' /c' & 'C:\"WB Resources"\APP_Prod\Add-AppDevPackage.ps1') Above doesn't work... I assume this is trying to open in CMD. Normally we right click the .ps1 and open with powershell, then we have to type "A" to start the install, it installs and then type any yet to exit. However I cant get the powershell to even open. Kind of puzzled here, any suggestions would be a help. PS I also tried to convert the .ps1 to exe, but that was a huge failure... lol
  20. Hello, I am back once again to ask for assistance. I am just trying to fool around with the "ImageSearch" function in order to detect when certain elements appear on my active window to then respond to. To begin testing this I simply cut out a small segment of my background, saved it as a BMP, and used that as the bmp for the search function. I had hoped for it to just run through quickly and say it found it and spit out the X Y coords of where it was found. Instead I am getting this : http://screencast.com/t/MD9aOzPhETE Here's my script thus far : #Include <msgBoxConstants.au3> #Include <ImageSearch.au3> global $x = 0 global $y = 0 CheckForImage () Func checkForImage () Local $Search = _ImageSearchArea ('ninjaCheck.bmp', 1, 0, 0, 1366, 768, $x, $y, 100) If $Search = 1 Then MsgBox ($IDOK,"Found",$resultPosition) EndIf EndFunc While 1 Sleep (10) WEnd What I would like assistance with is how do I "Debug" this in order to see where/why it is failing. I've reviewed https://www.autoitscript.com/wiki/FAQ#How_can_I_debug_my_script.3F but I am not entirely sure how to apply the information. If I could get a return on "Hey, this Func or This Line is where I died" , that would be awesome. Any suggestions on how I can tackle this issue? Thank you for your time! -Reiz checkNinja.bmp is " " around it now and it has the same result
  21. Backup Script

    WARNING: I never tried this on a root directory, I should probably write a fix for that case. EX: There is no C:\..\ I don't know how many of these there are on this forum and I know Tidy is real nice for making backups. I have a few dislikes relying on the Tidy backup: 1 I'm not crazy about the backup folder it creates in project folder. 2. If no Tidy edits are performed script is not backed up on Tidy. I can't rely on that when I request a backup. 3. If I want to backup a select group of files without backing up the entire project folder, it is somewhat tedious to select each file and Tidy. Now this is just a very simple script that I felt I could use to simplify backing up my project. I'm not asking you to code it for me, but I welcome feedback. If you think you can make it better or know of something better please share. I know of Github it's overkill for me, I'm not comfortable, and I won't use it as much as I need to. So here it is: You place it in the source folder, open it in Scite. Change: Global $gBackup_dir_path = "..\Backup\" to wherever you want you backup folder Path to be. in the main() add some backup("file_name") calls remember to remove file extension. and it should make a new backup file for each backup("file_name") every time you run the script. Test it out make sure it's working and you're good to go. #cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.14.2 Author: myName Script Function: To copy files to a backup folder. #ce ---------------------------------------------------------------------------- #include <File.au3> Global $gBackup_dir_path = "..\Backup\" ; Todo ; Add notes, options notes in file name main() func main() ; File list remember to remove extentions from file_name ; or add file extention as second parameter backup("Map_Editor") backup("DW_Server") EndFunc Func backup($spFile_name, $spFile_ext = ".au3") Local $error = 0 Local $iFile_num = 0 ; Make source file path Local $sFile_path_source = $spFile_name & $spFile_ext Local $sFile_path_dest = "" ; Sample the contents of the backup directory before creating a file there Local $aFile = _FileListToArray($gBackup_dir_path, $spFile_name&"*"&$spFile_ext, $FLTA_FILES) $error = @error If $error = 0 Then $iFile_num = $aFile[0] EndIf out("Found: " & $iFile_num & " files named: " & $spFile_name) Do ; Incroment file_num to find available file_name $iFile_num += 1 ; Path to Write File Copy $sFile_path_dest = $gBackup_dir_path & $spFile_name & "_" & $iFile_num & $spFile_ext ; Refuse to Overwrite File If FileExists($sFile_path_dest) = 0 Then ExitLoop EndIf ; Am I right? Sleep(30) Until 0 ; Create the file FileCopy($sFile_path_source, $sFile_path_dest, $FC_CREATEPATH) $error = @error If $error Then out("FileCopy() error: " & $error) out("sFile_path_source: " & $sFile_path_source & " sFile_path_dest: " & $sFile_path_dest) EndFunc ;==>backup Func out($output = "", $user = 0);debug tool ConsoleWrite(@CRLF & $output);to console new line, value of $output EndFunc ;==>out Backup_Script.au3 The script isn't authorized to overwrite files, and tries to create the next number of file_name available. The 'p' in my variable names stands for parameter.
  22. How should i go about repeating this section if@error? I want it to try again if it can not find the PixelSearch then move on to the next Search. While 1 $cords = PixelSearch(564, 188,710, 350,0x380030) If Not (@error) Then MouseClick("Left",$cords[0],$cords[1],1,1) EndIf If (@error) Then ?????? EndIf
  23. #include <Excel.au3> #include <Array.au3> #include <String.au3> #include <IE.au3> local $oIE =_IECreate ("https://example.com/export") sleep(5000) WinWait("Internet Explorer") WinActivate("Internet Explorer") send("{TAB 2}") sleep(1000) send("{ENTER}") sleep(1000) WinWait("Save As") WinActivate("Save As") send("PatientsData.csv") sleep(1000) send("{TAB 3}") sleep(1000) send("{ENTER}") sleep(1000) WinWait("Confirm Save As") WinActivate("Confirm Save As") send("{TAB 1}") sleep(1000) send("{ENTER}") WinWait("Blank Page - Internet Explorer") WinActivate("Blank Page - Internet Explorer") sleep(1000) RunWait('taskkill /F /IM "iexplore.exe"') Exit I have written the above simple script, which open a link and save it to the disk. I execute it and every thing works fine. I scheduled it in windows task and it executed fine. However when I scheduled it and I logged out of the system it stops working. The scheduled start the task.exe. Open the internet explorer send f2 to open the save as dialogue and after that it fails to send the tab. Since partial script is execute therefore I think that the problem is not related to permissions. The script stops at second or third line.
  24. First the Situation: I'm trying to automate an image uploading utility which lives on the client side of some cloud based server/client software and which was not designed to be automated. I've got a 2012 R2 VM running with autologon enabled on a local account. The account with autologon enabled has a scheduled task set up to run at 4AM daily. This task merely runs my AutoIt script. Now the issue: If I remote into my VM and run the script manually, it runs perfectly. If I edit my scheduled task to run only a few minutes in the future, and then reboot the VM, it also works perfectly. If I leave it to run overnight, the script starts but never finishes. It seems to be getting hung up waiting for the first window to become active. I've tried many version of the script now with no luck. The latest version is below. #include <File.au3> Dim $un = "username" Dim $pw = "password" ; Login window Run("C:\Program Files (x86)\CSI Software\Spectrum NG\Spectrum NG Client\SNGImageUploader.exe") Dim $hLogin = WinWait("[CLASS:WindowsForms10.Window.8.app.0.2bf8098_r11_ad1]", "Version: ") SendKeepActive($hLogin) WinActivate($hLogin) Send($un & "{TAB}" & $pw & "{ENTER}") SendKeepActive("") ; Main window - 1/3 Dim $hMain = WinWaitActive("SNG Image Uploader") SendKeepActive($hMain) Send("{TAB}{ENTER}") SendKeepActive("") ; File browser window Dim $hBrowse = WinWaitActive("Browse For Folder") SendKeepActive($hBrowse) Send("{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{RIGHT}{DOWN}") Sleep(2000) ; Give the program moment to detect images in the directory Send("{ENTER}") SendKeepActive("") ; Main window - 2/3 SendKeepActive($hMain) WinWaitActive($hMain) Send("{TAB}{ENTER}") SendKeepActive("") ; Upload complete window Dim $hUpload = WinWaitActive("[CLASS:#32770]", "Upload complete. Please wait while servers process your request.") SendKeepActive($hUpload) Send("{ENTER}") SendKeepActive("") ; Import complete window Dim $hImport = WinWaitActive("[CLASS:#32770]", "Image import completed. Please check results in the Account Upload History screen.") SendKeepActive($hImport) Send("{ENTER}") SendKeepActive("") ; Main window - 3/3 WinWaitActive($hMain) WinClose($hMain) ; Cleanup FileDelete("C:\CRPics\*")
  25. Hello to all, first thank you to all of you, because this forum is really usefull. I try to search about my problem but I didnt get any answer, so I try to create new topic... sorry for my english too, because I am not from uk or usa... I have a script which depends on specific pixel, if this pixes gets a colour, it will make a click... speed is the name of the game, so does anybody know, how fast will be this cycle? I mean how many times this script will go for 1 second, or maybe for 1 minute? second question is... when this pixel gets a colour I want, is there any better way how to wrote a script which will click on three different spot on the screen? best regards and thank you very much for any help pepan -snip-
×