Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Show "Save Attempt" Message In Game
- // @description Shows "Save Attempt" on the scoreboard & and above the game (looks for "This is a save attempt!" in the chat from a system message)
- // @version 0.1.1
- // @include http://tagpro-*.koalabeast.com:*
- // @include http://*.jukejuice.com:*
- // @include http://*.newcompte.fr:*
- // @license none
- // @author nabby
- // ==/UserScript==
- tagpro.ready(function() {
- var SaveAttemptMessage = 'This game is a save attempt!';
- function addSaveAttemptMessage() {
- $('#mapInfo').after('<div id="addSaveAttemptMessage" style="font-size:16px;font-weight:bold; color:#f00; text-align:center; text-shadow:1px 2px 1px #222; clear:both">' + SaveAttemptMessage + '</div>');
- $('body').prepend('<div id="addSaveAttemptMessage" style="margin:20px auto; font-size:16px;font-weight:bold; color:#f00; text-align:center; text-shadow:1px 2px 1px #222; clear:both">' + SaveAttemptMessage + '</div>');
- }
- tagpro.socket.on('chat', function(data) {
- if (data.from == null) { //system message
- if (data.message.indexOf('This is a save attempt!') >= 0) {
- addSaveAttemptMessage();
- //alert(SaveAttemptMessage); //uncomment if you want a popup to also appear (good for testing)
- }
- }
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment