Jump to content
Sign in to follow this  
digitalteck

Copy Every 15 Min

Recommended Posts

digitalteck

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")

Share this post


Link to post
Share on other sites
PhoenixXL

Welcome to the Forum digitalteck,

Kindly read the Forum rules

According to which game automation isn't allowed for open discussion

Edited by PhoenixXL

My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Share this post


Link to post
Share on other sites
ileandros

Come on it's not a game automatation. Just file deletes and copies...

OP i find hard to understand your english.

This is a checking script for your message boxes(yes,no).

; nevermind don't wanna get banned again trying to help

Use the help files. IF i understood correct you need FileExists function.

Edit: Check Melba23s' signature. He has some usefull staff for file/folder handle if i remember correct

Edited by ileandros

I feel nothing.It feels great.

Share this post


Link to post
Share on other sites
Melba23

digitalteck,

PhoenixXL is quite right - please read the Forum rules (the link is also at bottom right of each page) - particularly the bit about not discussing game launching - before you post again. Thread locked. :naughty:

ileandros,

You should read them too. When the OP says:

then automaticlly launches the game

It clearly comes under the following:

"Do not ask for help with AutoIt scripts, post links to, or start discussion topics on the following subjects:

Launching, automation or script interaction with games or game servers, regardless of the game"

I am at a loss as to why you think otherwise - although knowing your predilection for gamebots I am not entirely surprised. Just as well you removed your code before I came along - your replacement comment is spot on. :naughty:

M23


Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______Open Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

×