Is that character a variant? (I just love getting asked that in channel.) - Charis

Create an account  

 
Mafia Helper: User script for filtering posts and making tallies

(September 29th, 2013, 22:32)NobleHelium Wrote: Cancel that, there's no bug. A certain someone was just trying to be a smartass with the color codes.
full list of 'valid' colours:
if(vote.style && (vote.style.color == "#FF0000" || vote.style.color == "#FF4500" || vote.style.color == "rgb(255, 0, 0)" || vote.style.color == "rgb(255, 69, 0)" || vote.style.color == "Red" || vote.style.color == "red")) {

edit: wait, "Red" and "red" are different, but it appears to accept "#ff0000"?
-- Don’t forget.
Always, somewhere,
someone is fighting for you.
-- As long as you remember her,
you are not alone.
Reply

(September 30th, 2013, 01:58)Mattimeo Wrote:
(September 29th, 2013, 22:32)NobleHelium Wrote: Cancel that, there's no bug. A certain someone was just trying to be a smartass with the color codes.
full list of 'valid' colours:
if(vote.style && (vote.style.color == "#FF0000" || vote.style.color == "#FF4500" || vote.style.color == "rgb(255, 0, 0)" || vote.style.color == "rgb(255, 69, 0)" || vote.style.color == "Red" || vote.style.color == "red")) {

edit: wait, "Red" and "red" are different, but it appears to accept "#ff0000"?

It's javascript/DOM black magic. Values go through all kinds of normalization when you read or write them to the DOM tree.
If you know what I mean.
Reply

The == operator uses type coercion and it must recognize that #FF0000 is a color code and thus do automatic case sensitivity checking, while that isn't the case for regular strings.

Looks like novice added in #FF4500 because that is the next color red on the color picker box.
Reply

I updated the script again, this time to recognize more shades of red. It should recognize anything that looks reddish as a vote, and ignore anything in other colors. I'm not going to say how I implemented it, or Mattimeo will try to troll it.
I have to run.
Reply

Well trolling is easy. Just make jpgs from the playernames in red and post that when you vote.
Reply

Shush, Rowain.

I made a minor fix to support shorthand hex color codes such as #f00.
I have to run.
Reply

(November 3rd, 2013, 08:57)novice Wrote: I updated the script again, this time to recognize more shades of red. It should recognize anything that looks reddish as a vote, and ignore anything in other colors. I'm not going to say how I implemented it, or Mattimeo will try to troll it.

He could just look at the source. neenerneener I assume you're just looking at the ratios of the RGB values.
Reply

I updated the script with a few bug fixes in the anti-trolling code.
I have to run.
Reply

Novice, I updated the script with a dropdown box at the top to quickly select a user to isolate. Much more convenient than hunting around for a post to click on.

Here's my copy: https://dl.dropboxusercontent.com/u/4939....tamper.js
If you know what I mean.
Reply

Nice. I added the update to the official version linked to in the opening post.
I have to run.
Reply



Forum Jump: