Skip to content

Instantly share code, notes, and snippets.

@prail
Last active September 25, 2017 04:58
Show Gist options
  • Save prail/cd9f020978747fb45c9eb1fe4711b4e6 to your computer and use it in GitHub Desktop.
Save prail/cd9f020978747fb45c9eb1fe4711b4e6 to your computer and use it in GitHub Desktop.
Roblox Signature
// ==UserScript==
// @name Roblox Signature
// @namespace http://ateesdalejr.tk/
// @version 1.0
// @description Appends signature to my roblox forum posts.
// @author Andrew T.
// @match https://forum.roblox.com/Forum/*
// @grant none
// ==/UserScript==
function changeSiggy() {
var input=prompt("Please set a signature.");
if (input !== null) {
localStorage.setItem("SIGNATURE",input);
SIGNATURE=localStorage.getItem("SIGNATURE");
}
}
window.changeSiggy = changeSiggy;
(function() {
'use strict';
var SIGNATURE="";
if (!("SIGNATURE" in localStorage)) {
changeSiggy();
} else {
SIGNATURE=localStorage.getItem("SIGNATURE");
}
if (location.pathname == "/Forum/AddPost.aspx") {
var submitButton=document.getElementById("ctl00_cphRoblox_Createeditpost1_PostForm_PostButton");
var after=submitButton.onclick;
submitButton.onclick=function() {
document.getElementsByTagName("textarea")[0].value+="\n".repeat(8)+SIGNATURE;
eval(after);
};
} else if (location.pathname == "/Forum/Default.aspx") {
$("#forum-nav").append('<a class="menuTextLink" onclick="changeSiggy();">Change Signature</a>');
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment