nmX.Memnoch Posted February 8, 2007 Share Posted February 8, 2007 @DATE is tricky. Fortunately I've already done this before because I use a KIX script for some other backups. Give the code below a try and replace @DATE in your code with $DATE. The result from the following will give you a date format of YYYY.MM.DD.Another suggestion is to add BREAK ON as the first line of your script. If you don't turn this on and kill the script, KiX will automatically log you off. It was originally designed to be used as a logon script processor so this behavior was implemented to keep users from killing the logon script before it completed. I'll look at your script a bit closer tonight to see if I have any other suggestions from lessons I've learned over the years.; Month variableSelect Case @MONTHNO < 10 $MONTH = "0" + "@MONTHNO" Case @MONTHNO > 9 $MONTH = @MONTHNOEndSelect; Day variableSelect Case @MDAYNO < 10 $MDAYNO = "0" + "@MDAYNO" Case @MDAYNO > 9 $MDAYNO = @MDAYNOEndSelect$DATE = "@YEAR" + "." + "$MONTH" + "." + "$MDAYNO"Of course, there is also a much simpler way...but it only just came to me while I was typing this. It's untested but it should work.$DATE = SPLIT(@DATE,"/")$DATE = JOIN($DATE,".")As far as your question regarding the copy command; what you have should work. I'm not sure why it's returning an error code of 3. Again, I'll take a closer look at it tonight when I have a bit more time. Link to comment Share on other sites More sharing options...
nmX.Memnoch Posted February 9, 2007 Share Posted February 9, 2007 (edited) I tested the revised two line @DATE to $DATE conversion code. It works. I dunno why I never thought to do it that way before. I've copied your script out into one of the editors I use* so I can take a better look at it. I've made a few modifications for you to try out:Break OnDebug On/* Translate @DATE into a useable value for directory names */$DATE = SPLIT(@DATE,"/")$DATE = JOIN($DATE,".")$TQBackup = "V:\Data Backup\Game Backups";Titan Quest Backup LocationIf @USERID = "gaming" MessageBox("Beginning Test","alert", 48) $Result = CompareFileTimes("C:\Scripts\testfile.txt", "$TQBackup\CHKFileDir\testfile.txt") ? Select Case $Result = 1 OR $Result = -3 MessageBox ("Backing up Files Now..."+ @DATE,"alert", 48) ? COPY "C:\Scripts\testfile.txt" "$TQBackup\CHKFileDir\" @error ? COPY "C:\Scripts\*" "$TQBackup\$DATE\" /s @error ? Case $Result = -1 MessageBox ("Files are newer in target directory..." + @DATE,"alert", 48) Case $Result = 0 MessageBox ("Files are exact matches in target & Backup directories..."+ @DATE,"alert", 48) EndSelectEndIfExitNote the use of a Select EndSelect statement instead of a bunch of If EndIf statements. If $Result could only be true or false then an If EndIf statement would be fine. But since $Result can be one of four values you should use Select EndSelect because it will run faster. Instead of having to run each If EndIf check, Select EndSelect will stop processing as soon as the the Case statement is true.For example, say the value of $Result returned a 1. With your original code it would process each If EndIf statement and recheck the value of $Result each time. That's four total checks (because you have an OR clause). With the Select EndSelect statement and a $Result value of 1 it will stop at the first true result and not process the rest. The difference in speed probably won't be noticeable in a script this small, but when you have a large script it's very noticeable.Also note that I put your variables inside the quotes ("$TQBackup\CHKFile\" vs $TQBackup + "\CHKFile\"). I know some people recommend not to put variables inside of quotes, but unless you specify SetOption("NoVarsInStrings","ON") and SetOption("NoMacrosInStrings","ON") it'll work without any problems.There's probably some other notes I forgot to mention so if you have any questions just ask. If you can give me the full paths of the source and destination I may be able to get around using the CHKFile directory. This supposes that the filename for the save game is the same every time...I know that with most games it won't be, but I don't play Titan Quest so I don't know about that particular game.I did some research on error code 3 from the COPY command. That the path isn't found (doesn't specify if it's the source or destination path that isn't found). I would assume the source since it's supposed to create the destination if it doesn't exist, providing you have the trailing \. From the documentation:; If the target (directory) does not exist,; and the target specification does not have a; trailing backslash, COPY will fail with an; errorcode 3 ("path not found")COPY "S:\MyDir\" "S:\NewDir" ; fails if NewDir does not existGive this a try:COPY "C:\Scripts\" "$TQBackup\@day\test\" /s @error ?* I use PrimalScript Pro at home and AdminScriptEditor at work. I prefer AdminScriptEditor but the PrimalScript Pro license we have is a little more flexible in home usage allowance. Edited February 9, 2007 by nmX.Memnoch Link to comment Share on other sites More sharing options...
InTheFlow Posted February 9, 2007 Author Share Posted February 9, 2007 @DATE is tricky. Fortunately I've already done this before because I use a KIX script for some other backups.Sweet! Must be my lucky day! Another suggestion is to add BREAK ON as the first line of your script. If you don't turn this on and kill the script, KiX will automatically log you off. It was originally designed to be used as a logon script processor so this behavior was implemented to keep users from killing the logon script before it completed.Thanks for the tip/heads up on this. So far I haven't had to use ctrl-c to stop a rebel script. But, its probably only a matter of time... Of course, there is also a much simpler way...but it only just came to me while I was typing this. It's untested but it should work.$DATE = SPLIT(@DATE,"/")$DATE = JOIN($DATE,".")This worked! Is there a way to join each element back together in a different order? For example: Month.Day.Year Maybe each element could be assigned a number and then joined back together in whatever order you put the numbers in...I haven't had time to play with the first code idea you offered. Maybe that is the answer.As far as your question regarding the copy command; what you have should work. I'm not sure why it's returning an error code of 3. Again, I'll take a closer look at it tonight when I have a bit more time.That would be great, thanks! I have to admit that I'm perplexed on the issue. I can work around that problem by just adding another subdir to $TBBackup. But still, I'm crazy curious! LOL Link to comment Share on other sites More sharing options...
nmX.Memnoch Posted February 9, 2007 Share Posted February 9, 2007 $DATE = SPLIT(@DATE,"/")$DATE = JOIN($DATE,".")This worked! Is there a way to join each element back together in a different order? For example: Month.Day.Year Maybe each element could be assigned a number and then joined back together in whatever order you put the numbers in...I haven't had time to play with the first code idea you offered. Maybe that is the answer.Yeah, you can reorder the information after it's been split into an array. However, I recommend keeping it in YYYY.MM.DD format so it's listed alphabetically in chronological order in Windows Explorer. But, if you want to reorder it to MM.DD.YYYY, here ya go:$DATE = Split(@DATE,"/")$DATE = $DATE[1] + "." + $DATE[2] + "." + $DATE[0]I'll take a closer look at it tonightThat would be great, thanks!Hehe...scroll up. I'd already looked at it and replied again. Link to comment Share on other sites More sharing options...
InTheFlow Posted February 9, 2007 Author Share Posted February 9, 2007 Break OnDebug On/* Translate @DATE into a useable value for directory names */$DATE = SPLIT(@DATE,"/")$DATE = JOIN($DATE,".")$TQBackup = "V:\Data Backup\Game Backups";Titan Quest Backup LocationIf @USERID = "gaming" MessageBox("Beginning Test","alert", 48) $Result = CompareFileTimes("C:\Scripts\testfile.txt", "$TQBackup\CHKFileDir\testfile.txt") ? Select Case $Result = 1 OR $Result = -3 MessageBox ("Backing up Files Now..."+ @DATE,"alert", 48) ? COPY "C:\Scripts\testfile.txt" "$TQBackup\CHKFileDir\" @error ? COPY "C:\Scripts\*" "$TQBackup\$DATE\" /s @error ? Case $Result = -1 MessageBox ("Files are newer in target directory..." + @DATE,"alert", 48) Case $Result = 0 MessageBox ("Files are exact matches in target & Backup directories..."+ @DATE,"alert", 48) EndSelectEndIfExitThis worked very well. I also like how nice and "tidy" it makes the script. LOL! Thanks for letting me know about the Select...Endselect statement and explaining why its important to use it.If you can give me the full paths of the source and destination I may be able to get around using the CHKFile directory. This supposes that the filename for the save game is the same every time...I know that with most games it won't be, but I don't play Titan Quest so I don't know about that particular game.Hmmm...now you've got me thinking 'how could I get around this'! LOL Is your idea to compare one of the source files to the one in the most recent backup? I haven't decided which file to use as the 'check' file yet. I want to use a small one. As long as it is updated everytime the game is saved, it shouldn't matter which file I use because the copy command is going to copy the entire directory...both updated and unupdated files.The path to the save-game directory is \My Documents\My Games\Titan QuestI did some research on error code 3 from the COPY command. That the path isn't found (doesn't specify if it's the source or destination path that isn't found). I would assume the source since it's supposed to create the destination if it doesn't exist, providing you have the trailing \. From the documentation:; If the target (directory) does not exist,; and the target specification does not have a; trailing backslash, COPY will fail with an; errorcode 3 ("path not found")COPY "S:\MyDir\" "S:\NewDir" ; fails if NewDir does not existGive this a try:COPY "C:\Scripts\" "$TQBackup\@day\test\" /s @error ?Well, I actually did some research on the command before posting and had already stumbled accross the above. So, I attempted to put it into practice by making sure there was a trailing '\' but the issue persists.I had tried your example code above before as well but it didn't work. I tried it again though, just in case, and I still get error code 3.If you have a chance, see if it will work for you. I also tried removing the '@day' and just replaced it with 'day' to see if that was the problem. No luck, it doesn't seem to like deeper directories for some reason...* I use PrimalScript Pro at home and AdminScriptEditor at work. I prefer AdminScriptEditor but the PrimalScript Pro license we have is a little more flexible in home usage allowance.Its funny that you mentioned this because I was going to ask you if you use a special program for this kind of stuff. LOL! I'll check into them but if they are very expensive, I'd rather find a free one.And now onto a major issue... As you know, earlier in the post we came up with this code to restart the folding services...which works perfectly. If @USERID = "gaming" Shell '%COMSPEC% /C START "" /WAIT net start "FAH@@E:+Program Files+Folding@@Home+F@@H1+FAH504-Console.exe"' Shell '%COMSPEC% /C START "" /WAIT net start "FAH@@E:+Program Files+Folding@@Home+F@@H2+FAH504-Console.exe"'EndIfHowever, when I attempt to put this together in the same script with the backup portion, it doesn't work. I tried this:Break On$DATE = SPLIT(@DATE,"/") $DATE = JOIN($DATE,"-")$TQBackup = "V:\Data Backup\Game Backups\";Titan Quest Backup LocationIf @USERID = "2nd OCCT" messagebox ("Beginning Test","alert", 48) $Result = CompareFileTimes("C:\Scripts\testfile.txt", $TQBackup + "\CHKFileDir\testfile.txt")? Select Case $Result = 1 OR $Result = -3 messagebox ("Backing up Titan Quest Save-Game Files & restarting folding..."+ @DATE,"alert", 48) ? COPY "C:\Scripts\testfile.txt" $TQBackup + "\CHKFileDir\" @error? COPY "C:\Scripts\" "$TQBackup\$DATE\" /s @error ? Shell '%COMSPEC% /C START "" /WAIT net start;"FAH@@E:+Program;Files+Folding@@Home+F@@H1+FAH504-Console.exe"' Shell '%COMSPEC% /C START "" /WAIT net start;"FAH@@E:+Program;Files+Folding@@Home+F@@H2+FAH504-Console.exe"' Sleep 5 Case $Result = -1 messagebox ("Files are newer in target directory..." + @DATE,"alert", 48) Shell '%COMSPEC% /C START "" /WAIT net start;"FAH@@E:+Program;Files+Folding@@Home+F@@H1+FAH504-Console.exe"' Shell '%COMSPEC% /C START "" /WAIT net start;"FAH@@E:+Program;Files+Folding@@Home+F@@H2+FAH504-Console.exe"' Sleep 5 Case $Result = 0 messagebox ("Files are exact matches in target & Backup directories..."+ @DATE,"alert", 48) Shell '%COMSPEC% /C START "" /WAIT net start;"FAH@@E:+Program;Files+Folding@@Home+F@@H1+FAH504-Console.exe"' Shell '%COMSPEC% /C START "" /WAIT net start;"FAH@@E:+Program;Files+Folding@@Home+F@@H2+FAH504-Console.exe"' Sleep 5 EndSelectENDIFEXITThis:Break On$DATE = SPLIT(@DATE,"/") $DATE = JOIN($DATE,"-")$TQBackup = "V:\Data Backup\Game Backups\";Titan Quest Backup LocationIf @USERID = "2nd OCCT" messagebox ("Beginning Test","alert", 48) $Result = CompareFileTimes("C:\Scripts\testfile.txt", $TQBackup + "\CHKFileDir\testfile.txt")? Select Case $Result = 1 OR $Result = -3 messagebox ("Backing up Titan Quest Save-Game Files & restarting folding..."+ @DATE,"alert", 48) ? COPY "C:\Scripts\testfile.txt" $TQBackup + "\CHKFileDir\" @error? COPY "C:\Scripts\" "$TQBackup\$DATE\" /s @error ? Case $Result = -1 messagebox ("Files are newer in target directory..." + @DATE,"alert", 48) Case $Result = 0 messagebox ("Files are exact matches in target & Backup directories..."+ @DATE,"alert", 48) EndSelectShell '%COMSPEC% /C START "" /WAIT net start;"FAH@@E:+Program;Files+Folding@@Home+F@@H1+FAH504-Console.exe"'Shell '%COMSPEC% /C START "" /WAIT net start;"FAH@@E:+Program;Files+Folding@@Home+F@@H2+FAH504-Console.exe"'ENDIFEXITAnd this:Break On$DATE = SPLIT(@DATE,"/") $DATE = JOIN($DATE,"-")$TQBackup = "V:\Data Backup\Game Backups\";Titan Quest Backup LocationIf @USERID = "2nd OCCT" messagebox ("Beginning Test","alert", 48) Shell '%COMSPEC% /C START "" /WAIT net start;"FAH@@E:+Program;Files+Folding@@Home+F@@H1+FAH504-Console.exe"'Shell '%COMSPEC% /C START "" /WAIT net start;"FAH@@E:+Program;Files+Folding@@Home+F@@H2+FAH504-Console.exe"' $Result = CompareFileTimes("C:\Scripts\testfile.txt", $TQBackup + "\CHKFileDir\testfile.txt")? Select Case $Result = 1 OR $Result = -3 messagebox ("Backing up Titan Quest Save-Game Files & restarting folding..."+ @DATE,"alert", 48) ? COPY "C:\Scripts\testfile.txt" $TQBackup + "\CHKFileDir\" @error? COPY "C:\Scripts\" "$TQBackup\$DATE\" /s @error ? Case $Result = -1 messagebox ("Files are newer in target directory..." + @DATE,"alert", 48) Case $Result = 0 messagebox ("Files are exact matches in target & Backup directories..."+ @DATE,"alert", 48) EndSelectENDIFEXITI also switched everything back to If...Endif statements to see if that would work.In all four cases the results are the same. The folding service is not restarted but the files to be backed up are copied properly. ("2nd OCCT" is user account I created to test this out.)I re-ran the logoff script that does only the restart to make sure that it still works. It does. I then added 'sleep 10' after the net start command to see what the heck the system was doing. (Show logoff scripts is still enabled under group policy.) Well, the wierd thing is that a console box comes up...with nothing in it!I must have ticked the script gods off or something! LOL!Couple more questions, if you please... 1. Many commands say they can be 'nested' as many times as memory allows. How do you properly 'nest' commands and how do you know how many 'nests' your memory can handle?Yeah, you can reorder the information after it's been split into an array. However, I recommend keeping it in YYYY.MM.DD format so it's listed alphabetically in chronological order in Windows Explorer. But, if you want to reorder it to MM.DD.YYYY, here ya go:$DATE = Split(@DATE,"/")$DATE = $DATE[1] + "." + $DATE[2] + "." + $DATE[0]2. Where did you learn this from? I ask because I looked at the command reference to see if there were examples like this but what it showed was pretty basic. Is there a resource available that I can use to study this kind of thing or is it just something that comes with experience?3. When you are formating a script...as in adding tabs to make it easier to read, does the script care or do we do that just to make it easier for us to read and follow what is happeing?4. Is using /*...*/ how you do block commenting? The user guide says to refer to that but there is no hyperlink for further detail nor is there any other mention of it on the commands page.I'll take a closer look at it tonightHehe...scroll up. I'd already looked at it and replied again. Yep, I realized that after I had posted...I guess we were both working on replies at the same time. Thanks again for your help! Link to comment Share on other sites More sharing options...
nmX.Memnoch Posted February 10, 2007 Share Posted February 10, 2007 It took me a few minutes of looking at it to figure out what's going on. You have an errant charactor in your net start command.start;"should bestart " Link to comment Share on other sites More sharing options...
InTheFlow Posted February 10, 2007 Author Share Posted February 10, 2007 You have an errant charactor in your net start command.start;"should bestart " Well, after I removed it from there and the one inbetween program files it worked! I don't know how I missed that but I sure am glad you didn't! Thanks again...did you by chance test out the copy command? Link to comment Share on other sites More sharing options...
nmX.Memnoch Posted February 11, 2007 Share Posted February 11, 2007 (edited) Sorry I missed these questions before...I got wrapped up in trying to figure out why the services code would all of a sudden stop working. 1. Many commands say they can be 'nested' as many times as memory allows. How do you properly 'nest' commands and how do you know how many 'nests' your memory can handle?Nesting commands is when you do something like:If @USERID = "Account1" Use X: "\\SERVER\SHARE1"Else If @USERID = "Account2" Use X: "\\SERVER\SHARE2" EndIfEndIfOrSelect Case $X = "XValue1" COPY "$XFILE1" $XFILE2" Case $X = "XValue2" Select Case $Y = "YValue1" COPY "$YFILE1" "$YFILE2" Case Y$ = $YValue2" COPY "$YFILE2" "$YFILE1" EndSelect Case $X = "XValue3" COPY "$XFILE2" "$XFILE1"EndSelectNotice how in both examples I've started another If...EndIf or Select...EndSelect command before the first one had finished. That's nesting commands. Unless you're writing extremely large scripts, declaring a lot of variables and/or nesting a lot of commands then memory shouldn't be much of a problem. My logon script at work is between 1100 and 1200 lines long...and I'm not anywhere close to worrying about it.Yeah, you can reorder the information after it's been split into an array. However, I recommend keeping it in YYYY.MM.DD format so it's listed alphabetically in chronological order in Windows Explorer. But, if you want to reorder it to MM.DD.YYYY, here ya go:$DATE = Split(@DATE,"/")$DATE = $DATE[1] + "." + $DATE[2] + "." + $DATE[0]2. Where did you learn this from? I ask because I looked at the command reference to see if there were examples like this but what it showed was pretty basic. Is there a resource available that I can use to study this kind of thing or is it just something that comes with experience?I've just picked it up from looking through other people's scripts. When you Split something you turn it into an array of variables. The number in the [] brackets represents an item in the array. In this case we split @DATE using the / character. So item [0] represents the first item in the array, which is the year in this case. Item [1] represents the second item in the array, or the month in this case. And item [2] represents the third item, or the day in this case.3. When you are formating a script...as in adding tabs to make it easier to read, does the script care or do we do that just to make it easier for us to read and follow what is happeing?Personally, I always use spaces instead of tabs...but that's just my preference. KiX doesn't really care if you use tabs or spaces, it's a free form language. What I mean by free form is that all three of the following are technically correct, but most people use the same type of formatting I've used throughout this post because it's easier to read:If @USERID = "User1" Use X: "\\SERVER\SHARE" EndIfIf @USERID = "User1"Use X: "\\SERVER\SHARE"EndIfIf @USERID = "User1" Use X: "\\SERVER\SHARE"EndIf4. Is using /*...*/ how you do block commenting? The user guide says to refer to that but there is no hyperlink for further detail nor is there any other mention of it on the commands page.With older versions of KiX you could only use the semicolon ( character for commenting out lines or adding explenation text. That meant that to comment out a section of the script you had to add a semicolon to the beginning of every line. It would end up looking like this:; Select; Case $X = "XValue1"; COPY "$XFILE1" $XFILE2"; Case $X = "XValue2"; Select; Case $Y = "YValue1"; COPY "$YFILE1" "$YFILE2"; Case Y$ = $YValue2"; COPY "$YFILE2" "$YFILE1"; EndSelect; Case $X = "XValue3"; COPY "$XFILE2" "$XFILE1"; EndSelectAnd explenation text looked like this:; Script created by xxxxxxxxxx xxxxxxxx; Last Updated: YYYY/MM/DD;; This script does this and that; edit line 23 to change the value of $X; etc etc etcWith the new /*.....*/ block commenting, anything between /* and */ is considered a comment and not processed by KiX. This means you can comment out entire sections of a script simply by adding /* before the section and */ after the section, like so:/*Select Case $X = "XValue1" COPY "$XFILE1" $XFILE2" Case $X = "XValue2" Select Case $Y = "YValue1" COPY "$YFILE1" "$YFILE2" Case Y$ = $YValue2" COPY "$YFILE2" "$YFILE1" EndSelect Case $X = "XValue3" COPY "$XFILE2" "$XFILE1"EndSelect*/You can also use it to format an explenation block so it's a little more noticeable/* ---------------------------------------------Script created by xxxxxxxxxx xxxxxxxxLast Updated: YYYY/MM/DDThis script does this and thatedit line 23 to change the value of $Xetc etc etc--------------------------------------------- */ Edited February 11, 2007 by nmX.Memnoch Link to comment Share on other sites More sharing options...
InTheFlow Posted February 11, 2007 Author Share Posted February 11, 2007 Sorry I missed these questions before...I got wrapped up in trying to figure out why the services code would all of a sudden stop working. No problem at all! I really appreciate you taking the time to answer them and to provide examples. It made it much easier to understand, thanks! I'm not sure how those ;s got into my script. At one point I had used them to block out a whole section of script during testing, so that may have been where they came from...now i can just use the /* */ so that shouldn't happen again. I went to set the script up to work 'for real' today and wound up messing it all up! However, I did finally figure everything out and got it working correctly. Now it backs up the Titan Quest save game files and restarts folding. It is so cool! I know, it doesn't take much to impress me...!Now to expand the script to do the same kind of backup it currently does for TQ for other games, all I need to do is something along the lines of this:If @USERID = "2nd OCCT" $Result = CompareFileTimes("C:\Scripts\testfile.txt", $TQBackup + "\CHKFileDir\testfile.txt") $Result1 = CompareFileTimes("Painkillersavefile", "Painkillersavefile") Select Case $Result = 1 OR $Result = -3 messagebox ("Backing up Titan Quest Save-Game Files & restarting folding...","alert", 48) ? COPY "C:\Scripts\testfile.txt" $TQBackup + "\CHKFileDir\" @error? COPY "C:\Scripts\" "$TQBackup\$DATE\" /s @error ? End Select Select Case $Result1 = 1 OR $Result1 = -3 COPY "C:\Scripts\testfile.txt" $TQBackup + "\CHKFileDir\" @error? COPY "C:\Scripts\" "$TQBackup\$DATE\" /s @error ? End SelectEndIfAm I on the right track here? Also, let me see if I understand the nesting stuff you explained...In the above example; the two end select commands are nested within the If..EndIf command. But the 2nd Select...End Select command is NOT nested within the first Select..End Select command because it comes after the previous End Select. Is this correct or have I jumped off the wrong side of the boat? Link to comment Share on other sites More sharing options...
nmX.Memnoch Posted February 11, 2007 Share Posted February 11, 2007 Yeah...you're on the right track. Since you're only checking $Result and $Result1 once each now (using an OR) you can go back to an If...EndIf.If @USERID = "2nd OCCT" $Result = CompareFileTimes("C:\Scripts\testfile.txt", $TQBackup + "\CHKFileDir\testfile.txt") $Result1 = CompareFileTimes("Painkillersavefile", "Painkillersavefile") If $Result = 1 OR $Result = -3 messagebox ("Backing up Titan Quest Save-Game Files & restarting folding...","alert", 48) ? COPY "C:\Scripts\testfile.txt" $TQBackup + "\CHKFileDir\" @error? COPY "C:\Scripts\" "$TQBackup\$DATE\" /s @error ? EndIf If $Result1 = 1 OR $Result1 = -3 COPY "C:\Scripts\testfile.txt" $TQBackup + "\CHKFileDir\" @error? COPY "C:\Scripts\" "$TQBackup\$DATE\" /s @error ? EndIfEndIfPainKiller is a game I play so I'll see if I can come up with some good code for doing backups for that.How long do you want to keep the backups for? Like say the last 2 months worth? I have some code in my backup scripts at work that only keeps the last six months worth of backup logs...it does a check and automatically deletes anything older than 180 days. Link to comment Share on other sites More sharing options...
InTheFlow Posted February 11, 2007 Author Share Posted February 11, 2007 PainKiller is a game I play so I'll see if I can come up with some good code for doing backups for that.How long do you want to keep the backups for? Like say the last 2 months worth? I have some code in my backup scripts at work that only keeps the last six months worth of backup logs...it does a check and automatically deletes anything older than 180 days.Yeah, the past two months is sufficient but only if backups have been made to the save game files recently. For example, I wouldn't want it to delete all save game files from a game that I hadn't played in over two months. Heck, there are some games I have with game save files that I haven't played in over a year! LOL!Maybe some code that looks at a directory for any changes at all and then backs them up if true would be helpful with game backups...hmmm. There seems to be many different ways to achieve good results with kixtart. Link to comment Share on other sites More sharing options...
nmX.Memnoch Posted February 11, 2007 Share Posted February 11, 2007 Hmmm...yeah, I'll have to figure something out for deleting older save games. I have a few ideas though.I remembered another editor that I've used before. The previous editors I mentioned are good for editing KiX scripts, VB scripts, XML, HTML, CMD scripts, etc, etc. This one is geared specifically towards KiX only and is free. It require's .NET 2.0, but so does AdminScriptEditor.http://www.thatguyssoftware.com/kixtarter.htmlIt has some nice features, but again I prefer AdminScriptEditor. One of the main reasons is that of the three, AdminScriptEditor is the only one that correctly interprets block commenting. Link to comment Share on other sites More sharing options...
InTheFlow Posted February 11, 2007 Author Share Posted February 11, 2007 Hmmm...yeah, I'll have to figure something out for deleting older save games. I have a few ideas though.I remembered another editor that I've used before. The previous editors I mentioned are good for editing KiX scripts, VB scripts, XML, HTML, CMD scripts, etc, etc. This one is geared specifically towards KiX only and is free. It require's .NET 2.0, but so does AdminScriptEditor.Thanks for the link! I d/led and installed it. I've been reading up on different editors. I've seen Textpad, EmEditor, Notepad ++, Programmer's Notepad, jEdit, & now kixtarter which all seem like worthy programs. They are also either open source or charge a nominal fee. So many options...so little time!I had an idea on the deleting old save game issue...maybe we could have the script check the backup directory for the most recent backup date/time, have it subtract 60 days and then delete anything older than that. How to implement that is another story though...hahahaha Link to comment Share on other sites More sharing options...
nmX.Memnoch Posted February 12, 2007 Share Posted February 12, 2007 Do those other editors have proper color coding for KiX? The trick is finding one that has syntax highlighting for KiX. A GOOD editor will also have popup features that offer help along the way. For instance, in AdminScriptEditor if I type the @ symbol it'll popup a list of all the built-in macros that I can choose from. Or if I'm doing a section to read a registry value using ReadValue() it'll popup tips and bold the current section of the command you're at. This is called ScriptSense in AdminScriptEditor. Here's a flash video:http://www.adminscripteditor.com/editor/sc...riptTips20.htmlThere are several other really nice features in the editor that I like (a wizard for MessageBox(), for Chr() and a few others). They're planning a major upgrade in the near future that will add some more features and support for other scripting languages. Link to comment Share on other sites More sharing options...
InTheFlow Posted February 12, 2007 Author Share Posted February 12, 2007 Do those other editors have proper color coding for KiX? The trick...other scripting languages.I have no idea if they have those features because I haven't actually checked them out yet. I watched the video...that is a really cool feature ASE has! The only thing that gets me about that program is that they charge $99 for it and then on top of that want $75 a year for 'upgrade protection'. Seems a little jacked up to me. But who knows, I might wind up going with it anyway... Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now