Compare commits

17 Commits

Author SHA1 Message Date
Augustus
d7204f84c9 by popular demand, f11 will now stop all currently playing loops and will restart the soundpack as well as flush the speech queue. If you want simply to stop sounds without restarting them you can use alt-f12 to do so 2026-02-24 01:41:38 +02:00
Augustus
7506c96cde fixed a typo in the word automatically and ensured that 'na' won't get downloaded 2026-02-19 11:43:00 +02:00
Augustus
c2eba61ad8 Update main.set 2026-02-12 17:27:42 +02:00
Augustus
c5bc498710 getting rid of start.set 2026-02-12 17:26:14 +02:00
Augustus
12f149f115 Update main.set 2026-02-11 03:26:43 +02:00
Augustus
badfb1b88b got rid of all the for loops which should fix the loading problem entirely 2026-02-11 03:24:35 +02:00
Augustus
c3a2933644 Update main.set 2026-02-09 22:31:20 +02:00
Augustus
53557fe0d2 Update updator.set 2026-02-09 22:30:49 +02:00
Augustus
838d23e2de sounds will stop when you reconnect now 2026-02-09 22:17:22 +02:00
Augustus
850023edd8 various improovements including spreload as an alias, fixed sphelp, proper reload upon script update and probably something else. 2026-02-09 18:46:43 +02:00
Augustus
c47149e41d maybe fixed the loading procedure this time? 2026-02-08 19:09:22 +02:00
Augustus
85fc6086d2 Update main.set 2026-02-08 18:31:37 +02:00
Augustus
66a147df63 hopefully fixed the loading procedure for the soundpack 2026-02-08 18:08:27 +02:00
Augustus
846fa0f7c4 fixed readme and fixed soundpack reloading hopefully 2026-02-08 17:44:36 +02:00
Augustus
432c02b616 added an optional feature to recieve automatic updates which include scripts and sounds downloading on demand. 2026-02-08 17:29:18 +02:00
Draqoken
326564483a Merge branch 'main' of http://nathantech.net:3000/CosmicRage/VIPMudCosmicRageScripts 2026-02-08 17:14:25 +03:00
Draqoken
21c49cb5c9 auto updater 2026-02-08 17:14:21 +03:00
10 changed files with 353 additions and 68 deletions

BIN
SoundSync.exe Normal file

Binary file not shown.

View File

