Jump to content

looping copy macro


Ravel
 Share

Recommended Posts

Hi, I am trying to create a macro to run in the background of a game. I want it to constantly copy a folder while the game is running, and once i close the game I want the macro to automatically close itself. Here is what I have so far, can someone tell me if I have it right?

HotkeySet('{ESC}', 'Terminate')
opt ("WinTitleMatchMode",2)

While 1

If ProcessExists("SwgClient_r.exe") Then
    FileCopy("G:\Star Wars\SWG\profiles\*.*", "G:\Star Wars\SWG\profiles.backup\*.*", 9); Flag = 1 + 8 (overwrite + create target directory structure)
; Copy the txt-files from source to target and overwrite target files with same name
Sleep(600000)
ElseIf
    
Local $List = ProcessList('SWGcopyprofile.exe')
For $I = 1 To $List[0][0]
    ProcessClose($List[$I][1])
Next


WEnd

Func Terminate()
    Exit
EndFunc
Edited by Ravel
Link to comment
Share on other sites

maybe...

HotKeySet('{ESC}', 'Terminate')
Opt("WinTitleMatchMode", 2)

While 1

    If ProcessExists("SwgClient_r.exe") Then
        FileCopy("G:\Star Wars\SWG\profiles\*.*", "G:\Star Wars\SWG\profiles.backup\*.*", 9); Flag = 1 + 8 (overwrite + create target directory structure)
        ; Copy the txt-files from source to target and overwrite target files with same name
        Sleep(600000)
    Else
        Exit
    EndIf

WEnd

Func Terminate()
    Exit
EndFunc   ;==>Terminate

8)

NEWHeader1.png

Link to comment
Share on other sites

maybe...

HotKeySet('{ESC}', 'Terminate')
Opt("WinTitleMatchMode", 2)

While 1

    If ProcessExists("SwgClient_r.exe") Then
        FileCopy("G:\Star Wars\SWG\profiles\*.*", "G:\Star Wars\SWG\profiles.backup\*.*", 9); Flag = 1 + 8 (overwrite + create target directory structure)
        ; Copy the txt-files from source to target and overwrite target files with same name
        Sleep(600000)
    Else
        Exit
    EndIf

WEnd

Func Terminate()
    Exit
EndFunc   ;==>Terminate

8)

So thats it? lol just put exit in there and it will kill itself if the program/game that i am playing ends?
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...