d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Helpful Greasemonkey User Script
Prev12345Next
Add Reply New Topic New Poll
Member
Posts: 10,172
Joined: Sep 4 2008
Gold: 11.50
Oct 19 2009 08:36am
This is such good concept... just leave it to programmers with the slightest amount of free time to invent a "win" button!

I will try this out asap.
Quick question though; Where do we add more people to block, in the code?

Code
var regexString = prompt('Please set the regular expression used to select users to automatically hide (or blank not to hide any).','Muted');


After 'Muted'?

Say, I wanted to block the following people (for example):

-Muted
-Ghot
-JuicyFruitSweet
-Urbanshaft
(and possibly others)

Would I write(?):

Code
var regexString = prompt('Please set the regular expression used to select users to automatically hide (or blank not to hide any).','Muted' , 'Ghot' , 'JuicyFruitSweet');




This post was edited by PENandPAPER on Oct 19 2009 08:41am
Member
Posts: 13,415
Joined: Nov 2 2006
Gold: 10,868.00
Oct 19 2009 08:53am
Quote (PENandPAPER @ Mon, Oct 19 2009, 02:36pm)
This is such good concept... just leave it to programmers with the slightest amount of free time to invent a "win" button!

I will try this out asap.
Quick question though; Where do we add more people to block, in the code?

Code
var regexString = prompt('Please set the regular expression used to select users to automatically hide (or blank not to hide any).','Muted');


After 'Muted'?

Say, I wanted to block the following people (for example):

-Muted
-Ghot
-JuicyFruitSweet
-Urbanshaft
(and possibly others)

Would I write(?):

Code
var regexString = prompt('Please set the regular expression used to select users to automatically hide (or blank not to hide any).','Muted' , 'Ghot' , 'JuicyFruitSweet');


try this:

Code
var regexString = prompt('Please set the regular expression used to select users to automatically hide (or blank not to hide any).','/Muted|Ghot|JuicyFruitSweet|Urbanshaft/');


i haven't really looked at the script so it may not work
Member
Posts: 6,953
Joined: Sep 27 2003
Gold: 518.50
Oct 19 2009 09:12am
Quote (PENandPAPER @ Mon, Oct 19 2009, 09:36am)
This is such good concept... just leave it to programmers with the slightest amount of free time to invent a "win" button!

I will try this out asap.
Quick question though; Where do we add more people to block, in the code?

Codevar regexString = prompt('Please set the regular expression used to select users to automatically hide (or blank not to hide any).','Muted');

After 'Muted'?

Say, I wanted to block the following people (for example):

-Muted
-Ghot
-JuicyFruitSweet
-Urbanshaft
(and possibly others)

Would I write(?):

Codevar regexString = prompt('Please set the regular expression used to select users to automatically hide (or blank not to hide any).','Muted' , 'Ghot' , 'JuicyFruitSweet');

I'm assuming you don't know regular expressions...

The first time you run the script, it will ask you for the regular express you would like to use to automatically filter people. If you want to do more, you have to regex them together in the text box with a '|'. Which means, your question would be something like:
Quote
Muted|Ghot|JuicyFruitSweet|UrbanShaft

This option can be changed at any time by selecting Tools>Greasemonkey>User Script Commands>Set D2jsp Forums Autohide

Quote (NoWhere @ Mon, Oct 19 2009, 09:53am)
try this:

Code
var regexString = prompt('Please set the regular expression used to select users to automatically hide (or blank not to hide any).','/Muted|Ghot|JuicyFruitSweet|Urbanshaft/');


i haven't really looked at the script so it may not work

This won't work, since I build a regexp literal from the string, whereas the /.../ statement tells Javascript to build a regexp literal. So, those slashes are interpreted as actual regexp code, which is not what you want to happen.

This post was edited by ASBands on Oct 19 2009 09:14am
Member
Posts: 10,172
Joined: Sep 4 2008
Gold: 11.50
Oct 19 2009 09:36am
Quote (ASBands @ Mon, Oct 19 2009, 11:12am)
I'm assuming you don't know regular expressions...

The first time you run the script, it will ask you for the regular express you would like to use to automatically filter people.  If you want to do more, you have to regex them together in the text box with a '|'.  Which means, your question would be something like:

