From 4f56462ea19f26ee9ebdf83bacdd975bb4bd580a Mon Sep 17 00:00:00 2001 From: Draqoken <67341000+audioses@users.noreply.github.com> Date: Sat, 12 Apr 2025 17:40:29 +0300 Subject: [PATCH] updated gaging functions --- installer.bat | 24 +++---- scripts/gagcreator.set | 86 ++++++++++++++----------- scripts/gags/{gags.set => MiscGags.set} | 0 3 files changed, 61 insertions(+), 49 deletions(-) rename scripts/gags/{gags.set => MiscGags.set} (100%) diff --git a/installer.bat b/installer.bat index 50264f7..7bd54aa 100644 --- a/installer.bat +++ b/installer.bat @@ -5,15 +5,6 @@ setlocal 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" @@ -42,7 +33,7 @@ if not exist "%GIT_PORTABLE%" ( :: --------- Handle Existing Cosmic Rage Folder --------- if exist "%TARGET_DIR%" ( echo The target folder already exists: "%TARGET_DIR%" - echo Would you like to delete and recreate it? (Y/N) + echo Would you like to delete and recreate it? Warning this may deleting existing scripts or set gags. This cannot be aborted! Please backup the folder. (Y/N) set "userchoice=" set /p userchoice=Your choice: if /i "%userchoice%"=="Y" ( @@ -77,7 +68,7 @@ echo [%DATE% %TIME%] Folder is ready. >> "%LOG_FILE%" echo [%DATE% %TIME%] Downloading sound files using Git sparse clone... >> "%LOG_FILE%" rd /s /q "%SOUNDS_DIR%" >nul 2>&1 -"%GIT_PORTABLE%" clone --depth=1 --filter=blob:none --sparse "%REPO_URL%" "%SOUNDS_DIR%" >> "%LOG_FILE%" 2>&1 +"%GIT_PORTABLE%" clone --depth=1 --filter=blob:none --sparse "%REPO_URL%" "%SOUNDS_DIR%" if errorlevel 1 ( echo [%DATE% %TIME%] ERROR: Git clone failed. >> "%LOG_FILE%" echo ERROR: Failed to clone repo. Check network or GitPortable version. @@ -86,7 +77,7 @@ if errorlevel 1 ( ) pushd "%SOUNDS_DIR%" -"%GIT_PORTABLE%" sparse-checkout set "%REPO_SUBFOLDER%" >> "%LOG_FILE%" 2>&1 +"%GIT_PORTABLE%" sparse-checkout set "%REPO_SUBFOLDER%" if not exist "%SOUNDS_DIR%\%REPO_SUBFOLDER%" ( echo [%DATE% %TIME%] ERROR: Failed to checkout sparse folder. >> "%LOG_FILE%" echo ERROR: Could not pull sparse folder. Check folder name or repo. @@ -126,6 +117,15 @@ if exist "%CURRENT_DIR%\scripts\settings.set" ( echo [%DATE% %TIME%] WARNING: scripts\settings.set not found. >> "%LOG_FILE%" echo WARNING: scripts\settings.set not found. ) +:: --------- Copy gags folder --------- +if exist "%CURRENT_DIR%\scripts\gags" ( + echo [%DATE% %TIME%] Copying gags folder >> "%LOG_FILE%" + xcopy /E /I /Y "%CURRENT_DIR%\scripts\gags" "%TARGET_DIR%\gags" >nul + echo gags folder copied to target directory. +) else ( + echo [%DATE% %TIME%] WARNING: scripts\gags folder not found. >> "%LOG_FILE%" + echo WARNING: scripts\gags folder not found. +) :: --------- Finish --------- echo [%DATE% %TIME%] Script completed successfully. >> "%LOG_FILE%" diff --git a/scripts/gagcreator.set b/scripts/gagcreator.set index ae308f1..d4e2b4b 100644 --- a/scripts/gagcreator.set +++ b/scripts/gagcreator.set @@ -1,46 +1,58 @@ -#alias setpreferedgag { -#if {%1 = 0} { -#var preferedgag voice} { -#var preferedgag all}} - -#var gagfile gags -#alias loadnewgag { -#file 4 {cosmic rage/gags/%1.set}; -#forall {@newgag} { -#write 4 {#trigger {%i} {~#gagline @preferedgag}}}; -#close 4; -#unload {cosmic rage/gags/%1.set};#load {cosmic rage/gags/%1.set}} - -#alias choosethefile { -#alarm 0.100 {#say {Please select the file that you would like this gag to be saved to. This is to prevent cluttering as vip mud has a limit for file length which cannot exceed 32000 characters so saving all of your gags in one place is not prefered} VoiceOnly}; -#pick {P:choos a file| -Activities:loadnewgag activitygags| -ships:loadnewgag shipgags| -Vehicles:loadnewgag vehiclegags| -misc:loadnewgag gags}} - #alias addnewgag { -#alarm 0.100 {#say {In the following prompt, enter the line that you would like to be gagged} VoiceOnly}; -#unvar newgag; -#prompt newgag {what line would you like to gag?}; -#if {%NumWords(@newgag)=0} {#say {You didn't enter anything} VoiceOnly} {gagmethod}} -#alias gagmethod {#pick {p:what kind of a gagging method do you prefer for this specific gag?| -Please gag only the speech, but keep it in my output:setpreferedgag 0| -gag it completely and don't show it in the output window:setpreferedgag 1}; -choosethefile} +#alarm 0.100 {#say {This prompt allows one to add a string that they would like to be gagged either completely or just from the speach queue. In order to do this, please use the options below} VoiceOnly}; +#pick {P:Creating a new gag| +What line are we gagging today? @newgag:setgagline| +What kind of the gagging method would you like? @gagmethod:setgagmethod| +What file is this going to be stored in? @gagfile:setgagfile| +I'm done and want to finish:pushnewgag| +I didn't mean to use this, please abort:#abort}} + +#alias setgagline { +#alarm 0.100 {#say {please enter the line that you would like to be gagged, if parts of it are not static, E.G random numbers or words, replace this bit by an asterisc, *} VoiceOnly}; +#prompt newgag {Enter the line here.}; +addnewgag} + +#alias setgagmethod { +#alarm 0.100 {#say {please choose one of the methods below:} VoiceOnly}; +#pick {P:Method?| +Omit the line from my speech queue but leave it in the output window:#var gagmethod voice| +Omit the line both from the output window and from my speech queue:#var gagmethod all}; +addnewgag} +#alias setgagfile { +#alarm 0.100 {#say {Due to VIPMud limitations, a file cannot exceed 32000 characters in length, this is why it is recommended to sort your gags into categories, so please choose from one of the files below:} VoiceOnly}; +#pick {P:What file are we using today?| +Activity related gags:#var gagfile ActivityGags| +Ship Related Gags:#var gagfile ShipGags| +Miscellaneous gags:#var gagfile MiscGags| +Vehicle Related gags:#var gagfile VehicleGags}; +addnewgag} + +#alias pushnewgag { +#file 3 {%CharInfo(MudName)/gags/@gagfile.set}; +#forall {@newgag} { +#write 3 {~#trigger {%i} {~#gagline @gagmethod}}}; +#close 3; +#unload {gags/@gagfile.set}; +#load {gags/@gagfile.set}; +#unvar gagmethod;#unvar newgag;#unvar gagfile; +#say {Complete!} VoiceOnly} #alias miscgagtoggle { -#if {@miscgags="disabled"} {#var miscgags "enabled";#load {gags/gags.set}} {#var miscgags "disabled";#unload {gags/gags.set}}} +#if {@MiscGags="disabled"} {#var MiscGags "enabled";#load {@scpath/gags/MiscGags.set}} {#var MiscGags "disabled";#unload {@scpath/gags/gags.set}}} #alias vehiclegagtoggle { -#if {@vehiclegags="disabled"} {#var vehiclegags "enabled"; #unload {gags/vehiclegags.set}} {#var vehiclegags "disabled";#load {gags/vehiclegags.set}}} +#if {@VehicleGags="disabled"} {#var VehicleGags "enabled"; #unload {@scpath/gags/VehicleGags.set}} {#var VehicleGags "disabled";#load {@scpath/gags/VehicleGags.set}}} #alias activitygagtoggle { -#if {@activitygags="disabled"} {#var activitygags "enabled";#load {gags/activitygags.set}} {#var activitygags "disabled";#unload {gags/activitygags.set}}} +#if {@ActivityGags="disabled"} {#var ActivityGags "enabled";#load {@scpath/gags/ActivityGags.set}} {#var ActivityGags "disabled";#unload {@scpath/gags/ActivityGags.set}}} #alias shipgagtoggle { -#if {@shipgags="disabled"} {#var shipgags "enabled";#load {gags/shipgags.set}} {#var shipgags "disabled";#unload {gags/shipgags.set}}} +#if {@ShipGags="disabled"} {#var ShipGags "enabled";#load {@scpath/gags/ShipGags.set}} {#var ShipGags "disabled";#unload {@scpath/gags/ShipGags.set}}} #alias gagconfig { #pick {P:Please select an option below| -Activity-related gags (@activitygags):activitygagtoggle| -Ship-related gags (@shipgags):shipgagtoggle| -Vehicle-related gags (@vehiclegags):vehiclegagtoggle| -Misc Gags (@miscgags):miscgagtoggle}} +Activity-related gags (@ActivityGags):activitygagtoggle| +Ship-related gags (@ShipGags):shipgagtoggle| +Vehicle-related gags (@VehicleGags):vehiclegagtoggle| +Misc Gags (@MiscGags):miscgagtoggle| +Open Activity gags file for editing:#edit {%CharInfo(MudName)/gags/ActivityGags.set}| +Open Vehicle gags file for editing:#edit {%CharInfo(MudName)/gags/VehicleGags.set}| +Open misc gags file for editing:#edit {%CharInfo(MudName)/gags/MiscGags.set}| +Open ship-related gags file for editing:#edit {%CharInfo(MudName)/gags/ShipGags.set}}} #key {alt-f2} {gagconfig} \ No newline at end of file diff --git a/scripts/gags/gags.set b/scripts/gags/MiscGags.set similarity index 100% rename from scripts/gags/gags.set rename to scripts/gags/MiscGags.set