English 中文(简体)
5. 天候机
原标题:Skype API help and acting very weird
  • 时间:2012-04-05 04:02:16
  •  标签:
  • api
  • skype

我把“Skype”(Skype PWN4G3)称为“Skype”(Skype PWN4G3)。

页: 1

 private void botOn_Click(object sender, EventArgs e)
        {
            if (toolStripLabel5.Text == "Not attached")
            {
                MessageBox.Show(notAttached, "Skype Pwnage - Info!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
            else
            {
                botStop = false;
                skype.Attach(7, false);
                skype.MessageStatus += new _ISkypeEvents_MessageStatusEventHandler(skype_MessageStatus);
                botOn.Text = "Running";
                botOn.Enabled = false;
                botOff.Enabled = true;
            }
        }

        private void botOff_Click(object sender, EventArgs e)
        {
            botStop = true;
            botOn.Text = "Enable";
            botOn.Enabled = true;
            botOff.Enabled = false;
        }

职能

private void skype_MessageStatus(ChatMessage msg, TChatMessageStatus status)
{
    if (botStop == true)
    {
    }
    else
    {
        try
        {
            string command = msg.Body.Remove(0, trigger.Length).ToLower();
            string[] lines = richTextBox4.Text.Split( 
 );
            foreach (string ln in lines)
            {
                string[] commands = ln.Split( : );
                if (radioButton6.Checked == true)
                {
                    if (command.Contains(commands[0]))
                    {
                        listBox2.Items.Add(DateTime.Now +"> "+ commands[0]);
                        skype.SendMessage(msg.Sender.Handle, string.Format(commands[1]));
                        break;
                    }
                }
                    if (radioButton4.Checked == true)
                    {
                        if (command == commands[0])
                        {
                            listBox2.Items.Add(DateTime.Now + "> " + commands[0]);
                            skype.SendMessage(msg.Sender.Handle, string.Format(commands[1]));
                            break;
                        }
                    }
                }
            }
        catch (Exception err0)
        {
        }

    }
} 

Now my issue is this code work s great and it will reply auto to a person if they say a certain word. But it s very odd acting. If you start the bot with the Skype window minimized and let it do it s work it work s great until you stop then start it or change the radio button from "Exact" to "Contains" then the next time it runs it will reply 2 times, then if you do the above again it will reply 3 times and so on,

另外一个非常棘手的问题是,一旦你开放你,你就开始发言。 “Skype”窗户,观看你方的电文,再次表示赞成。 任何想法为什么?

如果有人知道我如何能够阻止/开始这样做,那又是额外的。 如果你知道如何做到这一点,那将不听聊天小组的讯息,而只会听听听聊天小组的说话,因为现在它会听聊天,然后送用户。 除非我能以某种方式将信息发送至聊天。

问题回答

(1) 答复2、3次和更多的时间——看来问题出现在<条码>斯基P.MessageStatus +=......上,每当你点上下机器人时,就被点打。 页: 1 要么叫-=,要么确保只需要一次订阅。

2)再次发出电文:天空-MessageStatus是两次要求电文——检查SKYPE4COMLib.TChatMessageStatus trisSending/cmsReceived——发出电文时,当目标用户点击并实际观看电文时,需要做的是检查的价值。

3) 使直接电文和聊天小组在你的代码中测试的区别

SKYPE4COMLib.ChatMessage pMessage;
if (pMessage.Chat.Members.Count == 2)
{
    // process direct messages
}
else if(pMessage.Chat.Members.Count > 2)
{
    // do whatever you want to do to process chat messages
}




相关问题
C# Networking API s [closed]

Lately I ve been looking for a good networking API i could possibly use and/or reference some of the code within, but i have mere luck searching for some on Google/Bing. Hopefully somebody here has ...

getting XML from other domain using ASP.NET

I m fairly new to ASP.NET. And I was wondering how I could go about getting xml from a site (Kuler s API in this case), and then post the result using AJAX? So what I want here, is to be able to do a ...

Most appropriate API for URL shortening service

I ve just finished an online service for shortening URLs (in php5 with Zend Framework); you can enter an URL and you get an short URL (like tinyurl and such sites). I m thinking about the API for ...

UML Diagram to Model API

I need to create a diagram to document a RESTFul API that build, which UML diagram should I use? Thanks in advance,

How best to expose Rails methods via an API?

Let s say I have a model foo, and my model has a publish! method that changes a few properties on that model and potentially a few others too. Now, the Rails way suggests that I expose my model over ...

简讯

我是否可以使用某些软件来建立简便的航天国家服务器,最好是在 Java? 所有我都希望我的航天国家服务机在任何要求中都用同样的IP地址来回答。

About paypal express checkout api

In this picture,there are 3 main steps:SetExpressCheckout,GetExpressCheckoutDetails and DoExpressCheckoutDetails,I m now sure SetExpressCheckout is to be called by myself,what about ...

热门标签