forked from RaiderIO/raiderio-addon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
RaiderIO_DB.bat
87 lines (72 loc) · 1.93 KB
/
RaiderIO_DB.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
@echo off
setlocal enabledelayedexpansion
set toc_interface=80000
set toc_author=Vladinator ^(Voidzone-Ravencrest^) and Aspyr ^(Aspyrael-Skullcrusher^)
set toc_addon=RaiderIO
for %%r in (
"US Americas"
"EU Europe"
"KR Korea"
"TW Taiwan"
) do (
set r=%%r
set r1=!r:~1,2!
set r2=!r:~4,-1!
::"R Raiding"
for %%t in (
"M Mythic Plus"
) do (
set t=%%t
set t1=!t:~1,1!
set t2=!t:~3,-1!
set lt=!t2!
call :LoCase lt
call :UnScor lt
if !t1! neq M set t1=_!t1!
if !t1! equ M set t1=
if !lt! neq mythicplus set lt=_!lt!
if !lt! equ mythicplus set lt=
for %%f in (
"A Alliance"
"H Horde"
) do (
set f=%%f
set f1=!f:~1,1!
set f2=!f:~3,-1!
set d=.\RaiderIO_DB_!r1!_!f1!!t1!
set f=.\!d!\!d!.toc
set lr=!r1!
set lf=!f2!
call :LoCase lr
call :LoCase lf
echo !d! !f!
rmdir /s /q "!d!"
mkdir "!d!"
echo ## Interface: !toc_interface!>"!f!"
echo ## Title: Raider.IO ^|cffFFFFFF!t2!^|r ^(!r2! - !f2!^)>>"!f!"
echo ## Author: !toc_author!>>"!f!"
echo ## Dependencies: !toc_addon!>>"!f!"
echo ## DefaultState: enabled>>"!f!"
echo ## X-Type: !t2!>>"!f!"
echo ## X-Region: !r2!>>"!f!"
echo ## X-Faction: !f2!>>"!f!"
echo ## X-Website: https:^/^/raider.io>>"!f!"
echo ../!toc_addon!/db/db_!lr!_!lf!!lt!_characters.lua>>"!f!"
echo ../!toc_addon!/db/db_!lr!_!lf!!lt!_lookup.lua>>"!f!"
)
)
)
goto end
REM http://www.robvanderwoude.com/battech_convertcase.php
:LoCase
:: Subroutine to convert a variable VALUE to all lower case.
:: The argument for this subroutine is the variable NAME.
FOR %%i IN ("A=a" "B=b" "C=c" "D=d" "E=e" "F=f" "G=g" "H=h" "I=i" "J=j" "K=k" "L=l" "M=m" "N=n" "O=o" "P=p" "Q=q" "R=r" "S=s" "T=t" "U=u" "V=v" "W=w" "X=x" "Y=y" "Z=z") DO CALL SET "%1=%%%1:%%~i%%"
GOTO:EOF
:UnScor
:: Subroutine to convert spaces into empty strings.
:: The argument for this subroutine is the variable NAME.
FOR %%i IN (" =") DO CALL SET "%1=%%%1:%%~i%%"
GOTO:EOF
:end
pause