This option can be changed at any time by selecting Tools>Greasemonkey>User Script Commands>Set D2jsp Forums Autohide


This won't work, since I build a regexp literal from the string, whereas the /.../ statement tells Javascript to build a regexp literal.  So, those slashes are interpreted as actual regexp code, which is not what you want to happen.


Yeah you're right I don't... just some java and html, java looks similar to this, but I don't even know what language this is written in lol.

Anyway, when my motherboard is repaired, I will try this out on my computer with an actual mouse.
Member
Posts: 6,953
Joined: Sep 27 2003
Gold: 518.50
Oct 19 2009 10:11am
Quote (PENandPAPER @ Mon, Oct 19 2009, 10:36am)
Yeah you're right I don't... just some java and html, java looks similar to this, but I don't even know what language this is written in lol.

Anyway, when my motherboard is repaired, I will try this out on my computer with an actual mouse.

It's Javascript, which, while it bears a resemblance to Java and is often confused with it, is not related to Java.

I was thinking: would it be a good idea to maintain a system like AdBlock for annoying users? A community system for filtering out content, that is. I mean, it would basically be a community ban system if enough people used the extension.

EDIT: Also works in Firefox 3.5.

This post was edited by ASBands on Oct 19 2009 10:33am
Member
Posts: 10,172
Joined: Sep 4 2008
Gold: 11.50
Oct 19 2009 02:26pm
Quote (ASBands @ Mon, Oct 19 2009, 12:11pm)
It's Javascript, which, while it bears a resemblance to Java and is often confused with it, is not related to Java.

I was thinking: would it be a good idea to maintain a system like AdBlock for annoying users?  A community system for filtering out content, that is.  I mean, it would basically be a community ban system if enough people used the extension.

EDIT: Also works in Firefox 3.5.


Yes, it would actually, I would download it. You could write it, yes? I always admire people who write scripts for noobie users like me :D
Member
Posts: 9,475
Joined: Mar 14 2005
Gold: 110.00
Oct 19 2009 04:13pm
Quote (ASBands @ Mon, 19 Oct 2009, 11:11)
It's Javascript, which, while it bears a resemblance to Java and is often confused with it, is not related to Java.

I was thinking: would it be a good idea to maintain a system like AdBlock for annoying users?  A community system for filtering out content, that is.  I mean, it would basically be a community ban system if enough people used the extension.

EDIT: Also works in Firefox 3.5.


I see horrible abuse with this without severely limiting who can modify the list. Though, hiding scammer/locked/warned accounts would be a good start and if in theory, everyone used this, then those tags would carry more heft than they do now.

I just noticed PENandPAPER would be hidden with this...

This post was edited by llamaoo7 on Oct 19 2009 04:13pm
Member
Posts: 6,953
Joined: Sep 27 2003
Gold: 518.50
Oct 19 2009 04:30pm
Quote (llamaoo7 @ Mon, Oct 19 2009, 05:13pm)
I see horrible abuse with this without severely limiting who can modify the list.  Though, hiding scammer/locked/warned accounts would be a good start and if in theory, everyone used this, then those tags would carry more heft than they do now. 

I just noticed PENandPAPER would be hidden with this...

I mean, it would be just like AdBlock - you would manage "subscriptions" where you could trust whoever you wanted to. Although I have this strange vision of two sides of D2jsp forming, each blocking all the users of the other side and posing here while completely ignoring the opponents.

And it's easy to detect 'Scammer' and warn levels, so that might not be a bad feature to add...
Member
Posts: 9,475
Joined: Mar 14 2005
Gold: 110.00
Oct 19 2009 04:36pm
Another alternative would be to highlight their posts in light red or something. You could also highlight trusted users with green, etc...

and it could also shoot fireworks.
Member
Posts: 6,953
Joined: Sep 27 2003
Gold: 518.50
Oct 19 2009 04:42pm
Quote (llamaoo7 @ Mon, Oct 19 2009, 05:36pm)
Another alternative would be to highlight their posts in light red or something.  You could also highlight trusted users with green, etc...

and it could also shoot fireworks.

Is it sad that I'm actually considering the second option? Every time you open a post, fireworks start shooting...
Go Back To Programming & Development Topic List
Prev12345Next
Add Reply New Topic New Poll