Does anyone know that the Anhkbot/Streamlabs CSV export format looks like?


#1

PhantomBot Version: 2.4.2 (Revision: 5c75a7b2)
OS Version: Windows 10 10.0 (x86) # Eh? It’s 64 bit, must be 32 bit JRE…
Java Version: 1.8.0_181-b13
Stock PhantomBot: Yes

Hello,
Based on the information in the topic AnkhBot/StreamLabs Chat Bot to PhantomBot Converter, I found that there was a command to batch import points from Anhkbot into PhantomBot. Sadly, the version of the StreamLabs Chatbot that I have does not have this functionality for some reason, and I was using the StreamLabs extension for points tracking >_>

I’m just curious what the format of the CSV export is so that I can construct it with the following javascript snippet run on the streamlabs site:

$("div[style=''] > div.section__body > div .account-table tr").each(function(r){
    console.log($(this).children(".table__name").text().trim() + "," + $(this).children(".table__message").text().trim());
});

I currently have a CSV consisting of the fields lowercased_username,points and I’m not certain if they will import like that or not or if I need more information.

Thanks!


#2

So here’s (some of) the code for the Ankh conversion in the bot:

        while ((brLine = bufferedReader.readLine()) != null) {
            String[] spl = brLine.split(",");

            users.add(spl[0].toLowerCase());
            points.add(spl[1]);
            time.add(String.valueOf((Integer.parseInt(spl[2]) * 3600)));
            com.gmt2001.Console.out.println("Imported: " + spl[0] + " - Points: " + spl[1] + " - Time " + spl[2]);
        }

Based on the logic here I would have to assume the format is:

Username,Points,Time

Note that the code ignores whatever is on the first line of the .csv (because it’s assumed there is a comment saying the CSV structure), so be sure to set your file up for that.


#3

Thank you very much! I’m not familiar with the Java code architecture that’s in place, so this helps me out a ton!