Closed Krushchevawn closed 9 years ago
The ircbot is probably not connecting to the channel. You need to make sure that your config https://github.com/ynohtna92/twitch-plays/blob/master/config/config.py has the correct account details and irc settings. The server IP may have changed from when this was made so you might have to go find it.
Yeah, my config is definitely right. Where should I start looking for the server IP?
EDIT: Oh wait, in your original config you have the IP at: 199.9.252.26 I changed it to irc.twitch.tv to connect. Should I not have done that?
EDIT2: Changed to the IP above. Made my game stop registering chat commands. Changed back to irc, working again.
Looking at it again. formatoutput should be
function formatOutput(left, right){
var buffer_size = 20;
var buffer_used = 0;
var whitespace_size = 1;
var img = "";
if (right == "down"){
right = " " // Clear instruction
img = '<img src="downarrow.png" height="16" width="16">'
}
buffer_used = right.toString().length + whitespace_size;
var buffer_left = buffer_size - buffer_used;
if (buffer_left > left.length) {
whitespace_size += buffer_left - left.length;
}
var left_end = buffer_left;
left = left.substring(0, left_end);
return left + Array(whitespace_size + 1).join(" ") + img + right;
};
Not sure what changed from the one you just posted to the original, but I pasted over it in the index.html file, then copy & pasted the code below 6 times, so here's what I have:
function formatOutput(left, right){
var buffer_size = 20;
var buffer_used = 0;
var whitespace_size = 1;
var img = "";
if (right == "up"){
right = " " // Clear instruction
img = '<img src="http://i.imgur.com/TRWSndF.png" height="16" width="16">'
}
if (right == "down"){
right = " " // Clear instruction
img = '<img src="http://i.imgur.com/ZJc5rgj.png" height="16" width="16">'
}
if (right == "left"){
right = " " // Clear instruction
img = '<img src="http://i.imgur.com/dCDjvIA.png" height="16" width="16">'
}
if (right == "right"){
right = " " // Clear instruction
img = '<img src="http://i.imgur.com/LfjpijV.png" height="16" width="16">'
}
if (right == "a"){
right = " " // Clear instruction
img = '<img src="http://i.imgur.com/atGfsuQ.png" height="16" width="16">'
}
if (right == "b"){
right = " " // Clear instruction
img = '<img src="http://i.imgur.com/dOzvma1.png" height="16" width="16">'
}
Still not sure why the inputs don't show on the IP URL page, though :/
are the commands showing on the cmd? Are there any errors when you press F12 on the page
Here's my F12 result:
Red X says: WebSocket connection to 'ws://localhost:8888/ws' failed: Error during WebSocket handshake: Unexpected response code: 403
EDIT: This shows in CMD every-so-often, but I didn't think anything of it since everything is still working fine.
The console tab please. Make sure that a couple of commands register in cmd first.
Yeah, everything regarding CMD Prompt has been fine. Commands register there everytime from multiple people :)
Here's the error (as I edited in above)
EDIT: I view-source'd it and it appear it's on line 171 on the index file
Try run it as admin. 403 is an access restriction error.
I also noticed this just now, if it matters: And you mean run CMD Prompt as Admin?
Nope. Still getting the same error
EDIT: I found this: https://github.com/moccu/django-omnibus/pull/25
Would that help? The post says the answer is: to simply add a check_origin method that returns True. Where would I do that and how?
Try add
def check_origin(self, origin):
return True
in lib\web.py after line 16 so it looks like
class SocketHandler(websocket.WebSocketHandler):
def check_origin(self, origin):
return True
def open(self):
if self not in cl:
cl.append(self)
def on_close(self):
if self in cl:
cl.remove(self)
That gave me this:
EDIT: nevermind, fixed that. hold on.
EDIT2: Ok, on the IP URL adress, it now says my socket port is open! :D Time to test
Indentation in that file is wrong now. I used tabs to indent so you will have to remove all the spaces and indent it all with a tab otherwise it will error.
Yeah, I edited my post (I do that a lot it seems, ha). ^
Alright, the IP URL is now receiving commands! BUT, the images still aren't showing in place of the directional inputs.
Here's how I have my index.html set up. Look fine?
It should be working then. You might need to add css for the images so they float instead of going to the end of line. You can verify the img string is being added by inspecting the line of the command.
Naw, just showing regular directional inputs (up, right, etc) instead of the images. I mean, it's showing up in the Inspect Element box. Not sure why the image isn't displaying, though.
I want the images to show up exactly where the regular text does. Would I just float right for that?
< style>
img {
float: right;
}
< /style>
Ok you also have to change the following:
input_stream_buffer[17] = json.button.formated;
into, to use the method we just made.
input_stream_buffer[17] = formatOutput(json.button.user, json.button.button);
and just a few lines down
$('#' + i).text(input_stream_buffer[i]);
to
$('#' + i).html(input_stream_buffer[i]);
Then adjust it all with css. Good Luck
You're a saint, I don't care what anyone tells you, lol. All I did was edit the lines of code how you said to above and it came out fine without having to edit/add any CSS stuff like you mentioned. :)
Hey, new quick question: This popped up in my CMD Prompt. Any idea how to fix it real quick? First time it's shown.
http://stackoverflow.com/a/11893504 follow this guide.
Yeah, I know how to add a favicon, but I was just wondering why it's only shown up this one time and not all the other hours I've had the Prompt open (like when I was getting that 403 error). Thanks!
Sent from my iPhone
On May 18, 2015, at 6:45 PM, ynohtna92 notifications@github.com wrote:
http://stackoverflow.com/a/11893504 follow this guide.
— Reply to this email directly or view it on GitHub.
Is there Any plan to add anarchy/democracy slider or do you have any idea how to add the anarchy/democracy slider?