Advertisement
BADGRAPHIX1

Group Wall Blacklist 1.0.2 (Auto-Refresh)

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