New command: Fly
This commit is contained in:
parent
06e33b2147
commit
851c99385c
1 changed files with 31 additions and 0 deletions
31
Core/Commands/Movement/Fly.cs
Normal file
31
Core/Commands/Movement/Fly.cs
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using OpenMetaverse;
|
||||
namespace BSB.Commands.Movement
|
||||
{
|
||||
public class Fly : CoreCommand_1arg
|
||||
{
|
||||
public override string[] ArgTypes { get { return new[] { "True|False" }; } }
|
||||
public override string[] ArgHints { get { return new[] { "Should the bot be flying" }; } }
|
||||
public override string Helpfile { get { return "Makes the bot fly (or not)"; } }
|
||||
public override bool CallFunction(string[] args)
|
||||
{
|
||||
if (base.CallFunction(args) == true)
|
||||
{
|
||||
if (bool.TryParse(args[0], out bool status) == true)
|
||||
{
|
||||
bot.GetClient.Self.Movement.Fly = status;
|
||||
bot.GetClient.Self.Movement.SendUpdate();
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return Failed("Unable to process rotation");
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Reference in a new issue