Realms Beyond Forum

Full Version: Mafia Helper: User script for filtering posts and making tallies
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9
(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"?
(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.
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.
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.
Well trolling is easy. Just make jpgs from the playernames in red and post that when you vote.
Shush, Rowain.

I made a minor fix to support shorthand hex color codes such as #f00.
(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.
I updated the script with a few bug fixes in the anti-trolling code.
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
Nice. I added the update to the official version linked to in the opening post.
Pages: 1 2 3 4 5 6 7 8 9