etidd Posted August 23, 2023 Share Posted August 23, 2023 Just checking... Is there a better way to write this for 7 different file types? FileCopy("C:\Users\------\Saved Games\Diablo II\*.d2s", "F:\Game Backup\Diablo II", $FC_OVERWRITE) FileCopy("C:\Users\------\Saved Games\Diablo II\*.key", "F:\Game Backup\Diablo II", $FC_OVERWRITE) FileCopy("C:\Users\------\Saved Games\Diablo II\*.ma0", "F:\Game Backup\Diablo II", $FC_OVERWRITE) FileCopy("C:\Users\------\Saved Games\Diablo II\*.ma1", "F:\Game Backup\Diablo II", $FC_OVERWRITE) FileCopy("C:\Users\------\Saved Games\Diablo II\*.ma2", "F:\Game Backup\Diablo II", $FC_OVERWRITE) FileCopy("C:\Users\------\Saved Games\Diablo II\*.ma3", "F:\Game Backup\Diablo II", $FC_OVERWRITE) FileCopy("C:\Users\------\Saved Games\Diablo II\*.map", "F:\Game Backup\Diablo II", $FC_OVERWRITE) Link to comment Share on other sites More sharing options...
Andreik Posted August 23, 2023 Share Posted August 23, 2023 You can use _FileListToArrayRec() to get all files with certain extensions into an array and then loop through the array and use FileCopy(). etidd 1 When the words fail... music speaks. Link to comment Share on other sites More sharing options...
Nine Posted August 23, 2023 Share Posted August 23, 2023 @etidd you should read forum rules especially about game automation since D2 is obviously included in this rule “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
etidd Posted August 23, 2023 Author Share Posted August 23, 2023 I just glanced over the rules. I'm not automating anything within the game itself. This post pertains to simply copying files to backup. Link to comment Share on other sites More sharing options...
Nine Posted August 23, 2023 Share Posted August 23, 2023 (edited) I understand, not a big deal for me. Just want to let you know about it. But I have played a lot D2 in the past, and I do not believe Blizz agrees you to copy current character stat to another location, and come back if you die. Edited August 23, 2023 by Nine “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
etidd Posted August 23, 2023 Author Share Posted August 23, 2023 I will respect the forum rules and read over them again. My next posts will not have anything to do with games. Link to comment Share on other sites More sharing options...
Nine Posted August 23, 2023 Share Posted August 23, 2023 Thank you for your understanding. “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
rudi Posted August 28, 2023 Share Posted August 28, 2023 Hi, externally call robocopy.exe (included in Windows since XP), would be easy and quick. Have a look at the switch /if (include file), which can be used multiple times in the call. The exitcode of robocopy will tell you exactly, what happened. Running it twice will give you an exitcode of 0 (zero), if source and destination match. Earth is flat, pigs can fly, and Nuclear Power is SAFE! Link to comment Share on other sites More sharing options...
jguinch Posted August 28, 2023 Share Posted August 28, 2023 Just a loop : Local $aExt = ["*.d2s","*.key","*.ma0","*.ma1","*.ma2","*.ma3","*.map"] For $ext in $aExt FileCopy("C:\Users\------\Saved Games\Diablo II\" & $ext, "F:\Game Backup\Diablo II") Next etidd and marcus_tong 1 1 Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now