With the recent ban on shoutbox bots, I decided to rebel against the administration and make this thread so that people with cool scripts for the website/sb can share them for us all to use. To kick things off, I'll post a script I wrote that gives you a desktop notification whenever someone mentions your name in shoutbox. Make sure that you have Tampermonkey installed, and this is the script: https://pastebin.com/raw/FkfArHBP Make sure you modify the name strings on lines 34, 36, and 38. also @XpropIayer i stole some of your code, sorry bro
lol... thats what the code started as. @Yatty wrote it. Yours is ugly af. But w/e code is code. I'm probably going to turn my combobreaker into an alerter so I can break chains still, but the code was written by @Opalium and wouldn't release without his permission as it was a more of a proof of concept.
No easy to use customizable settings area? garbage. Btw since I'm nice I'll paste the original code back in here. Code: // ==UserScript== // @name Taigachat Notifier // @namespace seriousgmod.com // @version 1.2.3 // @description Alerts you when your name is mentioned // @author Lamp(OC)/Yatty // @include https://www.seriousgmod.com/chat/ // @include https://www.seriousgmod.com/chat/popup // @include https://www.seriousgmod.com/ // @grant none // ==/UserScript== // ==Settings== var yourName = "Yatty"; // Your name or the text that will trigger the notification (not case-sensitive) var changeFaviconEnabled = true; // Enable/disable changing the favicon when notifying var soundEnabled = true; // Enable/disable playing sound when notifying var PushNotificationEnabled = true; // Enable/disable sending push/desktop/browser notification when notifying var modifyRefreshRateEnabled = true; // Enable/disable modifying the chat refresh rate for faster response and greater reliability var customRefreshRate = 0.1; // The new refresh rate to use when modifying refresh rate is enabled; Time in seconds between chat refreshes var soundFileURL = "http://a.pomf.cat/sqlnkb.mp3"; // URL to notification sound file var alertFaviconURL = "http://www.iconj.com/ico/i/2/i27q0ochtu.ico"; // URL to notification favicon file // ============ var msg; var isNotified = false; var sound = new Audio(soundFileURL); if(PushNotificationEnabled) checkNotification(); if(modifyRefreshRateEnabled) {setTimeout(function () {taigachat.refreshtime = customRefreshRate; taigachat.focusedRefreshTime = customRefreshRate; taigachat.unfocusedRefreshTime = customRefreshRate; taigachat.tabUnfocusedRefreshTime = customRefreshRate; },1000);} window.onblur = denotify; setInterval(function() { msg = $(".taigachat_messagetext").last()[0].innerText; if (msg.toLowerCase().includes(yourName.toLowerCase())) notify(); }, 1000); function notify() { if (!isNotified) { if (changeFaviconEnabled) changeFavicon(alertFaviconURL); if (soundEnabled) sound.play(); if (PushNotificationEnabled) {var idk = new Notification('“'+msg+'”');} } isNotified = true; } function denotify() { if (isNotified) { if (changeFaviconEnabled) changeFavicon('/favicon.ico'); isNotified = false; } } // http://stackoverflow.com/a/2995536 document.head = document.head || document.getElementsByTagName('head')[0]; function changeFavicon(src) { var link = document.createElement('link'), oldLink = document.getElementById('dynamic-favicon'); link.id = 'dynamic-favicon'; link.rel = 'shortcut icon'; link.href = src; if (oldLink) { document.head.removeChild(oldLink); } document.head.appendChild(link); } // derived from https://jsfiddle.net/3sdr9Lqj/2/ function checkNotification() { if (!("Notification" in window)) { alert("This browser does not support push notifications."); } else if (Notification.permission !== 'denied') { Notification.requestPermission(function(permission) { if (!('permission' in Notification)) { Notification.permission = permission; } }); } } Also ontop of that I have a few others that I'll just show off~ These are mainly related to just SGM but I have pages of active scripts for other sites as well. - Makes multipage threads into one facebook-esk page(pretty nice for things like the faces thread and a few other threads) - Allows anyone with this script to view custom set names that allow for bbcode/html support(also works in SB~) - Pretty self explanitory~ Autorates posts made by white/blacklisted users on posts. Don't really use this one too much but yea~ Powerful in the wrong hands? - Still not 100% working but allows for multiple instances of SB rooms(other rooms aren't logged like main SB) Yea~ I doubt I'll ever really release this one. Easily exploited and just all around trollish in nature. - Hides ignored members in SB. Kinda broken but requires effort to fix. idc enough about it to fix.
CAn you share the player nicknames? Also how do you do the white-listing, is it by username or user id?
By popular demand. I figured I'd actually release this since it's somewhat done. However I will be removing the database side from the code to prevent issues. It's all client-sided. Code: // ==UserScript== // @name SGM - Custom Usernames // @version 1.3 // @description Replaces Usernames on Profile Page and other pages // @author sapphy(Idea)/Yatty // @match https://www.seriousgmod.com/* // @grant none // ==/UserScript== (function() { 'use strict'; // [ID, Replacement, If the original name should be replaced] var replacements = [ [10789, "Yattem", false], [138, "Sky", false], [6775, "Xboo", false] ]; function replace() { var usernames = document.getElementsByClassName('username'); main: for (var i = 0; i < usernames.length; ++i) { var item = usernames[i].children[0]; if (item) { if (usernames[i].href) { var id = usernames[i].href.split(".").slice(-1)[0].split("/")[0]; for (var i2 = 0; i2 < replacements.length; ++i2) { var replacement = replacements[i2]; if (id == replacement[0]) { if (!item.innerHTML.includes(replacement[1])) { if(replacement[2]){ item.innerHTML = replacement[1]; } else { item.innerHTML = item.innerHTML + " <span style=\"color: grey;\">(" + replacement[1] + ")</span>"; } } } } } else { if (usernames[i].tagName == "H1") { id = window.location.href.split("/").slice(-2)[0].split(".").slice(-1)[0]; for (var i2 = 0; i2 < replacements.length; ++i2) { var replacement = replacements[i2]; if (id == replacement[0]) { if (!item.innerHTML.includes(replacement[1])) { if(replacement[2]){ item.innerHTML = replacement[1]; } else { item.innerHTML = item.innerHTML + " <span style=\"color: grey;\">(" + replacement[1] + ")</span>"; } } } } } if (usernames[i].tagName == "H3") { var id = item.href.split(".").slice(-1)[0].split("/")[0]; for (var i2 = 0; i2 < replacements.length; ++i2) { var replacement = replacements[i2]; if (id == replacement[0]) { if (!item.innerHTML.includes(replacement[1])) { if(!item.className.includes("StatusTooltip")){ if(replacement[2]){ item.innerHTML = replacement[1]; } else { item.innerHTML = item.innerHTML + " <span style=\"color: grey;\">(" + replacement[1] + ")</span>"; } } } } } } } } } } replace(); setInterval(function() { replace(); }, 10); })();
Someone help me come up with something funny to do with this. I'm thinking perhaps messages with keywords get jumbod?
Updated proper notifier, won't spam notifications anymore and enables local taigachat modification. To edit please change var yourname and enable / disable sound, push notifications, and change favicon https://hastebin.com/cuhupadini.hs Code: // ==UserScript== // @name Taigachat Notifier Clean // @namespace seriousgmod.com // @version 2.0 // @description Alerts you when your name is mentioned // @author Lamp(OC)/Yatty/ Xproplayer // @include https://www.seriousgmod.com/chat/ // @include https://www.seriousgmod.com/chat/popup // @include https://www.seriousgmod.com/ // @grant none // ==/UserScript== // ==Settings== var yourName = "xpro"; // Your name or the text that will trigger the notification (not case-sensitive) var changeFaviconEnabled = true; // Enable/disable changing the favicon when notifying var soundEnabled = true; // Enable/disable playing sound when notifying var PushNotificationEnabled = false; // Enable/disable sending push/desktop/browser notification when notifying var modifyRefreshRateEnabled = true; // Enable/disable modifying the chat refresh rate for faster response and greater reliability var customRefreshRate = 1; // The new refresh rate to use when modifying refresh rate is enabled; Time in seconds between chat refreshes var soundFileURL = "http://a.pomf.cat/sqlnkb.mp3"; // URL to notification sound file var alertFaviconURL = "http://a.pomf.cat/rlnuys.ICO"; // URL to notification favicon file // ============ if(PushNotificationEnabled) checkNotification(); var msg; var ding; var isNotified = false; var sound = new Audio(soundFileURL); var msghtml; if(modifyRefreshRateEnabled) {setTimeout(function () {taigachat.refreshtime = customRefreshRate; taigachat.focusedRefreshTime = customRefreshRate; taigachat.unfocusedRefreshTime = customRefreshRate; taigachat.tabUnfocusedRefreshTime = customRefreshRate; },1000);} window.onblur = denotify; setInterval(function() { msg = $(".taigachat_messagetext").last()[0].innerText; if (msg.toLowerCase().includes(yourName.toLowerCase()) && msg != ding) { $(".taigachat_messagetext").last()[0].style.fontSize = "large"; notify(); } ding = msg; }, 1000); function notify() { if (!isNotified) { if (changeFaviconEnabled) changeFavicon(alertFaviconURL); if (soundEnabled) sound.play(); if (PushNotificationEnabled) {var idk = new Notification('“'+msg+'”');} } isNotified = true; } function denotify() { if (isNotified) { if (changeFaviconEnabled) changeFavicon('/favicon.ico'); isNotified = false; } } document.head = document.head || document.getElementsByTagName('head')[0]; function changeFavicon(src) { var link = document.createElement('link'), oldLink = document.getElementById('dynamic-favicon'); link.id = 'dynamic-favicon'; link.rel = 'shortcut icon'; link.href = src; if (oldLink) { document.head.removeChild(oldLink); } document.head.appendChild(link); } function checkNotification() { if (!("Notification" in window)) { alert("This browser does not support push notifications."); } else if (Notification.permission !== 'denied') { Notification.requestPermission(function(permission) { if (!('permission' in Notification)) { Notification.permission = permission; } }); } } $(document).ready(function() { taigachat.canModify = true; taigachat.canModifyAll = true; });
Does anyone happen to have the text color changer and the new posts on the full shout box? I deleted tamper monkey by an accident and lost all of my scripts Oh and the lines to add a image to the notifier @Xproplayer