@@ -122,6 +122,25 @@ echo [%DATE% %TIME%] Creating loader.set >> "%LOG_FILE%"
) > "%LOADER_FILE%"
echo Created: loader.set
:: --------- Copy SoundSync.exe (to VIP root folder) ---------
set "VIP_ROOT=%TARGET_DIR%\.."
if exist "%VIP_ROOT%\SoundSync.exe" (
echo [%DATE% %TIME%] SoundSync.exe already exists in VIP root. Skipping copy. >> "%LOG_FILE%"
echo SoundSync.exe already present in VIP folder. Skipping.
) else (
if exist "%CURRENT_DIR%\SoundSync.exe" (
echo [%DATE% %TIME%] Copying SoundSync.exe to VIP root >> "%LOG_FILE%"
copy /Y "%CURRENT_DIR%\SoundSync.exe" "%VIP_ROOT%\" >nul
echo SoundSync.exe copied to VIP folder.
) else (
echo [%DATE% %TIME%] WARNING: SoundSync.exe not found in script directory. >> "%LOG_FILE%"
echo WARNING: SoundSync.exe not found.
)
)
:: --------- Copy settings.set ---------
if exist "%CURRENT_DIR%\scripts\settings.set" (
echo [%DATE% %TIME%] Copying settings.set >> "%LOG_FILE%"

View File

@@ -89,7 +89,7 @@ Move it to the folder of your choice, ensuring that the path contains no spaces
- **Ctrl + F9**: Toggle planetary music
- **Ctrl + F10**: Toggle space combat music
- **Ctrl + F11**: Toggle weather sounds
- **Alt + F12**: Restart soundpack
- **Alt + F12**: stop all currently playing sounds.
- **F2**: Open server-side settings
- **Ctrl + S**: Save client-side settings
- **Alt + N**: Open gag-related settings.
@@ -101,6 +101,8 @@ Move it to the folder of your choice, ensuring that the path contains no spaces
- **Control+Shift+R**: Reload the soundpack.
- **Control+`**: Toggle command displaying in the output window.
- **Alt+Enter**: toggle numpad movement.
- **Alt+Control+V**: Toggle automatic updates.
- **F11**: Stop all currently playing loops and restart the soundpack as well as flush the speech queue.
## FAQ
**Q: My soundpack doesn't work. What now?**

View File

@@ -1,6 +1,3 @@
#var badaliases {music|StopMusic|sc|capture}
#ForAll @badaliases {#gunalias %i}
#Alias login {#alarm 1 {#gagon all; 1; %charInfo(name); #wait (0.1); #ungagon; %charInfo(password)}}
#alias ActualSave {#if {%length(@decchar)>1 OR %length(@decchar)<1} {#say {Attention. Your decimal seperator was set incorrectly therefore it has been switched to default.};#var decchar .};
#File 6 {settings.set} 1;
@@ -38,4 +35,21 @@ ActualSave; #say {Settings saved!};
#alias makeworse {#Configure PassThruChar {~>}; #Configure SwitchSession {~:}; #passthru {•}}
#alias makebetter {#Configure PassThruChar {~•}; #Configure SwitchSession {~•}; #passthru {%<;>{}#"'}}
#alias rawinput {#if {@rawpass = "enabled"} {#var rawpass "disabled"; makeworse; #say {Raw input mode is now disabled.};#play {@sppath/general/misc/off.wav} @vol} {#var rawpass "enabled"; makebetter; #say {Raw input mode is now enabled.};#play {@sppath/general/misc/on.wav} @vol}}
#alias rawinput {#if {@rawpass = "enabled"} {#var rawpass "disabled"; makeworse; #say {Raw input mode is now disabled.};#play {@sppath/general/misc/off.wav} @vol} {#var rawpass "enabled"; makebetter; #say {Raw input mode is now enabled.};#play {@sppath/general/misc/on.wav} @vol}}
#alias {AutomaticUpdate} {#if {@AutomaticUpdate="enabled"} {
#var AutomaticUpdate "disabled";
#play {@sppath/general/misc/off.wav} @vol;
#say {Automatic updates will no longer be applied to your soundpack.};
} {
#var AutomaticUpdate "enabled";
#play {@sppath/general/misc/on.wav} @vol;
#say {Updates will now automatically be applied to your soundpack.};
}
}
#alias {spreload} {
#pc 0 stop;
#reload;
~@sp-restart;
~@sp-version
}

View File

@@ -1,7 +1,3 @@
;unneeded keys
#var badkeys {numpad2|numpad4|numpad5|numpad6|numpad8|numpad9|numpad/|numpad*|control-a|shift-pageup|shift-pagedown|control-pageup|control-pagedown}
#ForAll @badkeys {#gunkey %i}
;buffer keys
#key {Alt-shift-right} {~buffer~ add}
#key {alt-shift-left} {~buffer~ delete}
#key {alt-left} {~@buffer~ backward}
@@ -25,7 +21,6 @@
#key {alt-delete} {~@buffer~ clear}
#Key ALT-SHIFT-DELETE {~@buffer~ clearall}
#key {control-shift-enter} {~@sp-settings buffer sounds}
;soundpack volume and behavior
#key {f4} {~@sp-settings master volume}
#key {f5} {~@sp-settings General volume}
#key {f6} {~@sp-settings ambiance volume}
@@ -51,7 +46,6 @@
#key {control-f9} {~@sp-settings planetary music}
#key {control-f10} {~@sp-settings space combat music}
#key {control-f11} {~@sp-settings weather sounds}
#key {alt-f12} {~@sp-restart}
#key {Shift-alt-f9} {~@sp-settings Interrupt OOC Social sounds when the next one plays}
#key {f2} {~@sp-settings}
#key {control-s} {ActualSave;#say {Client-side Soundpack Settings have been saved successfully!} VoiceOnly}
@@ -60,14 +54,11 @@
#key {control-f2} {mainvoldown}
#key {Control-f3} {mainvolup}
#key {alt-f3} {intromusictoggle}
#key {control-shift-r} {actualsave;#pc 0 stop;#reload; ~@sp-restart;
#load {@sppath/version.set}; {#unload @sppath/version.set}}
#key f11 {#pc 0 stop; #say {All currently playing sounds have been stopped.}}
#key f11 {#pc 0 stop; #setspeech all stop;#say {All currently playing loops have been stopped.}; ~@sp-restart}
#key {alt-f12} {#pc 0 stop;#say {all sounds have been stopped.}}
#key {control-f1} {smute}
#key {alt-\} {rawinput}
#key {control-`} {#if {@commandsinoutput="enabled"} {#var commandsinoutput "disabled";#Configure DisplayCommandsInOutput False;#say {commands will no longer be displayed in the output window.}} {#var commandsinoutput "enabled";#Configure DisplayCommandsInOutput true;#say {Commands will now be displayed in the output window.}}}
#key {alt-control-v} {checkforupdates}
#key {alt-v} {%clipboard}
#key {shift-f4} {
#if {@devmode = "disabled"} {
@@ -83,4 +74,64 @@
#key {alt-shift-enter} {~@buffer link}
#key {alt-f1} {decimalpick}
#key {alt-n} {gagconfig}
#key {alt-enter} {#if {@numpadon="disabled"} {#var numpadon "enabled" ; #load {@scpath/numpad.set} ; #play {@sppath/general/misc/on.wav} @vol;#say {Numpad movement enabled.} VoiceOnly} {#var numpadon "disabled" ; #unload {@scpath/numpad.set} ; #play {@sppath/general/misc/off.wav} @vol;#say {Numpad movement disabled} VoiceOnly}}
#key {alt-enter} {#if {@numpadon="disabled"} {#var numpadon "enabled" ; #load {@scpath/numpad.set} ; #play {@sppath/general/misc/on.wav} @vol;#say {Numpad movement enabled.} VoiceOnly} {#var numpadon "disabled" ; #unload {@scpath/numpad.set} ; #play {@sppath/general/misc/off.wav} @vol;#say {Numpad movement disabled} VoiceOnly}}
#key {alt-shift-v} {%replace(%clipboard,%crlf,%chr(32))}
#key {alt-control-v} {AutomaticUpdate}
#key {control-shift-r} {spreload}
#key Alt-F {#Automenu main|file}
#key Alt-T {#automenu Main|tools}
#key Alt-E {#automenu Main|Edit}
#key Alt-C {#automenu main|connect}
#key Alt-W {#automenu Main|Window}
#key Alt-H {#automenu Main|Help}
; The Search keystrokes control-F, control-shift-f, F3, and shift-F3
#key control-f {
#prompt temp {Reverse Search for? } ;
#find {@temp} FIRST|Reverse ;
#say {%foundline} NoDisplay }
#key f3 {
#find {@temp} reverse|next ;
#say {%foundline} NoDisplay }
#key shift-control-f {
#prompt temp {Forward Search for? } ;
#find {@temp} first|forward ;
#say {%foundline} NoDisplay }
#key Shift-f3 {
#find {@temp} forward|next ;
#say {%foundline} NoDisplay }
#key Control-1 {#say %lastline(1) NoDisplay}
#key Control-2 {#say %lastline(2) NoDisplay}
#key Control-3 {#say %lastline(3) NoDisplay}
#key Control-4 {#say %lastline(4) NoDisplay}
#key Control-5 {#say %lastline(5) NoDisplay}
#key Control-6 {#say %lastline(6) noDisplay}
#key Control-7 {#say %lastline(7) NoDisplay }
#key Control-8 {#say %lastline(8) NoDisplay }
#key Control-9 {#say %lastline(9) NoDisplay }
#key Shift-Control-5 {#5 {#say {%lastline(6-%repeatnum)} NoDisplay}}
#key Shift-Control-4 {#4 {#say {%lastline(5-%repeatnum)} NoDisplay}}
#key Shift-Control-3 {#3 {#say {%lastline(4-%repeatnum)} NoDisplay}}
#key Shift-Control-2 {#2 {#say {%lastline(3-%repeatnum)} NoDisplay}}
#key control-space {#Syskey GET_WORD_FROM_OUTPUT}
#key Alt-space {#Syskey INSERT_TAB_WORD}
#key Escape {#Syskey clear_line}
#key control-T {#Syskey ASSIGN_TRIGGER}
#key control-k {#Syskey ASSIGN_key}
#key alt-A {#Syskey ASSIGN_ALIAS}
#key shift-enter {#Syskey EXECUTE_LINE}
#key control-alt-space {#Syskey ADD_TAB_WORD}
#key control-e {#window ErrorLog}
#key Control-Enter {#window entry}
#key control-q #quit
#key Control-Shift-T {#autoMenu Main|edit|triggers} // display the trigger setup dialog
#key Control-Shift-A {#autoMenu main|edit|alias} // display the alias setup dialog
#key Control-Shift-K {#autoMenu main|edit|keys} // display the keys setup dialog
#key Control-Shift-V {#autoMenu main|edit|variables} // display the variable setup dialog
#key Control-O {#autoMenu main|connect|character} // display the character connect/setup dialog
#key Control-Shift-l {#autoMenu main|file|load} // load a script file
#key Control-Shift-u {#autoMenu main|file|unload} // unload a script file

View File

@@ -1,11 +1,15 @@
;core variables
#var clientversion 13
#var loadtask {soundpack|keys|aliases|updator|misc|gagcreator|pathupdator}
#var settings {rawpass|miscgags|shipgags|vehiclegags|activitygags|intromusic|vol|commandsinoutput|devmode|decchar|numpadon}
#var clientversion 24
#var settings {rawpass|miscgags|shipgags|vehiclegags|activitygags|intromusic|vol|commandsinoutput|devmode|decchar|numpadon|AutomaticUpdate}
#var speech "disabled"
#unload {start.set};
#load {@scpath/aliases.set};
#load {@scpath/keys.set};
#load {@scpath/updator.set};
#load {@scpath/misc.set};
#load {@scpath/gagcreator.set};
#load {@scpath/pathupdator.set};
#if {%volume<100} {#pc 0 volume 100}
;Initialising the script files
#ForAll @loadtask {#load {@scpath/%i.set}}
;Reading and writing Settings.
#File 6 {settings.set} 1
#var num 1
@@ -14,17 +18,39 @@
#math num {@num + 1}};
#close 6
#trigger {Welcome to: cosmic rage!} {
#trigger {Welcome to: cosmic rage!} {#pc 0 stop;
#if {@intromusic = "enabled"} {
#if {@IntroPlaying = 1} {#pc @introhandle stop;#var IntroPlaying 0};
#playloop {@sppath/music/IntroMusic/DefaultIntro.wav} @vol; #var introhandle %playhandle; #var IntroPlaying 1}} {} AnyCase
#TRIGGER {synaptic signal verified. Sleep mode disengaged. Welcome back to Cosmic Rage!} {#if {@IntroPlaying = 1} {#pc @introhandle stop; #var IntroPlaying 0}; ~@sp-register vip;~@sp-version}
#trigger {Your synaptic signal wavers for a moment, then returns with a snap!} {#if {@IntroPlaying = 1} {#pc @introhandle stop; #var IntroPlaying 0}; ~@sp-register vip;~@sp-version}
#if {@rawpass = "enabled"} {makebetter}
#if {@activitygags = "enabled"} {#load {gags/activitygags.set}}
#if {@vehiclegags = "enabled"} {#load {gags/vehiclegags.set}}
#if {@shipgags = "enabled"} {#load {gags/shipgags.set}}
#if {@miscgags = "enabled"} {#load {gags/miscgags.set}}
#if {@devmode="enabled"} {#load {@scpath/dev.set}}
#if {%defined(decchar)=0 or %length(@decchar)<1} {#var decchar .}
#If {@numpadon="enabled"} {#load @scpath/numpad.set}
#if {@rawpass = "enabled"} {makebetter};
#if {@activitygags = "enabled"} {#load {gags/activitygags.set}};
#if {@vehiclegags = "enabled"} {#load {gags/vehiclegags.set}};
#if {@shipgags = "enabled"} {#load {gags/shipgags.set}};
#if {@miscgags = "enabled"} {#load {gags/miscgags.set}};
#if {@devmode="enabled"} {#load {@scpath/dev.set}};
#if {%defined(decchar)=0 or %length(@decchar)<1} {#var decchar .};
#If {@numpadon="enabled"} {#load {@scpath/numpad.set}};
#if {@commandsinoutput="enabled"} {#Configure DisplayCommandsInOutput true} {#Configure DisplayCommandsInOutput false};
#trigger {$sphook &{action}:&{soundpath}:&{volume}:&{pitch}:&{pan}:&{id}} {
#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 = "adjustsound"} {#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;
#if {%playhandle=0} {#SetSpeech system stop;#say {Failed to play @soundpath.};
#if {@soundpath<>"na"} {
#var faildsound {$sphook @action:@soundpath:@volume:@pitch:@pan:@id};
#if {@AutomaticUpdate="enabled"} {FetchSound @soundpath}}}}
#trig {$buffer *} {#gagline all; #say %1 voiceonly}

View File

@@ -5,11 +5,11 @@
}
#alias localsphelp {#say {
Greetings, Fellow Wanderer!
My name is The Cosmic Rage Immersion Scripts V @clientversion Sounds V @SoundsVersion.
My name is The Cosmic Rage Immersion Scripts V @clientversion.
I'm Installed at: @scpath.
My sounds are located at: @sppath.
If you want to update me, go to %replace(@scpath,@rightofpath,) and run Updator.bat.
Please keep me updated for the best experience! (Pleading Smiley).
If you want to update me, just reload by pressing control shift r!
Please keep me up-to-date for the best experience! (Pleading Smiley).
My decimal seperator is currently: @decchar}}
#alias decimalpick {

