View Full Version : LazyBoxer Utilities v0.1
Vyndree
06-23-2008, 07:47 PM
www.dual-boxing.com/forums/index.php%3Fpage%3DThread%26threadID%3D3030+LazyBo xer+Utilities+v0.1&hl=en&ct=clnk&cd=1&gl=us ('http://209.85.173.104/search?q=cache:AVBXz7bDr7QJ:Yay google cache -- bad delete-happy Vyndree!
This tool is used for keeping your multiple WoW directories in sync. I decided to write this per Xzin's request on the general forums. I saw other great ideas using subversion or some other form of source control, but decided to provide a simple, easy to use batch script for the time being.
If you ever find yourself annoyed by having to copy your ui/macro settings from your main to your alts by hand, this may be of use to you. We are lazy, so why not have a tool that promotes it?
Note: This is currently a simple batch script. If anyone has any suggestions on refactoring this code, additional features, or any other ideas, let me know and I'll do what I can and update this post. I am hoping this evolves into an open community effort.
Current Features:- Menu Driven
- Update Macros
- Update Addons
- Update Addon Configuration
- Update Keybindings
- Update General UI Settings
Planned Features:
- Pushing patches
- Backup current settings
- Provide a more dynamic input
How to use?
1. Copy the code in the next post and paste it into notepad
2. File -> Save As
3. Save the file with a .bat extension (Example: LazyBoxer.bat) and save it as type All Files
4. Edit the variables at the top of the batch script to match your environment. Files are copied from the 'main' variables.
5. Run the batch file
Vyndree
06-23-2008, 07:48 PM
@echo off
REM ------------------------------------------------------------------------------------------
REM
REM Change these variables to match your current settings
REM
REM ------------------------------------------------------------------------------------------
set gamedirmain=c:\games\wowx
set gamedir1=c:\games\wowa
set gamedir2=c:\games\wowb
set gamedir3=c:\games\wowc
set gamedir4=c:\games\wowd
set realm=Magtheridon
set accountmain=goosex
set account1=goosea
set account2=gooseb
set account3=goosec
set account4=goosed
set charmain=xmeh
set char1=ameh
set char2=bmeh
set char3=cmeh
set char4=dmeh
REM ------------------------------------------------------------------------------------------
REM
REM Menu
REM
REM ------------------------------------------------------------------------------------------
:menu
cls
echo ---------------------------------
echo LazyBoxer Utilities
echo Author: wougoose
echo ---------------------------------
echo What would you like to update?
echo 1. Macros
echo 2. General UI / Layout / Chat Settings
echo 3. Installed Addons
echo 4. Addon Configuration
echo 5. Key Bindings
echo 6. Exit
set /p choice=
goto :%choice%
REM ------------------------------------------------------------------------------------------
REM
REM Utilities
REM
REM ------------------------------------------------------------------------------------------
:1
echo Updating Macros...
xcopy %gamedirmain%\WTF\Account\%accountmain%\macros-cache.txt %gamedir1%\WTF\Account\%account1%\ /y
xcopy %gamedirmain%\WTF\Account\%accountmain%\macros-cache.txt %gamedir2%\WTF\Account\%account2%\ /y
xcopy %gamedirmain%\WTF\Account\%accountmain%\macros-cache.txt %gamedir3%\WTF\Account\%account3%\ /y
xcopy %gamedirmain%\WTF\Account\%accountmain%\macros-cache.txt %gamedir4%\WTF\Account\%account4%\ /y
xcopy %gamedirmain%\WTF\Account\%accountmain%\macros-local.txt %gamedir1%\WTF\Account\%account1%\ /y
xcopy %gamedirmain%\WTF\Account\%accountmain%\macros-local.txt %gamedir2%\WTF\Account\%account2%\ /y
xcopy %gamedirmain%\WTF\Account\%accountmain%\macros-local.txt %gamedir3%\WTF\Account\%account3%\ /y
xcopy %gamedirmain%\WTF\Account\%accountmain%\macros-local.txt %gamedir4%\WTF\Account\%account4%\ /y
xcopy %gamedirmain%\WTF\Account\%accountmain%\%realm%\%c harmain%\macros-cache.txt %gamedir1%\WTF\Account\%account1%\%realm%\%char1%\ /y
xcopy %gamedirmain%\WTF\Account\%accountmain%\%realm%\%c harmain%\macros-cache.txt %gamedir2%\WTF\Account\%account2%\%realm%\%char2%\ /y
xcopy %gamedirmain%\WTF\Account\%accountmain%\%realm%\%c harmain%\macros-cache.txt %gamedir3%\WTF\Account\%account3%\%realm%\%char3%\ /y
xcopy %gamedirmain%\WTF\Account\%accountmain%\%realm%\%c harmain%\macros-cache.txt %gamedir4%\WTF\Account\%account4%\%realm%\%char4%\ /y
xcopy %gamedirmain%\WTF\Account\%accountmain%\%realm%\%c harmain%\macros-local.txt %gamedir1%\WTF\Account\%account1%\%realm%\%char1%\ /y
xcopy %gamedirmain%\WTF\Account\%accountmain%\%realm%\%c harmain%\macros-local.txt %gamedir2%\WTF\Account\%account2%\%realm%\%char2%\ /y
xcopy %gamedirmain%\WTF\Account\%accountmain%\%realm%\%c harmain%\macros-local.txt %gamedir3%\WTF\Account\%account3%\%realm%\%char3%\ /y
xcopy %gamedirmain%\WTF\Account\%accountmain%\%realm%\%c harmain%\macros-local.txt %gamedir4%\WTF\Account\%account4%\%realm%\%char4%\ /y
echo Finished, Press any key to contine...
pause >nul
goto :menu
:2
echo Updating General UI / Layout / Chat Settings...
xcopy %gamedirmain%\WTF\Account\%accountmain%\SavedVaria bles.lua %gamedir1%\WTF\Account\%account1%\ /y
xcopy %gamedirmain%\WTF\Account\%accountmain%\SavedVaria bles.lua %gamedir2%\WTF\Account\%account2%\ /y
xcopy %gamedirmain%\WTF\Account\%accountmain%\SavedVaria bles.lua %gamedir3%\WTF\Account\%account3%\ /y
xcopy %gamedirmain%\WTF\Account\%accountmain%\SavedVaria bles.lua %gamedir4%\WTF\Account\%account4%\ /y
xcopy %gamedirmain%\WTF\Account\%accountmain%\%realm%\%c harmain%\layout-cache.txt %gamedir1%\WTF\Account\%account1%\%realm%\%char1%\ /y
xcopy %gamedirmain%\WTF\Account\%accountmain%\%realm%\%c harmain%\layout-cache.txt %gamedir2%\WTF\Account\%account2%\%realm%\%char2%\ /y
xcopy %gamedirmain%\WTF\Account\%accountmain%\%realm%\%c harmain%\layout-cache.txt %gamedir3%\WTF\Account\%account3%\%realm%\%char3%\ /y
xcopy %gamedirmain%\WTF\Account\%accountmain%\%realm%\%c harmain%\layout-cache.txt %gamedir4%\WTF\Account\%account4%\%realm%\%char4%\ /y
xcopy %gamedirmain%\WTF\Account\%accountmain%\%realm%\%c harmain%\chat-cache.txt %gamedir1%\WTF\Account\%account1%\%realm%\%char1%\ /y
xcopy %gamedirmain%\WTF\Account\%accountmain%\%realm%\%c harmain%\chat-cache.txt %gamedir2%\WTF\Account\%account2%\%realm%\%char2%\ /y
xcopy %gamedirmain%\WTF\Account\%accountmain%\%realm%\%c harmain%\chat-cache.txt %gamedir3%\WTF\Account\%account3%\%realm%\%char3%\ /y
xcopy %gamedirmain%\WTF\Account\%accountmain%\%realm%\%c harmain%\chat-cache.txt %gamedir4%\WTF\Account\%account4%\%realm%\%char4%\ /y
echo Finished, Press any key to contine...
pause >nul
goto :menu
:3
echo Updating Installed Addons...
xcopy %gamedirmain%\Interface %gamedir1%\Interface /d /s
xcopy %gamedirmain%\Interface %gamedir2%\Interface /d /s
xcopy %gamedirmain%\Interface %gamedir3%\Interface /d /s
xcopy %gamedirmain%\Interface %gamedir4%\Interface /d /s
echo Finished, Press any key to contine...
pause >nul
goto :menu
:4
echo Updating Addon Configuration...
xcopy %gamedirmain%\WTF\Account\%accountmain%\SavedVaria bles %gamedir1%\WTF\Account\%account1%\SavedVariables /s /y
xcopy %gamedirmain%\WTF\Account\%accountmain%\SavedVaria bles %gamedir2%\WTF\Account\%account2%\SavedVariables /s /y
xcopy %gamedirmain%\WTF\Account\%accountmain%\SavedVaria bles %gamedir3%\WTF\Account\%account3%\SavedVariables /s /y
xcopy %gamedirmain%\WTF\Account\%accountmain%\SavedVaria bles %gamedir4%\WTF\Account\%account4%\SavedVariables /s /y
xcopy %gamedirmain%\WTF\Account\%accountmain%\%realm%\%c harmain%\SavedVariables %gamedir1%\WTF\Account\%account1%\%realm%\%char1%\ SavedVariables /s /y
xcopy %gamedirmain%\WTF\Account\%accountmain%\%realm%\%c harmain%\SavedVariables %gamedir2%\WTF\Account\%account2%\%realm%\%char2%\ SavedVariables /s /y
xcopy %gamedirmain%\WTF\Account\%accountmain%\%realm%\%c harmain%\SavedVariables %gamedir3%\WTF\Account\%account3%\%realm%\%char3%\ SavedVariables /s /y
xcopy %gamedirmain%\WTF\Account\%accountmain%\%realm%\%c harmain%\SavedVariables %gamedir4%\WTF\Account\%account4%\%realm%\%char4%\ SavedVariables /s /y
echo Finished, Press any key to contine...
pause >nul
goto :menu
:5
echo Updating Key Bindings...
xcopy %gamedirmain%\WTF\Account\%accountmain%\bindings-cache.wtf %gamedir1%\WTF\Account\%account1%\ /y
xcopy %gamedirmain%\WTF\Account\%accountmain%\bindings-cache.wtf %gamedir2%\WTF\Account\%account2%\ /y
xcopy %gamedirmain%\WTF\Account\%accountmain%\bindings-cache.wtf %gamedir3%\WTF\Account\%account3%\ /y
xcopy %gamedirmain%\WTF\Account\%accountmain%\bindings-cache.wtf %gamedir4%\WTF\Account\%account4%\ /y
xcopy %gamedirmain%\WTF\Account\%accountmain%\%realm%\%c harmain%\bindings-cache.wtf %gamedir1%\WTF\Account\%account1%\%realm%\%char1%\ /y
xcopy %gamedirmain%\WTF\Account\%accountmain%\%realm%\%c harmain%\bindings-cache.wtf %gamedir2%\WTF\Account\%account2%\%realm%\%char2%\ /y
xcopy %gamedirmain%\WTF\Account\%accountmain%\%realm%\%c harmain%\bindings-cache.wtf %gamedir3%\WTF\Account\%account3%\%realm%\%char3%\ /y
xcopy %gamedirmain%\WTF\Account\%accountmain%\%realm%\%c harmain%\bindings-cache.wtf %gamedir4%\WTF\Account\%account4%\%realm%\%char4%\ /y
echo Finished, Press any key to contine...
pause >nul
goto :menu
:6
well, I was playing around with your script last night and was quite annoyed at all the add-ons that stored their settings in account wide files under the saved variables folder with separate sections for each character. So I wrote a little script in VBS (sorry didn't know how to do it in command line) that would go through and change every instance of the accountmain to the slave characters name within all of the actual files inside the savedvariables folder. Doing this with the rest of the batch wougoose wrote should pretty well synch everything.
so, incase/if anyone wants it. Here is what I did.
I added this to the ":4 echo Updating Addon Configuration..." section
C:\Scripts\SavedVariables.vbs "%gamedir1%\WTF\Account\% account1%\SavedVariables" %charmain% %char1%
C:\Scripts\SavedVariables.vbs "%gamedir2%\WTF\Account\% account2%\SavedVariables" %charmain% %char2%
C:\Scripts\SavedVariables.vbs "%gamedir3%\WTF\Account\% account3%\SavedVariables" %charmain% %char3%
C:\Scripts\SavedVariables.vbs "%gamedir4%\WTF\Account\% account4%\SavedVariables" %charmain% %char4%
And created a text filed named SavedVariables.vbs in my C:\Scripts\ folder with the following code in it. I do not know it is a bit sloppy, but hey, I am not a professional.
on error resume next
dim words(5000)
set fso = createobject("scripting.filesystemobject")
path = WScript.Arguments(0)
SearchString = WScript.Arguments(1)
ReplaceString = WScript.Arguments(2)
set parent = fso.getfolder(path)
for each file in parent.files
' FSO Constants
Const ForReading = 1
Const ForWriting = 2
Const ForAppending = 8
Const TristateUseDefault= -2
Const TristateTrue = -1
Const TristateFalse = 0
'InStr() and Replace() constants
'Const vbBinaryCompare = 0
'Const vbTextCompare = 1
' Variables
Dim objFSO, objTS, s
sfs = ""
' Instantiate the object
Set objFSO = CreateObject("Scripting.FileSystemObject")
' open the text file read only
Set objTS = objFSO.OpenTextFile(path &"\"& file.name, ForReading, False, TristateUseDefault)
Do While objTS.AtEndOfStream <> True
s = CStr(objTS.ReadLine())
If InStr(1, s, SearchString, vbTextCompare) <> 0 Or _
InStr(1 , s, SearchString, vbTextCompare) <> Null Then
s = Replace(s, SearchString, ReplaceString)
End If
sFS = sFS & s & vbCrLf
Loop
' Close the file after we read it in.
objTS.Close
Set objTS = Nothing
'WSCRIPT.ECHO X
' We now open the file to write it out
Set objTS = objFSO.OpenTextFile(path &"\"& file.name, ForWriting, False, TristateUseDefault)
objTS.Write sFS
objTS.Close
Set objTS = Nothing
Set objFSO = Nothing
next
Most of the script was hacked together from other scripts on the MSDN site. But there ya go. Any thoughts or comments would be very welcome.
ruineraz
10-28-2008, 06:33 PM
nice job on the batch script, i do something manually now. definitely worth looking at your script and changing.
My only problem is that I have several toons on the same account, and each ADDON works in different ways. Some use the %ACCOUNT%\SaveVariables folder, where others use %ACCOUNT%\%SERVER%\%TOON%\Save Variables folder.
Gattsbr
01-20-2009, 10:36 AM
Defiantly needed this. Also it would be nice to sync the Config.WTF file, with account name, how ever i don't know alot about this stuff, or i would of just added it all into this batch script, though some research and another batch file i was able to accomplish this. basicly it copies my config.wtf file, and modifies the account name from the main account to the others so here it goes.
first i replaced the :menu section so looked like this:
:menu
cls
echo ---------------------------------
echo LazyBoxer Utilities
echo Author: wougoose
echo ---------------------------------
echo What would you like to update?
echo 1. Macros
echo 2. General UI / Layout / Chat Settings
echo 3. Installed Addons
echo 4. Addon Configuration
echo 5. Key Bindings
echo 6. Config.wtf
echo 7. Exit
set /p choice=
goto :%choice%
Next i went to the bottom where :6 is and changed, however when i post it on here it shows up as ¬count1% would be % a c c o u n t 1 % without the spaces.
:6
Echo Updating Config.wtf for account:¬count1%
call lbwtf.bat ¬countmain% ¬count1% %gamedirmain%\WTF\config.wtf>%gamedir1%\WTF\config.wtf
Echo Updating Config.wtf for account:¬count2%
call lbwtf.bat ¬countmain% ¬count2% %gamedirmain%\WTF\config.wtf>%gamedir2%\WTF\config.wtf
Echo Updating Config.wtf for account:¬count3%
call lbwtf.bat ¬countmain% ¬count3% %gamedirmain%\WTF\config.wtf>%gamedir3%\WTF\config.wtf
Echo Updating Config.wtf for account:¬count4%
call lbwtf.bat ¬countmain% ¬count4% %gamedirmain%\WTF\config.wtf>%gamedir4%\WTF\config.wtf
echo Finished, Press any key to contine...
pause >nul
goto :menu
:7
Next i copied this batch script into a file named lbwtf.bat
@echo off
REM -- Prepare the Command Processor --
SETLOCAL ENABLEEXTENSIONS
SETLOCAL DISABLEDELAYEDEXPANSION
::BatchSubstitude - parses a File line by line and replaces a substring"
::syntax: BatchSubstitude.bat OldStr NewStr File
:: OldStr [in] - string to be replaced
:: NewStr [in] - string to replace with
:: File [in] - file to be parsed
if "%*"=="" findstr "^::" "%~f0"&GOTO:EOF
for /f "tokens=1,* delims=]" %%A in ('"type %3|find /n /v """') do (
set "line=%%B"
if defined line (
call set "line=echo.%%line:%~1=%~2%%"
for /f "delims=" %%X in ('"echo."%%line%%""') do %%~X
) ELSE echo.
)
and thats it, i just keep both batch files in the same folder and everything is great 8o
onelasttry
02-12-2009, 03:04 AM
For those of you who don’t want to or can’t do scripts try a product called GOODSYNC. I believe there is still a free version that will handle what you need for this and can be set to copy to multiple machines, when they come on line or at set times etc so very flexible, you can exclude certain files which is useful as there are some settings you don’t want to move across.
Anyway just a GUI way of doing things for the non-technical. I'm sure there are lots of similar products I have just found this one very good.
www.goodsync.com ('http://www.goodsync.com/')
vBulletin® v4.2.2, Copyright ©2000-2025, Jelsoft Enterprises Ltd.