Exemplo n.º 1
0
 public void Execute(Message message, string onoff)
 {
     if (onoff.Equals("on") || onoff.Equals("off"))
     {
         ACAttr att = new ACAttr(LastUsedAttr, onoff.Equals("on"));
         if (ACManager.SendAC(att.temp, att.power, att.level))
         {
             message.Reply("Transmitted!");
         }
         else
         {
             message.Reply("An error occurred while transmitting!");
         }
     }
     else
     {
         message.Reply("Usage: /ac [on/off]");
     }
 }
Exemplo n.º 2
0
 public void Execute(Message message, string onoff, int temp, ACPower level)
 {
     if (onoff.Equals("on") || onoff.Equals("off"))
     {
         LastUsedAttr = new ACAttr(onoff.Equals("on"), temp, level);
         if (ACManager.SendAC(LastUsedAttr.temp, LastUsedAttr.power, LastUsedAttr.level))
         {
             message.Reply("Transmitted!");
         }
         else
         {
             message.Reply("An error occurred while transmitting!");
         }
     }
     else
     {
         message.Reply("Usage: /ac [on/off] {temp} {low/med/high/auto/turbo}");
     }
 }
Exemplo n.º 3
0
 public ACAttr(ACAttr prev, bool p)
 {
     temp  = prev.temp;
     level = prev.level;
     power = p;
 }