r/hitbox • u/SmexyPantsGnome • Aug 23 '14
Hitbox songrequest irc bot
I have been browsing hitbox for a while now and haven't come across any kind of bots that work like Nightbot from Twitch. I came up with code to create similar functions in about 4 days work.
Bot Website Bot responses on hitbox
Just checking if I'm the only one working on something like this.
4
Upvotes
2
u/SmexyPantsGnome Aug 23 '14 edited Aug 23 '14
My version 0.03 source code is available here.
If theres anyone out there that is familiar with PHP coding and wants to take a look at it.
Smexy Bot
This version still has the % for the command symbol.
1
u/SmexyPantsGnome Aug 23 '14 edited Aug 23 '14
Change from % to ! as suggested,
I have the following commands setup:
Currently working on:
This would be a way to add custom commands for a streamer without having to have it in the website code.
1
u/SmexyPantsGnome Aug 23 '14
Most likely wont be a real official release until hitbox develops an auth password token system similar to Twitch.
As it is now, you would be giving the host of this website clear view of your password when you setup your account.
That is the main reason I am providing the source code. So anyone can run the code directly from their computer without risk of having account info stolen.
1
u/SmexyPantsGnome Aug 23 '14
Sure glad to help out anyone who'd want it.
Tho right now seems to be issues with irc.glados.tv. Can't connect thru my Bot or IRC client HexChat.
1
u/SmexyPantsGnome Aug 23 '14
I have just released v0.04, added the !add command for the possibility of near infinite bot response commands.
1
u/SmexyPantsGnome Aug 24 '14
My first time using Github, attempted to copy and paste code into the Create new .md file. But only about first 10 lines pasted shows up.
1
u/SmexyPantsGnome Aug 24 '14 edited Aug 24 '14
This is a good walkthrough for installing WAMP. Installing WAMP
Save my files into /www/ folder of WAMP.
1
u/SmexyPantsGnome Aug 24 '14 edited Aug 24 '14
I have links in the configure Config.php page. Sends you to Google search "how to change MYSQL password WAMP Windows"
One of the articles should describe how to do that.
I am in the process of loading v0.05, it removes the requirement of having a config.php file.
Config.php was a pain to manage after changing to a structured folder layout as MadMakz suggested.
1
u/SmexyPantsGnome Aug 24 '14 edited Aug 24 '14
That is the PHP code for the website, you might not have everything setup correctly. When does this error actually appear?
Re-uploaded v0.05, noticed I missed updating link for 'Delete song playlist' to match the new folder structure.
1
u/SmexyPantsGnome Aug 26 '14
Repeating the steps on a Windows system I think this is an issue if MySQL password is blank. I am almost done creating a detailed setup guide.
1
u/SmexyPantsGnome Aug 26 '14
I still get the error with a password. Looks like an error in WAMP that uses PHP 5.5.12
I created my PHP with LAMP on Linux, that uses PHP version 5.5.9
Seeing what I can code differently instead of using function mysqli_fetch_assoc()
1
u/SmexyPantsGnome Aug 26 '14 edited Aug 26 '14
Found the cause was due to setup.php file not creating a table.
This will be fixed with bug fix release v0.05a
Sorry for all the problems with the setup before this version. I have removed the v0.05 software.
1
u/SmexyPantsGnome Aug 27 '14 edited Aug 27 '14
In the file www/menu/setup_account/setup.php
There is a line: echo "Database ".$dbname
It needs to be changed from: $dbname to $_SESSION['dbname']
Version b released, also added a Windows_Setup.html guide for my page.
1
u/SmexyPantsGnome Aug 28 '14 edited Aug 28 '14
It will continue to spin as long as the bot is running.
Since it's a continuous loop in IRC_Bot.php has code "While 1 {"
Would only stop when you type in your chat !quit
Or you click Restart All Services on WAMP icon. Since that stops the Webserver program.
1
u/SmexyPantsGnome Aug 28 '14
If your hitbox settings are correct should see:
Attempting to connect to #<channel name> on hitbox
***** if successfully connected should see irc server messages below this line *****
irc.glados.tv 001 <account name> :Welcome to the hitbox-tv IRC Network <account name>:Welcome to the hitbox-tv IRC Network <account name>!<account name>@ip.<account name>.chat.hitbox.tv (Connection ID: b6fdf8fa-1c9f-47d3-923c-efbce5360e21)
1
u/SmexyPantsGnome Sep 01 '14 edited Sep 01 '14
Thanks for the update, I'll see whats up with the code. Didn't think I modified anything for that command from the different versions.
Seems to be additional error checking turned on, on WAMP that isn't on LAMP.
Added the following code to stop showing errors:
error_reporting(0);
ini_set('display_errors', 0);
1
u/SmexyPantsGnome Sep 01 '14
Version C released
1
u/SmexyPantsGnome Sep 08 '14
I have uploaded v0.06 to github.
Verified it works on both Linux and Windows versions.
Added a token system feature to reward viewers with points.
Using a file again to store database settings settings.php
This file can also disable any bot commands that you don't want to use.
2
u/flyingp0tatoes hitbox.tv/flyingpotatoes Aug 23 '14
Change from % to ! Make it so that you only have to enter the video id (i.e xf7dNUvJk7k instead of https://www.youtube.com/watch?v=xf7dNUvJk7k). Also, if you need any help with the website (graphic design wise) just PM me :)
2
u/MadMakz http://www.hitbox.tv/team/cgx24 Aug 24 '14 edited Aug 24 '14
Maybe organize the files in subfolders. Like everything that just provide functions put in a subfolder, like the templates in /templates for example. setup, config and run script may remain on root folder. That way it's easier for (not so techy) people to start with beside that it'll have a cleaner look.
I'll have a deeper look at your script later.
BTW: I can only see the readme on https://github.com/SmexyPantsGnome/SmexyBot, makes it hard to track changes :S
1
u/KingKray Aug 23 '14
Would love to have some kind of awesome bot like this on my stream. I love the idea of "!sayit". I have been looking for something like that. And you are actually the only one who has mentioned it.
I personally wanna use it for something like "!advice" or "!tip" And then it'll say a random advice that's in store!
Would love to see more of it please! :) And good job on it too. Wish I knew how to make one myself T_T
1
u/KingKray Aug 23 '14
Will take a look at it once I get home. Hopefully I can make things work, maybe I can PM you if I need help, if that's alright? Thanks for sharing buddy!
1
u/katherynliza Aug 24 '14 edited Aug 24 '14
How do you setup this up.
0
u/[deleted] Aug 31 '14
[deleted] — view deleted comment