Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Group Wall Blacklist
- // @namespace http://roblox-blacklist/
- // @version 1.0.2
- // @description Delete posts on your group wall that have words from the blacklist.
- // @author BADGRAPHIX (1.0.0 and 1.0.2)
- // @author Stelonlevo (1.0.1)
- // @match *://www.roblox.com/My/Groups.aspx*
- // @grant none
- // @require http://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js
- // @require https://www.thomasfrank.se/sessvars.js
- // ==/UserScript==
- //HERE'S WHAT YOU NEED TO DO:
- //Modify the blacklist below to your liking. Any post on your group wall with any of these words will be automatically deleted.
- var AdvancePages = false
- var wordBlacklist = new Array('robux', 'scam', 'free')
- //Blacklist notes:
- //Keep the words all lowercase. Don't worry, when the script runs it will check for any casing, but in the blacklist it must be all lowercase.
- //Don't include simple words. This script will check for these words anywhere in the text, so if you add 'run' to the blacklist,
- //it will delete a post that has the word 'cRUNchy' in it, for example.
- //A blacklist with multiple words is formatted like this: new Array('robux','free','scam')
- var theForm = document.forms['aspnetForm']
- if (!theForm) {
- theForm = document.aspnetForm
- }
- function __doPostBack(eventTarget, eventArgument) {
- if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
- theForm.__EVENTTARGET.value = eventTarget
- theForm.__EVENTARGUMENT.value = eventArgument
- theForm.submit()
- }
- }
- function VetNthPost() {
- var CurrentPage = Number($("#ctl00_cphRoblox_GroupWallPane_GroupWallPager_ctl01_Div1").text().replace("of", "").replace("Page ", "").trim())
- if (Number(CurrentPage) < Number(sessvars.Page)) {
- console.log("Page: "+CurrentPage+" Expected: "+sessvars.Page)
- console.log("Past page")
- return false
- } else if (Number(CurrentPage) > Number(sessvars.Page)) {
- console.log("Page: "+CurrentPage+" Expected: "+sessvars.Page)
- sessvars.Page = Number(CurrentPage)
- VetNthPost()
- return false
- } else {
- console.log("Page: "+CurrentPage+" Expected: "+sessvars.Page)
- var WallPost = $('.GroupWall_PostContainer').eq(sessvars.WallPost)
- var isBadPost = false
- if (WallPost.parent().find("[id$=LinkButton0]").length) {
- wordBlacklist.forEach(function(word) {
- if (WallPost.text().toLowerCase().includes(word))
- {
- isBadPost = true
- return true
- }
- })
- }
- if (isBadPost === true) {
- console.log("Deleting post")
- __doPostBack('ctl00$cphRoblox$GroupWallPane$GroupWall$ctrl'+sessvars.WallPost+'$LinkButton0','')
- } else if (sessvars.WallPost > 10) {
- if (AdvancePages === true) {
- console.log("Proceeding to next page")
- sessvars.Page = sessvars.Page + 1
- sessvars.WallPost = 0
- console.log("Page is now: "+sessvars.Page)
- __doPostBack('ctl00$cphRoblox$GroupWallPane$GroupWallPager$ctl02$ctl00','')
- } else {
- sessvars.Page = Infinity
- return false;
- }
- } else {
- console.log("Proceeding to next post.")
- if (sessvars.WallPost > 9)
- {
- sessvars.Page = 1;
- sessvars.WallPost = 0;
- setTimeout(refreshPage, 60000);
- }
- else
- {
- sessvars.WallPost = sessvars.WallPost + 1
- VetNthPost()
- }
- }
- }
- }
- function refreshPage() {
- window.location.href=window.location.href;
- };
- function vet() {
- console.log("Current: "+window.location.href+" last: "+sessvars.SetURL)
- if (window.location.href != sessvars.SetURL) {
- sessvars.$.clearMem()
- console.log("Changed group")
- }
- if (!sessvars.Page || !Number(sessvars.Page)) {
- console.log("First setup")
- sessvars.SetURL = window.location.href
- sessvars.WallPost = 0
- console.log("Setting page to "+ Number($("#ctl00_cphRoblox_GroupWallPane_GroupWallPager_ctl01_Div1").text().replace("Page ", "").trim()))
- sessvars.Page = Number($("#ctl00_cphRoblox_GroupWallPane_GroupWallPager_ctl01_Div1").text().replace("Page ", "").trim())
- }
- VetNthPost()
- }
- $(vet())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement