View difference between Paste ID: 4yhzuA9y and YZvvGPmW
SHOW: | | - or go back to the newest paste.
1
REM CopyRight Notice Block
2
 • -------------------------------------------
3
 • Name: SWEL 'Starbound Workshop Easy Linker'
4
 • Version: 1.0.6
5
 • Created by: Misunderstood Wookiee
6
 • Contributors:
7
 • CopyRight: (c) Aug 2016, All Rights Reserved!
8
 •--------------------------------------------
9
REM End of CopyRight Notice Block
10
REM START OF SCRIPT
11
@ECHO OFF
12
C: CD\
13
CLS
14
15
REM ---------------------------------------------------------------------------------------------------*
16
REM  				STEAM APPS AND DEDICATED SERVER MODS DIRECTORY CONFIGURATION
17
REM  						*** TO CHANGE: EDIT AFTER THE EQUALS SIGN
18
SET SteamAppsDir=%PROGRAMFILES(X86)%\Steam\steamapps
19-
SET DediServerModDir=%PROGRAMFILES(X86)%\Steam\steamapps\common\Starbound\mods
19+
SET DediServerModDir=D:\SteamLibrary\steamapps\common\Starbound\mods
20
REM ---------------------------------------------------------------------------------------------------
21
REM 	DO NOT EDIT PAST THIS POINT : DO NOT EDIT PAST THIS POINT : DO NOT EDIT PAST THIS POINT
22
23
24
REM QUE CHEESY STARBOUND BOOT SEQUENCE PRINT HAHA
25
COLOR 03
26
	ECHO {Boot Sequence Initiated}
27
TIMEOUT /t 2 /nobreak>nul
28
CLS
29
COLOR 06
30
	ECHO Booting S.A.I.L . . .
31
TIMEOUT /t 2 /nobreak>nul
32
CLS
33
COLOR 0A
34
	ECHO SAIL is awake! Now you have some guidance, and some company.
35
TIMEOUT /t 2 /nobreak>nul
36
GOTO MENU
37
REM END OF BLOCK
38
39
REM PRINT MAIN MENU
40
:MENU
41
CLS
42
COLOR 0A
43
	ECHO _____________Starbound Workshop Easy Linker ______________
44
	ECHO ______________________ Main Menu _________________________
45
	ECHO 1. Create Workshop Mod Links
46
	ECHO 2. Create a Copy of Workshop Mods
47
	ECHO 3. Credits
48
	ECHO -------------------------------------
49
	ECHO __________PRESS 'Q' TO QUIT__________
50
REM END OF BLOCK
51
52
REM MENU CHOICE SUB-ROUTINE BLOCK
53
SET INPUT=
54
SET /P INPUT=S.A.I.L: Please select a number:
55
IF /I '%INPUT%'=='1' GOTO SELECTION1
56
IF /I '%INPUT%'=='2' GOTO SELECTION2
57
IF /I '%INPUT%'=='3' GOTO SELECTION3
58
IF /I '%INPUT%'=='Q' GOTO QUIT
59
REM if no valid selection print this -
60
CLS
61
COLOR 0C
62
	ECHO ============INVALID INPUT============
63
	ECHO *************************************
64
	ECHO Please select a number from the Main Menu
65
	ECHO  [1-3] or select 'Q' to quit.
66
	ECHO *************************************
67
	ECHO ======PRESS ANY KEY TO CONTINUE======
68
PAUSE > NUL
69
GOTO MENU
70
REM END OF BLOCK
71
72
REM MENU SELECTION SUB-ROUTINES BLOCK
73
REM begin symbolic linking section
74
:SELECTION1
75
CLS
76
SETLOCAL EnableDelayedExpansion
77
FOR /D %%G IN ("%SteamAppsDir%\workshop\content\211820\*") DO (
78
    SET _target=%%~fG\contents.pak
79
    SET _link=!DediServerModDir!\%%~nG.pak
80
    IF EXIST "!_target!" (
81
        IF NOT EXIST "!_link!" (
82
            MKLINK "!_link!" "!_target!"
83
        ) ELSE (
84
            ECHO !_link! already exists.
85
        )
86
    )
87
)
88
ENDLOCAL
89
CLS
90
REM catch error if CMD is not elevated in administrator or something else fucks up!
91
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
92
CLS
93
COLOR 0A
94
	ECHO ==============S.A.I.L================
95
	ECHO Symbolic Link Process Completed
96
	ECHO -------------------------------------
97
	ECHO ======PRESS ANY KEY TO CONTINUE======
98
99
PAUSE > NUL
100
GOTO MENU 
101
REM end of symbolic linking section
102
103
REM begin copying files section
104
:SELECTION2
105
CLS
106
SETLOCAL EnableDelayedExpansion
107
FOR /D %%G IN ("%SteamAppsDir%\workshop\content\211820\*") DO (
108
    SET _file=%%~fG\contents.pak
109
    SET _dest=!DediServerModDir!\%%~nG.pak
110
    IF EXIST "!_file!" (
111
        IF NOT EXIST "!_dest!" (
112
            COPY /z /y "!_file!" "!_dest!"
113
        ) ELSE (
114
            COPY /z /-y "!_file!" "!_dest!"
115
        )
116
    )
117
)
118
ENDLOCAL
119
CLS
120
REM catch error if CMD is not elevated in administrator or something else fucks up!
121
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
122
CLS
123
COLOR 0A
124
	ECHO ==============S.A.I.L================
125
	ECHO Workshop Files Copied Succesfully
126
	ECHO -------------------------------------
127
	ECHO ======PRESS ANY KEY TO CONTINUE======
128
129
PAUSE > NUL
130
GOTO MENU
131
REM end of copying files section
132
133
REM begin print copy copyright section
134
:SELECTION3
135
CLS
136
COLOR 06
137
	ECHO *********************************************
138
	ECHO COPYRIGHT AND DISTRIBUTION
139
	ECHO *********************************************
140
	ECHO ___________________________________________________________________________
141
	ECHO You have permission to distrubute this program without any alteration and
142
	ECHO the copyright notice block is included without changes.
143
	ECHO ___________________________________________________________________________
144
	ECHO However you may -
145
	ECHO Decompile, and edit for personal use but NOT distribute
146
	ECHO altered versions of this program without permission from the author!
147
	ECHO ___________________________________________________________________________
148
	ECHO ---------------------------------------------
149
	ECHO Created by: Misunderstood Wookiee
150
	ECHO Contributors: 
151
	ECHO CopyRight: (c) Aug 2016, All Rights Reserved!
152
	ECHO ---------------------------------------------
153
	ECHO ======PRESS ANY KEY TO RETURN TO MAIN MENU======
154
PAUSE > NUL
155
GOTO MENU
156
REM end of copyright print section
157
158
REM begin quit section
159
:QUIT
160
CLS
161
COLOR 08
162
	ECHO ==============S.A.I.L===============
163
	ECHO __________SHUTTING DOWN!____________
164
	ECHO -------------------------------------
165
	ECHO ======PRESS ANY KEY TO QUIT======
166
PAUSE > NUL
167
EXIT
168
REM end of quit section - if it has not quit by now WTF and well just WTF!
169
REM END OF BLOCK
170
171
REM ERROR CATCH BLOCK
172
REM begin print ERROR
173
:ERROR
174
CLS
175
COLOR 0C
176
	ECHO =========S.A.I.L=========
177
	ECHO ______ERROR! ERROR!______
178
PAUSE > NUL
179
GOTO QUIT
180
REM end of print ERROR	
181
REM END OF BLOCK
182
183
REM SCRIPT ENDS HERE