This is a Script for Windows PowerShell. This Script scan your Maps and zip it to .bz2 and upload it in the fastdownload.

07.02.2012
# Scripted by rainbow-six3
#
####### Set Config #####
#
# 7zip Path ONLY 32BIT Version! $7zip = 'C:\Program Files (x86)\7-Zip\'
$7zippath = ''
#
# Fastdownload Path $fdl= 'C:\inetpub\wwwroot\css\'
$fdlpath= ''
#
# CSS Map Path 'C:\Program Files (x86)\CSS\css\cstrike\'
$cspath = ''
#
#######Dont change it#######
####### Log File Path ...\cstrike\MapConverterLog.txt
$logpath = $cspath + 'MapConverterLog.txt'
####### Set Path #####
$mappath = $cspath + 'maps\'
$maplistpath = $cspath + 'maplist.txt'
$mapcyclepath = $cspath + 'mapcycle.txt'
#
####### Get Mapname ######
$mapname = dir $mappath *.bsp -name
#
#
####### Echo ##########
('#################### Counter Strike Map Converter #####################')
('------------------- Found this Maps:----------------')
echo $mapname
('##################')+(' Please Wait... ')+('##################')
('##################################')+(Get-Date –f "yyyy-MM-dd HH:mm:ss")+('##################################')|out-file -Append $logpath;
#
#
$list = 0..($mapname.count-1)
####### Opem 7zip Path ####
cd $7zippath
####### Zip Maps ####
$i = 0
while ($i -ile ($mapname.count-1)){
$split = $mapname[($i)].split(".");
$list[($i)] = ($split[0]);
$split[0] = $split[0] + ".bsp.bz2";
$goal = $fdlpath + $split[0];
$source = $mappath + $mapname[($i)];
if([IO.File]::Exists($goal) -ne $true)
{
.\7z a -tbzip2 -mmt=2 -mx9 $goal -aos $source|out-file -Append $logpath;
}
else
{
echo $source " --> OK"|out-file -Append $logpath;
}
('--------------------------------------------------------------------')|out-file -Append $logpath;
$i++
}
####### Write Maplist.txt and Mapcycle #######
echo $list |out-file $maplistpath;
echo $list |out-file $mapcyclepath;
#
####### Question #########
Write-Host "Finished. Show the Log file. Press any key to exit ..."
$x = $host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
#
#

Schreibe einen Kommentar