September 30th, 2013, 01:58
(This post was last modified: September 30th, 2013, 02:00 by Mattimeo.)
Posts: 1,650
Threads: 2
Joined: Jul 2011
(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.
September 30th, 2013, 02:07
Posts: 7,902
Threads: 13
Joined: Aug 2006
(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.
September 30th, 2013, 02:15
(This post was last modified: September 30th, 2013, 02:17 by NobleHelium.)
Posts: 13,250
Threads: 25
Joined: Oct 2010
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.
November 3rd, 2013, 08:57
Posts: 13,563
Threads: 49
Joined: Oct 2009
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.
November 4th, 2013, 04:46
Posts: 8,244
Threads: 30
Joined: Jun 2004
Well trolling is easy. Just make jpgs from the playernames in red and post that when you vote.
November 4th, 2013, 16:20
Posts: 13,563
Threads: 49
Joined: Oct 2009
Shush, Rowain.
I made a minor fix to support shorthand hex color codes such as #f00.
I have to run.
November 4th, 2013, 22:54
(This post was last modified: November 4th, 2013, 22:55 by NobleHelium.)
Posts: 13,250
Threads: 25
Joined: Oct 2010
(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.  I assume you're just looking at the ratios of the RGB values.
November 5th, 2013, 15:07
Posts: 13,563
Threads: 49
Joined: Oct 2009
I updated the script with a few bug fixes in the anti-trolling code.
I have to run.
November 8th, 2013, 04:51
Posts: 7,902
Threads: 13
Joined: Aug 2006
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.
November 8th, 2013, 05:04
Posts: 13,563
Threads: 49
Joined: Oct 2009
Nice. I added the update to the official version linked to in the opening post.
I have to run.
|