View File

@@ -1,15 +0,0 @@
#trigger {$sphook &{action}:&{soundpath}:&{volume}:&{pitch}:&{pan}:&{id}} {
#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 = "adjustsound"} {#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;
#if {%playhandle=0} {#SetSpeech system stop;#say {Failed to play @soundpath.}}}
#trig {$buffer *} {#gagline all; #say %1 voiceonly}

View File

@@ -1,19 +1,171 @@
#var rightofpath {%replace(@scpath,\,|)}
#var rightofpath %ReverseList(@rightofpath)
#var rightofpath %pop(rightofpath)
#load {@sppath/version.set};#unload {@sppath/version.set}
#trigger {$soundpack &client last version: &remoteversion} {
#gagline all;
#if {%IfWord(@client,vip,"|")} {#var remoteclientversion @remoteversion;#alarm 2 {checkclientversion}} {#var remotesoundsversion @remoteversion;#alarm 4 {checksoundsversion}}}
#alias checksoundsversion {
#math soundscondition {@remotesoundsversion - @SoundsVersion};
#if {@soundscondition>0} {#say {attention! Sound Updates found! Current version: @SoundsVersion. New Version: @remotesoundsversion};#play {@sppath/general/misc/spsave.wav} @vol};
#if {@soundscondition>0 or @clientcondition>0} {#say {Hint: To update the soundpack, navigate to %replace(@scpath,@rightofpath,) folder, run the file named updator.bat, and wait until the installation process completes. This will download and apply all available updates automatically.}}}
#alias checkclientversion {
#math clientcondition {@remoteclientversion - @clientversion};
#if {@clientcondition>0} {#say {attention! soundpack script Updates found! Current version: @clientversion. New Version: @remoteclientversion}; #play {@sppath/general/misc/spannouncement.wav} @vol}}
#alias checkforupdates {#if {@updatechecking=1} {#say {I'm Checking for updates already, Please hold on} VoiceOnly;#play {@sppath/general/misc/boop.wav} @vol} {
#say {Checking for updates, this will take a few seconds.} VoiceOnly;
#var updatechecking 1;
~@sp-version;
#alarm 5 {#if {@soundscondition<1 and @clientcondition<1} {#say {No updates found!};#play {@sppath/general/misc/logoutold.wav} @vol; #unvar updatechecking} {#unvar updatechecking}}}}
; Initialize variables if they don't exist
#if {%defined(ClientVersion)=0} {#var ClientVersion 0}
#if {%defined(AutomaticUpdate)=0} {#var AutomaticUpdate "disabled"}
#var SoundStatus {}
#var SoundStatusPrev {}
#var SyncUpdatePending 0
#file 4 sound_status.txt;
#write 4 { };
#close 4;
#file 4 sound_error.txt;
#write 4 { };
#close 4;
; Version Checking Triggers
; Captures lines like: "$soundpack vip last version: 13"
#trigger {$soundpack &SyncType last version: &SyncVer} {
#gagline all;
; Only check vip version
#if {@SyncType = "vip"} {
#say {Updator: Checking @SyncType version. Local: @ClientVersion, Remote: @SyncVer};
; Check if update needed
#if {@ClientVersion < @SyncVer} {
#say {Updator: Update available for @SyncType.};
#if {@AutomaticUpdate="enabled"} {PerformUpdate}
} {
#say {Updator: @SyncType is up to date.}
}
}
}
; Update Automation
#alias PerformUpdate {
#if {@SyncUpdatePending = 0} {
#var SyncUpdatePending 1;
; Force refresh
#var SoundStatusPrev {};
; Ensure monitor is running
StartSyncMonitor;
#say {Updator: Initiating script update sequence...};
; Step 1: Write command to sound_error.txt
#DelFile {sound_error.txt};
#file 4 sound_error.txt;
#write 4 {update_scripts};
#close 4;
; Step 2: Trigger the external updater
LaunchSoundSync;
#say {Updator: Update request sent to background process.};
; Reset pending flag after a delay
#alarm 30 {#var SyncUpdatePending 0}
} {
#say {Updator: Update already in progress.}
}
}
#alias FetchSound {
#var SoundFile %0;
; Force refresh so we see the status even if unchanged
#var SoundStatusPrev {};
; Ensure monitor is running
StartSyncMonitor;
#say {Updator: Requesting download for: @SoundFile};
#DelFile {sound_error.txt};
#file 4 sound_error.txt;
#write 4 {%RTrim(@SoundFile).wav};
#close 4;
LaunchSoundSync
}
#alias LaunchSoundSync {
#config editor {%homefolder\SoundSync.exe};
#edit sound_error.txt;
#config editor notepad.exe
}
; Sync Monitor Loop
#alias StartSyncMonitor {
#var SoundStatusPrev {};
; Clear existing status file to prevent catching stale "Finished" signals
#DelFile {sound_status.txt};
#file 10 sound_status.txt;
#write 10 { } 1;
#close 10;
#alarm SyncMonitor -0.1 {
CheckSyncStatus
}
}
#alias StopSyncMonitor {
#unalarm SyncMonitor;
}
#alias CheckSyncStatus {
; Read status file using handle 5 (Sequential)
#file 5 sound_status.txt;
#read 5 CurrentStatus;
#close 5;
; Guard against empty reads or EOF
#if {@CurrentStatus = "[EOF]" OR @CurrentStatus = ""} {
; parsing failed or empty, skip this cycle
} {
; Process only if status changed
#if {@CurrentStatus <> @SoundStatusPrev} {
; Update prev status IMMEDIATELY to prevent looping if subsequent commands error out
#var SoundStatusPrev @CurrentStatus;
#var StatusCode {%word(@CurrentStatus,"|",1)};
#var StatusMsg {%word(@CurrentStatus,"|",2)};
; Detailed Notification
#if {%pos("Downloading", "@StatusCode") > 0} {
#say {Updator: Downloading - @StatusMsg}
};
#if {%pos("Downloaded", "@StatusCode") > 0} {
#say {Updator: Completed - @StatusMsg}
};
#if {%pos("Extracting", "@StatusCode") > 0} {
#say {Updator: Extracting - @StatusMsg}
};
#if {%pos("Failed", "@StatusCode") > 0 OR %pos("404", "@StatusCode") > 0 OR %pos("Timeout", "@StatusCode") > 0} {
#say {Updator: Error - @StatusCode: @StatusMsg}
};
#if {%pos("Finished", "@StatusCode") > 0} {
#say {Updator: All downloads finished.};
StopSyncMonitor
};
; Handle specific states
#if {%pos("Downloaded", "@StatusCode") > 0} {
HandleDownloadSuccess @StatusMsg
};
#if {%pos("Failed", "@StatusCode") > 0 OR %pos("404", "@StatusCode") > 0 OR %pos("Timeout", "@StatusCode") > 0} {
#play {@sppath/general/misc/boop.wav} @vol
};
}
}
}
#alias HandleDownloadSuccess {
#var DownloadedFile %0;
; Use %pos for maximum robustness. It ignores spaces and underscores.
; Checking for "Scripts" anywhere in the name.
#if {%pos("Scripts", "@DownloadedFile") > 0} {
#say {Updator: Scripts successfully updated! Reloading...};
#play {@sppath/general/misc/spannouncement.wav} @vol;
StopSyncMonitor;
#var SyncUpdatePending 0;
spreload
} {
; It's a sound file
#say {Updator: NEW SOUND: @DownloadedFile};
echo @faildsound;
}
}

