generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: JavaScript Post-Removing

Previous Thread :: Next Thread 
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
04 Apr 2015 10:56 AM
So I have a very basic JavaScript that is supposed to remove posts from this spammer I know of (the spammer enjoys ruining my post with large blocks of no text, lagging people out)

Problem, it says it cannot read firstChild property of null:


var posts = document.getElementsByClassName("forum-post");
for (var i = 0; i < posts.length; ++i) {
if (posts[i].firstChild.firstChild.firstChild.firstChild.firstChild.getElementsByClassName("normalTextSmallBold notranslate")[1].href.search("Vetlean")) {
posts[i].parentNode.removeChild(posts[i])
}
}


Any help you can possibly give me will be very much appreciated.
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
04 Apr 2015 11:19 AM
Bump.
Report Abuse
gskw is not online. gskw
Joined: 05 Jan 2013
Total Posts: 1364
04 Apr 2015 11:35 AM
Why firstChild.firstChild.firstChild?
Just do jQuery!
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
04 Apr 2015 02:07 PM
idk jquery lol, can't you just help me?
Report Abuse
gskw is not online. gskw
Joined: 05 Jan 2013
Total Posts: 1364
05 Apr 2015 01:51 AM
The problem must be that you're going too far with .firstChilds. Just do something like $("forum-post .normalTextSmallBold").each(function(this) { /* stuff */ });
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
05 Apr 2015 06:09 AM
@gskw What the heck is that? I got rid of a .firstChild and got the same result.

Help me!!!
Report Abuse
BothAngles is not online. BothAngles
Joined: 01 Dec 2011
Total Posts: 9604
05 Apr 2015 07:22 AM
That's jquery
If you want the code to run automatically you'll need greasemonkey

post blocked is annoying af

http://
pastebin.
com/
dzEZAnpM
Report Abuse
gskw is not online. gskw
Joined: 05 Jan 2013
Total Posts: 1364
05 Apr 2015 08:22 AM
The problem is that the first child of posts[i] is a text node. Just. Do. jQuery.

This is a signature. Recommended username: CapableGskw
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
05 Apr 2015 02:59 PM
@gskw Can you rewrite my code to work (jquery)

idk how to set up jquery lol.
Report Abuse
BothAngles is not online. BothAngles
Joined: 01 Dec 2011
Total Posts: 9604
05 Apr 2015 03:01 PM
http://
paste
bin.
com/crhiUXwJ
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
05 Apr 2015 03:38 PM
ReferenceError: unsafeWindow is not defined
Report Abuse
BothAngles is not online. BothAngles
Joined: 01 Dec 2011
Total Posts: 9604
05 Apr 2015 03:48 PM
its a userscript for the greasemonkey/tampermonkey addon
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
05 Apr 2015 07:58 PM
I just want something I can run in the JS console on google chrome
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image