From 058cb2dbb75547f9987f35eaf577fe5ffbb5bcdd Mon Sep 17 00:00:00 2001 From: Augustus <123775785+OlegTheSnowman@users.noreply.github.com> Date: Wed, 2 Jul 2025 18:53:23 +0300 Subject: [PATCH] added support for custom decimal seperators in vip scripting, should solve issues with numbers not being numeric when they actually are --- scripts/aliases.set | 4 ++-- scripts/keys.set | 3 ++- scripts/main.set | 6 +++--- scripts/misc.set | 11 ++++++++++- scripts/pathupdator.set | 14 +++++++------- 5 files changed, 24 insertions(+), 14 deletions(-) diff --git a/scripts/aliases.set b/scripts/aliases.set index cd45805..4f6a3c1 100644 --- a/scripts/aliases.set +++ b/scripts/aliases.set @@ -2,7 +2,7 @@ #ForAll @badaliases {#gunalias %i} #Alias login {#gagon all; 1; %charInfo(name); #wait (0.1); #ungagon; %charInfo(password)} -#alias ActualSave { +#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; #Var SettingsFileCounter 0; #ForAll @settings { @@ -38,4 +38,4 @@ 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}} \ No newline at end of file diff --git a/scripts/keys.set b/scripts/keys.set index 2dca68b..71351e9 100644 --- a/scripts/keys.set +++ b/scripts/keys.set @@ -80,4 +80,5 @@ #say {Developer mode is no longer active} } } -#key {alt-shift-enter} {~@buffer link} \ No newline at end of file +#key {alt-shift-enter} {~@buffer link} +#key {control-f4} {decimalpick} \ No newline at end of file diff --git a/scripts/main.set b/scripts/main.set index 01e6500..ae93463 100644 --- a/scripts/main.set +++ b/scripts/main.set @@ -1,8 +1,7 @@ ;core variables #var clientversion 5 -#var decchar . #var loadtask {soundpack|keys|aliases|updator|misc|gagcreator|pathupdator} -#var settings {rawpass|miscgags|shipgags|vehiclegags|activitygags|intromusic|vol|commandsinoutput|devmode} +#var settings {rawpass|miscgags|shipgags|vehiclegags|activitygags|intromusic|vol|commandsinoutput|devmode|decchar} #var speech "disabled" ;Initialising the script files #ForAll @loadtask {#load {@scpath/%i.set}} @@ -25,4 +24,5 @@ #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}} \ No newline at end of file +#if {@devmode="enabled"} {#load {@scpath/dev.set}} +#if {%defined(decchar)=0 or %length(@decchar)<1} {#var decchar .} diff --git a/scripts/misc.set b/scripts/misc.set index 49c1579..228acff 100644 --- a/scripts/misc.set +++ b/scripts/misc.set @@ -9,4 +9,13 @@ My name is The Cosmic Rage Immersion Scripts V @clientversion Sounds V @SoundsVe 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).}} \ No newline at end of file +Please keep me updated for the best experience! (Pleading Smiley).}} + +#alias decimalpick { +#pick {*Please select the decimal separator used in your system. For example, if it is a comma, choose a comma here. The separator should be consistent both here and elsewhere in your setup.:decimalpick| +a comma:#var newdecchar ,| +a period:#var newdecchar .| +a custom choice:#prompt newdecchar {Please enter your custom choice} +}; +#alarm 1 {#if {%length(@newdecchar)>1 OR %IsNumber(@newdecchar)=1} {#say {You really do not need a decimal seperator that is more than one character long or you have probably entered a number. Please try again.};#unvar newdecchar} {#var decchar @newdecchar; #say {Your decimal seperator has been set to @decchar}}} +} \ No newline at end of file diff --git a/scripts/pathupdator.set b/scripts/pathupdator.set index 0f3795e..0dfea9d 100644 --- a/scripts/pathupdator.set +++ b/scripts/pathupdator.set @@ -1,12 +1,12 @@ #alias loadpathchangeprompt { -#alarm 0.05 {#say {This function allows the user to alter the currently defined paths for the soundpack to load and should be used in cases when you moved your scripts and sounds folders to a different location/locations. With this in mind, would you like to continue?} VoiceOnly}; +#alarm 0@{decchar}05 {#say {This function allows the user to alter the currently defined paths for the soundpack to load and should be used in cases when you moved your scripts and sounds folders to a different location/locations. With this in mind, would you like to continue?} VoiceOnly}; #pick {P:Are you sure?| yes:pathconfig| no:#abort}} #alias pathconfig { -#alarm 0.100 {#say {Choose a path to edit, and once satisfied, press 'apply' to continue} VoiceOnly}; +#alarm 0@{decchar}100 {#say {Choose a path to edit, and once satisfied, press 'apply' to continue} VoiceOnly}; #pick {P:Soundpack path Configuration:| Choose the disk where your scripts are stored, currently, (@scriptdisk):diskforscripts| Choose the disk where your sounds are stored, currently (@sounddisk):diskforsounds| @@ -15,20 +15,20 @@ Path for sounds (@tempsppath), press enter to edit:pathforsounds| Apply:finishpathchange}} #alias diskforscripts { -#alarm 0.50 {#say {please enter the volume of the disk where your scripts are stored, it should be capitalized at all times, examples include, C, D, H, G...} VoiceOnly}; +#alarm 0@{decchar}50 {#say {please enter the volume of the disk where your scripts are stored, it should be capitalized at all times, examples include, C, D, H, G...} VoiceOnly}; #prompt scriptdisk {Disk?}; pathconfig} #alias diskforsounds { -#alarm 0.50 {#say {please enter the volume of the disk where your sounds are stored, it should be capitalized at all times, examples include, C, D, H, G...} VoiceOnly}; +#alarm 0@{decchar}50 {#say {please enter the volume of the disk where your sounds are stored, it should be capitalized at all times, examples include, C, D, H, G...} VoiceOnly}; #prompt sounddisk {Disk?}; pathconfig} #alias pathforscripts { -#alarm 0.50 {#say {Please enter a path, without disk lable, to the directory with the .set files located in} VoiceOnly}; +#alarm 0@{decchar}50 {#say {Please enter a path, without disk lable, to the directory with the .set files located in} VoiceOnly}; #prompt tempscpath {Path to scripts}; pathconfig} #alias pathforsounds { -#alarm 0.50 {#say {Please enter a path, without disk lables, to the directory with the sound folders located in} VoiceOnly}; +#alarm 0@{decchar}50 {#say {Please enter a path, without disk lables, to the directory with the sound folders located in} VoiceOnly}; #prompt tempsppath {Path to sounds}; pathconfig} @@ -38,7 +38,7 @@ pathconfig} #write 1 {#var scpath {@scriptdisk:\@tempscpath}}; #write 1 {#var sppath @sounddisk:{@tempsppath}}; #close 1; -#alarm 0.50 {#say {Press enter to reload} VoiceOnly}; +#alarm 0@{decchar}50 {#say {Press enter to reload} VoiceOnly}; #pick {P:We're about to reload!| Continue:#reload}} #key {shift-f2} {loadpathchangeprompt} \ No newline at end of file