Skip to content

Instantly share code, notes, and snippets.

@jh34ghu43gu
Last active March 7, 2024 13:30
Show Gist options
  • Save jh34ghu43gu/d2e8cf7aa0b55d0ded8efe5bf3b1a875 to your computer and use it in GitHub Desktop.
Save jh34ghu43gu/d2e8cf7aa0b55d0ded8efe5bf3b1a875 to your computer and use it in GitHub Desktop.
quick wiki script for crate->case
// ==UserScript==
// @name Change crates to cases on tfwiki
// @namespace http://tampermonkey.net/
// @version 2024-01-01
// @description try to take over the world!
// @author You
// @match https://wiki.teamfortress.com/w/index.php?title=*&action=edit
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant none
// ==/UserScript==
var textbox = document.getElementById("wpTextbox1");
//var editbox = document.getElementById("wpSummary");
if(textbox.innerHTML.includes("{{avail|crate")) {
textbox.innerHTML = textbox.innerHTML.replace("{{avail|crate", "{{avail|case");
//editbox.innerHTML = "crate -> case";
document.getElementById("wpMinoredit").checked = true;
} else {
window.alert("Already links to case");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment