本文整理匯總了C#中Bot.PowerUp方法的典型用法代碼示例。如果您正苦於以下問題:C# Bot.PowerUp方法的具體用法?C# Bot.PowerUp怎麽用?C# Bot.PowerUp使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Bot
的用法示例。
在下文中一共展示了Bot.PowerUp方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: RunBot
private static void RunBot()
{
try
{
Console.WriteLine(String.Format("Connecting to {0}...", _serverUrl));
Bot bot = new Bot(_serverUrl, _botName, _botPassword);
bot.PowerUp();
JoinRooms(bot);
Console.Write("Press enter to quit...");
Console.ReadLine();
bot.ShutDown();
_appShouldExit = true;
}
catch (Exception e)
{
Console.WriteLine("ERROR: " + e.GetBaseException().Message);
}
}
示例2: StartBot
private static void StartBot()
{
KeepAliveModule.ScheduleKeepAlive();
if (_bot != null)
{
TryShutBotDown();
}
_bot = new Bot(_serverUrl, _botName, _botPassword);
_bot.PowerUp();
JoinRooms(_bot);
}
示例3: RunBot
private static void RunBot()
{
try
{
var scheduler = new Scheduler();
var container = CreateCompositionContainer();
// Add all the sprockets to the sprocket list
var announcements = container.GetExportedValues<IAnnounce>();
Console.WriteLine(String.Format("Connecting to {0}...", _serverUrl));
Bot bot = new Bot(_serverUrl, _botName, _botPassword);
foreach (var s in container.GetExportedValues<ISprocket>())
bot.AddSprocket(s);
bot.PowerUp();
JoinRooms(bot);
var users = bot.GetUsers(bot.Rooms.First());
var user = bot.GetUserInfo(bot.Rooms.First(), users.First().Name.ToString());
scheduler.Start(announcements, bot);
Console.Write("Press enter to quit...");
Console.ReadLine();
scheduler.Stop();
bot.ShutDown();
_appShouldExit = true;
}
catch (Exception e)
{
Console.WriteLine("ERROR: " + e.GetBaseException().Message);
}
}