diff --git a/Core/Commands/Helpers/delay.cs b/Core/Commands/Helpers/delay.cs new file mode 100644 index 0000000..9895267 --- /dev/null +++ b/Core/Commands/Helpers/delay.cs @@ -0,0 +1,29 @@ +using System.Text; +using System.Threading; +using OpenMetaverse; + +namespace BSB.Commands.Helpers +{ + public class Delay : CoreCommand_1arg + { + public override string[] ArgTypes { get { return new[] { "Number" }; } } + public override string[] ArgHints { get { return new[] { "Delay in MS" }; } } + public override string Helpfile { get { return "Delays a thead by X ms
Mostly pointless but good if your doing custom commands"; } } + public override bool CallFunction(string[] args) + { + if (base.CallFunction(args) == true) + { + if (int.TryParse(args[0], out int delayms) == true) + { + Thread.Sleep(delayms); + return true; + } + else + { + return Failed("Delay is not vaild"); + } + } + return false; + } + } +}