我把“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”窗户,观看你方的电文,再次表示赞成。 任何想法为什么?
如果有人知道我如何能够阻止/开始这样做,那又是额外的。 如果你知道如何做到这一点,那将不听聊天小组的讯息,而只会听听听聊天小组的说话,因为现在它会听聊天,然后送用户。 除非我能以某种方式将信息发送至聊天。