Ace of Spades Siggy

Automatically insert your badge list into your forum posts! (ALL CREDIT TO LIMEWIRE FOR THE CODE (Ty bae))

// ==UserScript==
// @name         Ace of Spades Siggy
// @namespace    http://fusionfalllegacy.com/
// @version      1.0
// @description  Automatically insert your badge list into your forum posts! (ALL CREDIT TO LIMEWIRE FOR THE CODE (Ty bae))
// @match        http://interact.modulatornetwork.com/FFL/index.php?action=post*
// @grant        none
// ==/UserScript==
 
var Siggy = "[center][url=http://interact.modulatornetwork.com/FFL/index.php?topic=3515.0][img]http://i.imgur.com/AvgQMeZ.png[/img][/url][/center]"
 
var isReady = false
var waitLoop
 
function mainFunction(button,editor){
        console.log(button.onclick)
        button.onclick = function(){
        editor.value = editor.value.replace("\n\n"+Siggy,"")+"\n\n"+Siggy
        }
}
 
function waitForButtons(){
        if(document.getElementsByClassName("button_submit").length==2&&document.getElementsByClassName("editor").length==1){
                isReady = true
                clearInterval(waitLoop)
                mainFunction(document.getElementsByClassName("button_submit")[0],document.getElementsByClassName("editor")[0])
        }
}
 
waitLoop = setInterval(waitForButtons,100)