Jump to content

Twitch Whisper Bot by MEL0N


MEL0N

Recommended Posts

Hi, I wrote a short and simple "mass whisper" bot for Twitch chat that can be used as a tool by anyone to massively recruit for AC. :~)

What this does exactly is: find all users in the chat, message them the whispers

Prerequisites: Java, Twitch Account, Twitch OAuth, pircbot library dependency 

 

Twitch OAuth - Twitch chat runs on an irc backend and chooses to use OAuth as a form of authentication for applications, go here: https://twitchapps.com/tmi/ and click "Connect to Twitch" --> authorize to receive your code (looks like oauth:.................................), plug this into the oauth field in the code

pircbot library dependency - this is the dependency that this script was written on, simply download it, extract and add the path to your classpath or add it to your libraries in your IDE

 

Proof of concept:

kBoBp7y.png

EgVakAD.png

code:

import org.jibble.pircbot.*;

public class MyBot extends PircBot 
{

    public MyBot(String name) 
    {
        this.setName(name);
    }

}
import org.jibble.pircbot.*;
import java.net.*;
import java.io.*;

public class WhisperMain
{

    public static void main(String[] args) throws Exception 
    {
        System.out.println("Le Twitch Whisperer by Yah Boy MEL0N #ac - http://www.rs-ac.com/index.php?/profile/2299-mel0n/\n");

        String vars[] = {

                "*",                                    //twitch username
                "oauth:**************************",     //oauth code "password"
                "ice_poseidon",                         //stream name 
                "5",                                    //second delay between messages
                "false"                                 //see all the cool, unnecessary irc logs? [true/false]
            };

        String chatters[] = getUserz(vars[2]).split(" ");

        String messageQueue[] = { 

                "Hey bro Keepo",
                "Yo I just saw you talking in stream and thought you were cool lol",
                "I'm part of this large awesome deadman mode clan and thought you'd fit right in",
                "check us out if you want: ṚṠ-ḀḈₓⅭꝊṀ (rs dash ac dꝊt ⅭꝊṀ), hope to see you there bro",

            };

        MyBot bot = new MyBot(vars[0]);
        bot.setVerbose(Boolean.parseBoolean(vars[4]));
        bot.connect("199.9.253.119",6667,vars[1]);                  // dont change me
        bot.joinChannel("#199.9.253.119");                          // dont change me
        bot.sendRawLineViaQueue("CAP REQ :twitch.tv/commands");     // dont change me  
        for (int y = 1; y < chatters.length; y++)
        {
            try 
            {
                for (int x = 0; x < messageQueue.length; x++)
                {
                    Thread.sleep(Integer.parseInt(vars[3])*1000);
                    bot.sendRawLineViaQueue("PRIVMSG #jtv :/w " + chatters[y] + " " + messageQueue[x]);
                }
            } catch(InterruptedException ex) 
            {
                Thread.currentThread().interrupt();
            }
            System.out.println("Messaged " + y + " people.");
        }
    }

    public static String getUserz(String chat) throws Exception
    {
        URL stream = new URL("http://tmi.twitch.tv/group/user/"+ chat +"/chatters");
        BufferedReader inLine = new BufferedReader(new InputStreamReader(stream.openStream()));

        String in; boolean start = false; String scrape = "";

        while ((in = inLine.readLine()) != null)
        {
            if (in.contains("viewers"))
            {
                start = true;
            }
            if (start)
            {
                 if (in.contains("\"") && (in.contains(",")))
                {
                    scrape = scrape + in.substring(in.indexOf("\"")+1,in.length()-2) + " ";
                }
                else
                {
                    scrape = scrape + in.substring(in.indexOf("\"")+1,in.length()-1) + " ";
                }
            }
        }
        inLine.close();
        scrape = scrape.substring(scrape.indexOf(":")+2,scrape.length());
        return scrape;

    }

}

If you have any questions, ask below. :~)

 

Enjoy

Link to comment
Share on other sites

Yeah I would have to agree, this does seem scummy. No one likes advertisements of ANY type, and this (correct me if anyone disagrees on my point of view here) kind of makes us seem lowly and unprofessional as a clan. AC is gaining tons of momentum and traction as it is, and as Brandon said, we don't want the risk of potentially gaining shitty people with shitty intentions

Link to comment
Share on other sites

We're going to get those people either way. That's what the application and selection process is for. You guys act like we'll accept everyone that applies. The selection ratio seems to be at about 40-60% at the moment. Additionally even though this is inherently an advertisement, the dialogue is so written that it doesn't seem to be a hamfisted "join ac" yet an incidental event.

The only thing I'm doing is giving us a bigger net to catch tasty fish with.

Sorry you don't see it that way, but thanks for the input.

Link to comment
Share on other sites

Man the product is awesome but the use isn't a good idea.. We are not first legon recruting randoms in varrock west. If someone really wants to join the clan he will find a way to us, we don't want 500 newbs in the clan because they are no use for us.

Link to comment
Share on other sites

14 minutes ago, 0mnitored said:

Man the product is awesome but the use isn't a good idea.. We are not first legon recruting randoms in varrock west. If someone really wants to join the clan he will find a way to us, we don't want 500 newbs in the clan because they are no use for us.

Thanks, but people aren't going to join what they aren't aware of either. Again, I fail to see how this is different than making videos about AC or typing #ac in chat when mentioned on stream or something synonymous. The only difference is that this is targeted, pseudo-personal, and efficient, which makes it effective.

 

Let's say we only talk about the clan ("advertising") to people we talk to in RS, who we like, let's say its 1% of RS (even though its much much lower). Of these people (according to our acceptance v denials of membership) 50% of them are good pkers and assets to the clan. So 0.5%. On the other hand, let's say we mass advertise and get to 10% of RS (even though we can reach over 50%) and lets say half are clanless and of those half are good pkers, we are left with 2.5% of people who are good and assets to the clan. And even if we don't want huge numbers, we can pick the elitest of the elite.

0.5% vs 2.5% with a simple method that literally requires no manpower. Even if we accept 0%, then our forums are filled with new posts and ideas and even more attractive to potential members.

Thanks for your input though

Link to comment
Share on other sites

We don't want to become first legion, spamming out invites. Not only is it getting more lower levels to try to join, but it also hurts the amount of higher level players who want to join. Me myself would never join a clan that mass advetises/spams their clan around, since it's really annoying. Well done coding it, but unfortunately not something I think we should use.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.