Advertisement
Guest User

Untitled

a guest
Nov 20th, 2018
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.15 KB | None | 0 0
  1. // ==UserScript==
  2. // @name Group Wall Blacklist
  3. // @namespace http://roblox-blacklist/
  4. // @version 1.0.2
  5. // @description Delete posts on your group wall that have words from the blacklist.
  6. // @author BADGRAPHIX (1.0.0 and 1.0.2)
  7. // @author Stelonlevo (1.0.1)
  8. // @match *://www.roblox.com/my/groups.aspx*
  9. // @match *://www.roblox.com/My/Groups.aspx*
  10. // @grant none
  11. // @require http://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js
  12. // @require https://www.thomasfrank.se/sessvars.js
  13. // ==/UserScript==
  14.  
  15. //HERE'S WHAT YOU NEED TO DO:
  16. //Modify the blacklist below to your liking. Any post on your group wall with any of these words will be automatically deleted.
  17.  
  18. var AdvancePages = false
  19. var wordBlacklist = new Array('rewardbuddy.club')
  20. //Blacklist notes: 'robux', 'scam', 'free', , 'claim', 'eligible', 'redeem', 'vip'
  21. //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.
  22. //Don't include simple words. This script will check for these words anywhere in the text, so if you add 'run' to the blacklist,
  23. //it will delete a post that has the word 'cRUNchy' in it, for example.
  24. //A blacklist with multiple words is formatted like this: new Array('robux','free','scam')
  25.  
  26. var theForm = document.forms['aspnetForm']
  27. if (!theForm) {
  28. theForm = document.aspnetForm
  29. }
  30.  
  31. function __doPostBack(eventTarget, eventArgument) {
  32. if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
  33. theForm.__EVENTTARGET.value = eventTarget
  34. theForm.__EVENTARGUMENT.value = eventArgument
  35. theForm.submit()
  36. }
  37. }
  38.  
  39. function VetNthPost() {
  40. var CurrentPage = Number($("#ctl00_cphRoblox_GroupWallPane_GroupWallPager_ctl01_Div1").text().replace("of", "").replace("Page ", "").trim())
  41. if (Number(CurrentPage) < Number(sessvars.Page)) {
  42. console.log("Page: "+CurrentPage+" Expected: "+sessvars.Page)
  43. console.log("Past page")
  44. return false
  45. } else if (Number(CurrentPage) > Number(sessvars.Page)) {
  46. console.log("Page: "+CurrentPage+" Expected: "+sessvars.Page)
  47. sessvars.Page = Number(CurrentPage)
  48. VetNthPost()
  49. return false
  50. } else {
  51. console.log("Page: "+CurrentPage+" Expected: "+sessvars.Page)
  52. var WallPost = $('.GroupWall_PostContainer').eq(sessvars.WallPost)
  53. var isBadPost = false
  54. if (WallPost.parent().find("[id$=LinkButton0]").length) {
  55. wordBlacklist.forEach(function(word) {
  56. if (WallPost.text().toLowerCase().includes(word))
  57. {
  58. isBadPost = true
  59. return true
  60. }
  61. })
  62. }
  63.  
  64. if (isBadPost === true) {
  65. console.log("Deleting post")
  66. __doPostBack('ctl00$cphRoblox$GroupWallPane$GroupWall$ctrl'+sessvars.WallPost+'$LinkButton0','')
  67. } else if (sessvars.WallPost > 10) {
  68. if (AdvancePages === true) {
  69. console.log("Proceeding to next page")
  70. sessvars.Page = sessvars.Page + 1
  71. sessvars.WallPost = 0
  72. console.log("Page is now: "+sessvars.Page)
  73. __doPostBack('ctl00$cphRoblox$GroupWallPane$GroupWallPager$ctl02$ctl00','')
  74. } else {
  75. sessvars.Page = Infinity
  76. return false;
  77. }
  78. } else {
  79. console.log("Proceeding to next post.")
  80. if (sessvars.WallPost > 9)
  81. {
  82. sessvars.Page = 1;
  83. sessvars.WallPost = 0;
  84. setTimeout(refreshPage, 60000);
  85. }
  86. else
  87. {
  88. sessvars.WallPost = sessvars.WallPost + 1
  89. VetNthPost()
  90. }
  91.  
  92. }
  93. }
  94. }
  95.  
  96. function refreshPage() {
  97. window.location.href=window.location.href;
  98.  
  99. };
  100. function vet() {
  101. console.log("Current: "+window.location.href+" last: "+sessvars.SetURL)
  102. if (window.location.href != sessvars.SetURL) {
  103. sessvars.$.clearMem()
  104. console.log("Changed group")
  105. }
  106. if (!sessvars.Page || !Number(sessvars.Page)) {
  107. console.log("First setup")
  108. sessvars.SetURL = window.location.href
  109. sessvars.WallPost = 0
  110. console.log("Setting page to "+ Number($("#ctl00_cphRoblox_GroupWallPane_GroupWallPager_ctl01_Div1").text().replace("Page ", "").trim()))
  111. sessvars.Page = Number($("#ctl00_cphRoblox_GroupWallPane_GroupWallPager_ctl01_Div1").text().replace("Page ", "").trim())
  112. }
  113. VetNthPost()
  114. }
  115.  
  116. $(vet())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement