diff --git a/MinecraftClient/ChatBots/Script.cs b/MinecraftClient/ChatBots/Script.cs index a016dbfa..4823f9de 100644 --- a/MinecraftClient/ChatBots/Script.cs +++ b/MinecraftClient/ChatBots/Script.cs @@ -218,6 +218,12 @@ namespace MinecraftClient.ChatBots { var min = Convert.ToInt32(parts[0]); var max = Convert.ToInt32(parts[1]); + + if (min > max) + { + (min, max) = (max, min); + LogToConsole(Translations.cmd_wait_random_min_bigger); + } ticks = new Random().Next(min, max); } else ticks = Convert.ToInt32(instruction_line[5..]); diff --git a/MinecraftClient/Resources/Translations/Translations.Designer.cs b/MinecraftClient/Resources/Translations/Translations.Designer.cs index 4d41b142..2526ebc9 100644 --- a/MinecraftClient/Resources/Translations/Translations.Designer.cs +++ b/MinecraftClient/Resources/Translations/Translations.Designer.cs @@ -3968,5 +3968,11 @@ namespace MinecraftClient { return ResourceManager.GetString("bot.common.movement.lock.held", resourceCulture); } } + + internal static string cmd_wait_random_min_bigger { + get { + return ResourceManager.GetString("cmd.wait.random.min.bigger", resourceCulture); + } + } } } diff --git a/MinecraftClient/Resources/Translations/Translations.resx b/MinecraftClient/Resources/Translations/Translations.resx index 8cab30fc..12aab380 100644 --- a/MinecraftClient/Resources/Translations/Translations.resx +++ b/MinecraftClient/Resources/Translations/Translations.resx @@ -2115,4 +2115,7 @@ Logging in... You can not start/run/use the '{0}' bot because it requires movement, the movement is currently utilized by the '{1}' bot, stop it if you want to use this one. + + Minimum number that you have provided is bigger than the maximum, swapping them around! + \ No newline at end of file diff --git a/docs/guide/usage.md b/docs/guide/usage.md index c641943b..64482327 100644 --- a/docs/guide/usage.md +++ b/docs/guide/usage.md @@ -695,10 +695,10 @@ In scripts and remote control, no slash is needed to perform the command, eg. `q - **Examples:** ``` - /setrnd -7to10 + /setrnd -7 to 10 ``` - (Set a `%variable%` to a number from -7 to 9) + (Set a `%variable%` to a number from -7 to 10) ### `sneak` @@ -836,16 +836,38 @@ In scripts and remote control, no slash is needed to perform the command, eg. `q - **Usage:** + Fixed time: + ``` /wait