Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

Copy Every 15 Min

$
0
0
Hello,

I am new to Autoit knowing very little on scripting,  yet I did manage by seaching posts and online help to make a successfull  Backup, Clear Game Cache and Launch.au3.

I am pasting the script below.   It works Great!!!

This script backs up my entire Sims 3 folder in my documents to another folder on the desktop, then it clears 4 game cache files and then automaticlly launches the game. The 4 cache files need to be cleared as there is a game mod installed and will error out the game if the files are not removed before playing the game.

Now.

I want to to improve on my script and I and at a loss as I can not find the right information for this.

I need the script to check if files exsist in the target folder and if so have it display files will be overwrittin hit ok to continue. before the cache files are removed on the second step of the script.

Right now I have no way of telling if overwitien the old files it.

The Batch file I made first  before I found autoit does ask  Overwite Yes No All  and you type A for all.

Auto may be backing up my folder but the Date modified are not changing in properties.


I found this script I thought it may help but does not work.

Func _DirCopy($fromFile,$tofile)
Local $FOF_RESPOND_YES = 16
Local $FOF_SIMPLEPROGRESS = 256
$winShell = ObjCreate("shell.application")
$winShell.namespace($tofile).CopyHere($fromFile,$FOF_RESPOND_YES)
EndFunc


My Sims Script Below


#cs ----------------------------------------------------------------------------
AutoIt Version: 3.3.8.1
Author: myName
Script Function:
Template AutoIt script.
#ce ----------------------------------------------------------------------------
; Script Start - Add your code below here
;~ 4 Do not display a progress dialog box.
;~ 8 Give the file being operated on a new name in a move, copy, or rename operation if a file with the target name already exists.  
;~ 16 Respond with "Yes to All" for any dialog box that is displayed.
;~ 64 Preserve undo information, if possible.
;~ 128 Perform the operation on files only if a wildcard file name (*.*) is specified.
;~ 256 Display a progress dialog box but do not show the file names.
;~ 512 Do not confirm the creation of a new directory if the operation requires one to be created.
;~ 1024 Do not display a user interface if an error occurs.
;~ 2048 Version 4.71. Do not copy the security attributes of the file.
;~ 4096 Only operate in the local directory. Don't operate recursively into subdirectories.
;~ 9182 Version 5.0. Do not copy connected files as a group. Only copy the specified files.

Func _DirCopy($fromFile,$tofile)
    Local $FOF_RESPOND_YES = 16
    Local $FOF_SIMPLEPROGRESS = 256
    $winShell = ObjCreate("shell.application")
    $winShell.namespace($tofile).CopyHere($fromFile,$FOF_RESPOND_YES)
EndFunc

MsgBox(0, "Sims 3 Bkup,Clr,Run", "Press Ok To Backup Data!")
DirCopy("C:\Users\John\Documents\Electronic Arts\The Sims 3", "C:\Users\John\Desktop\Sims3Backup", 9)

MsgBox(0, "Sims 3 Bkup,Clr,Run", "Press Ok To Clear Cache!")

FileDelete("C:\Users\John\Documents\Electronic Arts\The Sims 3\CASPartCache.package")
FileDelete("C:\Users\John\Documents\Electronic Arts\The Sims 3\scriptCache.package")
FileDelete("C:\Users\John\Documents\Electronic Arts\The Sims 3\compositorCache.package")
FileDelete("C:\Users\John\Documents\Electronic Arts\The Sims 3\simCompositorCache.package")

MsgBox(0, "Sims 3 Bkup,Clr,Run", "Press Ok To Run Sims 3!")

Run("C:\Program Files (x86)\Electronic Arts\The Sims 3 Ambitions\Game\Bin\Sims3Launcher.exe")

Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>