Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

.NET 

skype4com handler crashing?

I have made a bot for Skype in vb.net but every 15 minutes or so after use it stops responding.This is the code:

Code
Private Sub K9Bot_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
      Dim Skype = New Skype
      Skype.Attach(7, False)
      AddHandler Skype.MessageStatus, AddressOf skype_MessageStatus
      'AddHandler Skype.MessageStatus, AddressOf whoknows
    End Sub

Public Sub skype_MessageStatus(ByVal msg As SKYPE4COMLib.ChatMessage, ByVal status As TChatMessageStatus)
      'MsgBox("regulator")
      Try

      If status = TChatMessageStatus.cmsReceived Or status = TChatMessageStatus.cmsSent Then
            Label4.Text = msg.Body.ToString
If msg.Body.StartsWith("!") Then
            Botstring = msg.ChatName.ToString
            form1.ListBox12.Items.Add(msg.Body.ToString)
            Label2.Text = msg.Body.ToString
            If msg.Body.Equals("!help") Or msg.Body.Equals("!menu") Then
            msg.Chat.SendMessage(form1.TextBox17.Text.ToString)

I think this is the handler because I set the label to change to the text each time a message is sent.

I have also tried this:

Code
ElseIf status = TChatMessageStatus.cmsRead Or status = TChatMessageStatus.cmsSending Then
but it makes it glitch so it sends 2 messages at a time.

After I tried all of this I made a log to see what was causing it and it wasn't anything specific and it was anything to a simple command, to someone just sending me a message. Does anybody have a clue what is causing my bot to do this. Any help will be appreciated.
(Aug 17, 2014 05:30 PM)shooterbret Wrote:  ElseIf status = TChatMessageStatus.cmsRead Or status = TChatMessageStatus.cmsSending Then

The reason this is sending two messages is because you're checking to see if the message has been read, and then again if the message has been sent.

You'd have to check either one, but I'd check to see if the message has been read instead of sending.

Simply remove one of the if statements.

Code:
Code
ElseIf status = TChatMessageStatus.cmsRead Then

That should work, best of luck.
I see, I have a perfect working bot and I don't need that line, but I have also a completly different code. I can't help you with a simple answer, You'll need to do some code changes.
^^^^^ Well anybody have a clue what 'code changes' he was talking about, because what doing what incliment says makes it so i need to type the code twice which is going to be annoying, also that still doesent solve the main problem.
(Aug 18, 2014 02:26 PM)shooterbret Wrote:  ^^^^^ Well anybody have a clue what 'code changes' he was talking about, because what doing what incliment says makes it so i need to type the code twice which is going to be annoying, also that still doesent solve the main problem.

I honestly wouldn't waste money on something like that as its not very hard at all. Par your request here is source-code for what you are trying to do https://hackforums.net/showthread.php?tid=4335463 . And contrary to what whoever said it, it's completely fine to check cmsSending and cmsReceived(or read I cant remember) at the same time. The source code works fine as long as you follow the very last step on the source code. It wouldn't be very hard at all to expand from this as its just a bunch of if then's following the main logic for resolving you could just say look for the command "!WHOIS" and then just take all the proceeding text and assume it to be an ip, then find a free online WHOIS API and just go from there!

Best of luck! 🤝
(Aug 19, 2014 06:03 AM)taktaktak Wrote:  I honestly wouldn't waste money on something like that as its not very hard at all. Par your request here is source-code for what you are trying to do https://hackforums.net/showthread.php?tid=4335463 . And contrary to what whoever said it, it's completely fine to check cmsSending and cmsReceived(or read I cant remember) at the same time. The source code works fine as long as you follow the very last step on the source code. It wouldn't be very hard at all to expand from this as its just a bunch of if then's following the main logic for resolving you could just say look for the command "!WHOIS" and then just take all the proceeding text and assume it to be an ip, then find a free online WHOIS API and just go from there!

Best of luck! 🤝
oh yea my thing is already pretty much done, tbh i just added in the necessary things like the resolver and geoip tracer thing.I really done see the point of all this other shit like a cloudflare resolver, or a is-it-up thing in it.Also i tried your bot and it didnt work for some reason, including the initial--
Code
If message.Contains("!resolve:") Then
      msg.Chat.SendMessage(botname & " says: Processing...")
--
That didnt even send me the message or put anything in the listbox , also when u said last step of it i dont know what u mean, do u mean this:
Code
skype.ResetCache() 'Reset our skype cache

As someone who is new to vb.net i hate using code that i dont understand at all, which is exactly what i did when i saw this in your code, I dont really understand what it does but i tried it anyway and it semi worked, The first line of code to request the msg.body worked untill the ones after it, idk what really happened but it just got glitchy.

Code
Private Sub newmsg(ByVal msg As ChatMessage, ByVal status As TChatMessageStatus) 'Cary the message info over to skype_messagestatus while also putting it in a new thread
      Dim newthread As New Thread(Sub() skype_messagestatus(msg, status))
      newthread.Start()
    End Sub
This is what i put into the code along with your handler but that didn't seem to do anything. Also when the cache is cleared what exactly does that do.

hate to bother you, but like you said it is something not worth paying for, and i don't plan to.

if anybody else has suggestions feel free to tell me.


Possibly Related Threads...
Thread / Author Replies Views Last Post
[C#] by Delirium™May 15, 2017 09:50 AM 16 655 May 15, 2017 09:50 AM
Last Post: Ninja
[.NET] by PharmacistNov 18, 2016 02:59 AM 4 158 Nov 18, 2016 02:59 AM
Last Post: Rhez
[Python] by xx1ben99xxSep 13, 2016 02:29 PM 1 110 Sep 13, 2016 02:29 PM
Last Post: SIM-1866423