View File

@@ -14,6 +14,27 @@ set "REPO_SUBFOLDER=wav"
set "SCRIPTS_REPO_URL=http://nathantech.net:3000/CosmicRage/VIPMudCosmicRageScripts.git"
set "SOUNDS_REPO_URL=https://nathantech.net:3000/CosmicRage/CosmicRageSounds.git"
:: --------- Locate VIP Root Directory ---------
set "VIP_ROOT="
for /f "tokens=2,*" %%i in ('
reg query "HKCU\Software\VB and VBA Program Settings\VIPMUD\DefaultFolder" /v Filespec 2^>nul
') do set "VIP_ROOT=%%j"
:: Fallback if registry not found
if not defined VIP_ROOT (
set "VIP_ROOT=%USERPROFILE%\Documents\VIP Mud"
)
echo [%DATE% %TIME%] VIP root directory resolved to: %VIP_ROOT% >> "%LOG_FILE%"
if not exist "%VIP_ROOT%" (
echo [%DATE% %TIME%] ERROR: VIP root directory does not exist: %VIP_ROOT% >> "%LOG_FILE%"
echo ERROR: VIP folder not found. Update aborted.
pause
exit /b
)
:: --------- Setup Log ---------
echo [%DATE% %TIME%] Starting update process... > "%LOG_FILE%"
echo [%DATE% %TIME%] GitPortable: %GIT_PORTABLE% >> "%LOG_FILE%"
@@ -103,6 +124,21 @@ if exist "%SOUNDS_DIR%" (
echo ERROR: Sounds directory not found at %SOUNDS_DIR%.
)
:: --------- Copy SoundSync.exe to VIP Root (if missing) ---------
if exist "%VIP_ROOT%\SoundSync.exe" (
echo [%DATE% %TIME%] SoundSync.exe already exists in VIP root. Skipping copy. >> "%LOG_FILE%"
echo SoundSync.exe already present in VIP folder. Skipping.
) else (
if exist "%BASE_DIR%\SoundSync.exe" (
echo [%DATE% %TIME%] Copying SoundSync.exe to VIP root >> "%LOG_FILE%"
copy /Y "%BASE_DIR%\SoundSync.exe" "%VIP_ROOT%\" >nul
echo SoundSync.exe copied to VIP folder.
) else (
echo [%DATE% %TIME%] WARNING: SoundSync.exe not found alongside update script. >> "%LOG_FILE%"
echo WARNING: SoundSync.exe not found.
)
)
:: --------- Final Logging ---------
echo [%DATE% %TIME%] Update process completed. >> "%LOG_FILE%"
pause