Sign in to follow this  
Followers 0
Ravel

looping copy macro

4 posts in this topic

#1 ·  Posted (edited)

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

Share this post


Link to post
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

Share this post


Link to post
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?

Share this post


Link to post
Share on other sites

So thats it? lol just put exit in there and it will kill itself if the program/game that i am playing ends?

Yepper !!!

8)


NEWHeader1.png

Share this post


Link to post
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
Sign in to follow this  
Followers 0