MarkShot
Posts: 6672
Joined: 3/29/2003 Status: offline
|
By the way, this is how I changed your autosave into a game checkpointing facility. WinTitle(WinName(), "SavCkpt(CMANO)") ; ----- Definitions ------ SourceFile="E:\Games\CMANO\Scenarios\Autosave.scen" DestinationDir="E:\Games\CMANO\Scenarios\_CMANO Chkpt\" Interval=1 ; ----- Monitor Save Game Status ----- While @true If FileExist(SourceFile) then ; wait for file to appear Attr=FileAttrGet(SourceFile) If StrSub(attr, 2, 1) == "A" Then GoSub CopySaveGame End If TimeDelay(Interval) End While ; ----- Shut Down ----- Exit Message("Debug", "Pause") ; ##### CopySaveGame ##### :CopySaveGame ; ----- Form file name ----- Delay(8); Stabilize BaseName=FileTimeGetEx(SourceFile, 2) ReplaceName=StrClean(BaseName, ":", "", @False, 1) ReplaceName=StrSub(ReplaceName, 1, 14) ReplaceName=StrCat(StrSub(ReplaceName, 1, 8), " ", StrSub(ReplaceName, 9, 6), ".scen") TargetName=StrCat(DestinationDir, ReplaceName) ErrorMode(@OFF) FileCopy(SourceFile, TargetName, @False) ErrorMode(@ON) FileAttrSet(SourceFile, "a") ; clear the flag Return
_____________________________
Never more! (I've had enough. Sliterine has raised mediocrity to an art form!)
|