![]() |
|
How to make a Skype Auto reply bot - Printable Version +- Sinisterly (https://sinister.ly) +-- Forum: Coding (https://sinister.ly/Forum-Coding) +--- Forum: Visual Basic & .NET Framework (https://sinister.ly/Forum-Visual-Basic-NET-Framework) +--- Thread: How to make a Skype Auto reply bot (/Thread-How-to-make-a-Skype-Auto-reply-bot) Pages:
1
2
|
How to make a Skype Auto reply bot - Sunlight - 03-24-2013 In this tutorial I will show you how to make a skype auto reply bot in vb.net. This is very easy to make if you just follow along. For this you need the skype4com.dll and library. Make sure to add them ^^ as a reference. Here is the fully commented code that you should read and write to your project: Code: Imports SKYPE4COMLib
Imports System.Windows.Forms
Public Class Form1
Private skype As Skype
Dim trigger As String = "msg=" 'use this as the command.
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
skype = New Skype 'put's skype as a new skype
skype.Attach() 'attaches our program to skype.
AddHandler skype.MessageStatus, AddressOf skype_stat
End Sub
Public Sub skype_stat(ByVal msg As ChatMessage, ByVal status As TChatMessageStatus)
If msg.Body.Contains(trigger) Then 'if it has the trigger.
Dim sendme As String = msg.Body.Replace(trigger, "") 'removes the trigger from the message. for example if the message was "msg=sunlight", the it would be "sunlight"
skype.SendMessage(msg.Sender.Handle, cases(sendme)) 'sends message.
End If
End Sub
Public Function cases(ByVal sent As String)
Dim result As String
Select Case sent
Case Is = "hello" 'if the msg received is hello
result = "hey" ' then send hey.
Exit Select
Case Is = "help" 'if the msg received is help
result = "Sorry, no help available." ' then send this.
Exit Select
Case Is = "who" 'if the msg received is 'who'
result = "this is Your Name's auto reply bot" 'the message sent will be this.
Exit Select
'add as many cases as you can, the more cases, the better.
Case Else
result = "Not a valid command"
End Select
Return result
End Function
End ClassWhen you run it you should get this thing requesting permission on skype, accept it. Here's it in action. RE: How to make a Skype Auto reply bot - Google - 03-24-2013 Thanks sir!, gonna to use dat.
RE: How to make a Skype Auto reply bot - Sunlight - 03-24-2013 (03-24-2013, 01:59 PM)Google Wrote: Thanks sir!, gonna to use dat.Great. You can also add commands that get the time. I think that is pretty cool. RE: How to make a Skype Auto reply bot - Google - 03-24-2013 (03-24-2013, 02:00 PM)Sunlight Wrote: Great. You can also add commands that get the time. I think that is pretty cool. Wut, what are you talking about my good sir? :o. RE: How to make a Skype Auto reply bot - OversouL - 03-26-2013 Sadly the computer that I use to code is broken and formatted to service pack 2. : ( Anyway nice tut. RE: How to make a Skype Auto reply bot - Wonders - 03-26-2013 Nice tutorial, thanks for sharing. How to make a Skype Auto reply bot - ✧Sirius Paradox✧ - 04-03-2013 This will come in very handy, I get lots of messages when I'm AFK. How to make a Skype Auto reply bot - Lincoln Burrows - 04-04-2013 If anyone has trouble with this or simply can't make it I would suggest clownfish as they have one as well. However nice tutorial and I may give it a go later. RE: How to make a Skype Auto reply bot - Sunlight - 04-04-2013 (04-04-2013, 12:07 AM)Lincoln Burrows Wrote: If anyone has trouble with this or simply can't make it I would suggest clownfish as they have one as well. However nice tutorial and I may give it a go later. Clownfish will also work. But it makes people feel better when they make their own. RE: How to make a Skype Auto reply bot - Lincoln Burrows - 04-04-2013 (04-04-2013, 12:40 AM)Sunlight Wrote: Clownfish will also work. But it makes people feel better when they make their own. I agree making your own makes you feel better. Was just saying if someone can't make it or someone will not make it for them than that is the other way to do it. |