2006-11-22 00:09:31 +00:00
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using libsecondlife;
|
|
|
|
|
using libsecondlife.Packets;
|
|
|
|
|
|
2006-11-24 22:27:15 +00:00
|
|
|
namespace libsecondlife.TestClient
|
2006-11-22 00:09:31 +00:00
|
|
|
{
|
|
|
|
|
public class SayCommand: Command
|
|
|
|
|
{
|
|
|
|
|
public SayCommand()
|
|
|
|
|
{
|
|
|
|
|
Name = "say";
|
2006-12-16 09:07:28 +00:00
|
|
|
Description = "Say something. (usage: say (optional channel) whatever)";
|
2006-11-22 00:09:31 +00:00
|
|
|
}
|
|
|
|
|
|
2006-11-28 07:48:43 +00:00
|
|
|
public override string Execute(SecondLife Client, string[] args, LLUUID fromAgentID)
|
2006-11-22 00:09:31 +00:00
|
|
|
{
|
2006-12-02 03:12:37 +00:00
|
|
|
int channel = 0;
|
|
|
|
|
int startIndex = 0;
|
|
|
|
|
string message = String.Empty;
|
|
|
|
|
if (args.Length < 1)
|
|
|
|
|
{
|
|
|
|
|
return "usage: say (optional channel) whatever";
|
|
|
|
|
}
|
|
|
|
|
else if (args.Length > 1)
|
|
|
|
|
{
|
2006-12-16 09:07:28 +00:00
|
|
|
if (Int32.TryParse(args[0], out channel))
|
|
|
|
|
startIndex = 1;
|
2006-12-02 03:12:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (int i = startIndex; i < args.Length; i++) {
|
|
|
|
|
message += args[i] + " ";
|
|
|
|
|
}
|
2006-11-22 00:09:31 +00:00
|
|
|
|
2006-12-02 03:12:37 +00:00
|
|
|
Client.Self.Chat(message, channel, MainAvatar.ChatType.Normal);
|
2006-11-22 00:09:31 +00:00
|
|
|
|
|
|
|
|
return "Said " + message;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|