C# Sharp Bot Resub Help

Hello I am trying to make a bot, and one aspect of the bot is to welcome and give love to resubs. But I am currently struggling at doing that.
Heres the pastebin link:
http://pastebin.com/TNU7Kwja

Thanks for any help.

edit:
its my understaning that resubs send a USERNOTICE to the IRC, but when I parse for it nothing shows up during resubs.

Your current message parsing seems to assume the received message starts with a colon, but in order to get anything useful out of USERNOTICE, you’ll need to enable message tags. See the documentation on it. Consider parsing messages properly; here’s my way of doing it.

Thanks a ton, I got it working. But it seems my infitit loop is killing my cpu usage. How can I have my program keep processing messages without needing a cpu intensive loop?

To be honest, I’d think that the high CPU usage is coming from your line:

        do
        {
            Tick();
        } while (!done);

Especially when there is nothing really to calculate, it just ends up running through each iteration as fast as it can.

I’d suggest to look into some IRC Libraries (the one 3ventic posted is a great one) and see how they handle incoming messages :slight_smile:

haha yeahhh that loop is killer

3ventic’s method is good. If you’re still having issues, this is how I’m doing the parsing in a library I’m working on.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.