diff --git a/cosmic_setup.log b/cosmic_setup.log new file mode 100644 index 0000000..876d630 --- /dev/null +++ b/cosmic_setup.log @@ -0,0 +1,2 @@ +[Sal 08.04.2025 2:40:48,68] Starting script... +[Sal 08.04.2025 2:40:48,71] ERROR: Script not run as administrator. diff --git a/installer.bat b/installer.bat new file mode 100644 index 0000000..1021223 --- /dev/null +++ b/installer.bat @@ -0,0 +1,88 @@ +@echo off +setlocal + +:: --------- Setup Log --------- +set "LOG_FILE=cosmic_setup.log" +echo [%DATE% %TIME%] Starting script... > "%LOG_FILE%" + +:: --------- Admin Check --------- +net session >nul 2>&1 +if %errorlevel% neq 0 ( + echo You must run this script as Administrator! + echo [%DATE% %TIME%] ERROR: Script not run as administrator. >> "%LOG_FILE%" + pause + exit /b +) +echo [%DATE% %TIME%] Admin check passed. >> "%LOG_FILE%" + +:: --------- Define Paths --------- +set "CURRENT_DIR=%~dp0" +if "%CURRENT_DIR:~-1%"=="\" set "CURRENT_DIR=%CURRENT_DIR:~0,-1%" + +set "TARGET_DIR=%USERPROFILE%\Documents\VIP Mud\Cosmic Rage" +set "SET_FILE=%TARGET_DIR%\cosmic rage.set" +set "LOADER_FILE=%TARGET_DIR%\loader.set" + +echo [%DATE% %TIME%] Script location: %CURRENT_DIR% >> "%LOG_FILE%" +echo [%DATE% %TIME%] Target directory: %TARGET_DIR% >> "%LOG_FILE%" + +:: --------- Handle Existing Folder --------- +if exist "%TARGET_DIR%" ( + echo The target folder already exists: "%TARGET_DIR%" + echo Would you like to delete and recreate it? (Y/N) + set "userchoice=" + set /p userchoice=Your choice: + if /i "%userchoice%"=="Y" ( + echo [%DATE% %TIME%] Deleting existing folder... >> "%LOG_FILE%" + rd /s /q "%TARGET_DIR%" + if exist "%TARGET_DIR%" ( + echo [%DATE% %TIME%] ERROR: Could not delete folder. >> "%LOG_FILE%" + echo ERROR: Could not delete folder. Files might be in use. + pause + exit /b + ) + echo Creating fresh folder... + mkdir "%TARGET_DIR%" + ) else ( + echo [%DATE% %TIME%] Keeping existing folder. >> "%LOG_FILE%" + echo Continuing with existing folder... + ) +) else ( + echo [%DATE% %TIME%] Folder does not exist. Creating new one. >> "%LOG_FILE%" + mkdir "%TARGET_DIR%" +) + +if not exist "%TARGET_DIR%" ( + echo [%DATE% %TIME%] ERROR: Failed to create folder. >> "%LOG_FILE%" + echo ERROR: Could not create folder. Check permissions or path. + pause + exit /b +) +echo [%DATE% %TIME%] Folder is ready. >> "%LOG_FILE%" + +:: --------- Create cosmic rage.set --------- +if not exist "%SET_FILE%" ( + echo [%DATE% %TIME%] Creating cosmic rage.set >> "%LOG_FILE%" + ( + echo #Load ^{%%CharInfo^(MudName^)/loader.set^} + echo #If ^{%%Defined^(scpath^)=1 and %%Defined^(sppath^)=1^} ^{ #Load @scpath/Main.set^} ^{ #Say ^{WARNING! The scripts path and/or the sounds path are not defined. Unable to load the soundpack!^}^} + ) > "%SET_FILE%" + echo Created: cosmic rage.set +) else ( + echo cosmic rage.set already exists. +) + +:: --------- Create loader.set --------- +if not exist "%LOADER_FILE%" ( + echo [%DATE% %TIME%] Creating loader.set >> "%LOG_FILE%" + echo #Var scpath ^{%CURRENT_DIR%^/scripts} > "%LOADER_FILE%" + echo Created: loader.set +) else ( + echo loader.set already exists. +) + +:: --------- Finish --------- +echo [%DATE% %TIME%] Script completed successfully. >> "%LOG_FILE%" +echo Setup complete. Files are in "%TARGET_DIR%". +pause +exit /b diff --git a/Cosmic rage/gagcreator.set b/scripts/gagcreator.set similarity index 100% rename from Cosmic rage/gagcreator.set rename to scripts/gagcreator.set diff --git a/Cosmic rage/gags/activitygags.set b/scripts/gags/activitygags.set similarity index 100% rename from Cosmic rage/gags/activitygags.set rename to scripts/gags/activitygags.set diff --git a/Cosmic rage/gags/gags.set b/scripts/gags/gags.set similarity index 100% rename from Cosmic rage/gags/gags.set rename to scripts/gags/gags.set diff --git a/Cosmic rage/gags/shipgags.set b/scripts/gags/shipgags.set similarity index 100% rename from Cosmic rage/gags/shipgags.set rename to scripts/gags/shipgags.set diff --git a/Cosmic rage/gags/vehiclegags.set b/scripts/gags/vehiclegags.set similarity index 100% rename from Cosmic rage/gags/vehiclegags.set rename to scripts/gags/vehiclegags.set diff --git a/Cosmic rage/keys readme.html b/scripts/keys readme.html similarity index 100% rename from Cosmic rage/keys readme.html rename to scripts/keys readme.html diff --git a/Cosmic rage/Cosmic rage.set b/scripts/main.set similarity index 85% rename from Cosmic rage/Cosmic rage.set rename to scripts/main.set index 40b8356..6ac6db8 100644 --- a/Cosmic rage/Cosmic rage.set +++ b/scripts/main.set @@ -19,9 +19,9 @@ #gvar disconnected 1; ActualSave; #say {Settings saved!}} #trigger {$sphook &{race}; &{action}:&{soundpath}:&{volume}:&{pitch}:&{pan}:&{id}} { -#if {@action = "loop"} {#playloop {Cosmic Rage/@soundpath.wav} @volume; #var @id %playhandle}; -#if {@action = "playrec"} {#play {Cosmic Rage/@soundpath.wav} @volume; #var @id %playhandle}; -#if {@action = "play"} {#play {Cosmic Rage/@soundpath.wav} @volume}; #if {@pan <> "na"} {#math pan {@pan * 50}; #pc %playhandle pan @pan}; #if {@pitch <> "na"} {#pc %playhandle frequency @pitch} {#pc %playhandle frequency 44100}; +#if {@action = "loop"} {#playloop {@sppath/@soundpath.wav} @volume; #var @id %playhandle}; +#if {@action = "playrec"} {#play {@sppath/@soundpath.wav} @volume; #var @id %playhandle}; +#if {@action = "play"} {#play {@sppath/@soundpath.wav} @volume}; #if {@pan <> "na"} {#math pan {@pan * 50}; #pc %playhandle pan @pan}; #if {@pitch <> "na"} {#pc %playhandle frequency @pitch} {#pc %playhandle frequency 44100}; #if {@action = "stop"} {#if {%defined(@id) = 1} {#pc %var(@id) stop}}; #if {@action = "adjust"} {#if {%defined(@id) = 1} {#if {@volume <> "na"} {#pc %var(@id) volume @volume}; #if {@pan <> "na"} {#pc %var(@id) pan @pan}; #if {@pitch <> "na"} {#pc %var(@id) frequency @pitch}}}; #gagline all} #Alias login {#gagon all; 1; %charInfo(name); #wait (0.1); #ungagon; %charInfo(password)} diff --git a/Cosmic rage/misc.set b/scripts/misc.set similarity index 100% rename from Cosmic rage/misc.set rename to scripts/misc.set diff --git a/Cosmic rage/settings.set b/scripts/settings.set similarity index 100% rename from Cosmic rage/settings.set rename to scripts/settings.set