Last active
July 22, 2018 21:31
-
-
Save Tro95/0507f456ab8a4ea3e8639fc5da17097e to your computer and use it in GitHub Desktop.
pardus_necrophobia.user.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Pardus Necrophobia | |
// @version 2.0 | |
// @namespace marnick.leau@skynet.be | |
// @description Takes you straight back to the Nav after killing an NPC. | |
// @icon http://www.majhost.com/gallery/Faziri/Pardus/Scripts/icon.png | |
// @include http*://*.pardus.at/ship2opponent_combat.php* | |
// @include http*://*.pardus.at/options.php | |
// @downloadURL https://gist.github.com/Tro95/0507f456ab8a4ea3e8639fc5da17097e/raw/pardus_necrophobia.user.js | |
// @updateURL https://gist.github.com/Tro95/0507f456ab8a4ea3e8639fc5da17097e/raw/pardus_necrophobia.user.js | |
// @grant none | |
// ==/UserScript== | |
// <!-- User variables --> | |
var timeout = 0; // number of ms to wait before going back to the Nav screen | |
// <!-- End of user variables --> | |
try { | |
if (location.href.indexOf("/options.php") !== -1) { | |
return; | |
} | |
if (location.href.indexOf("/ship2opponent_combat.php") !== -1) { | |
var pics = document.getElementsByTagName('img'); | |
for (var i = 0;i < pics.length;i++) { | |
if (pics[i].getAttribute('src').match("/opponents/")) { | |
var table = pics[i].parentNode; | |
} | |
} | |
if (table.innerHTML.indexOf("D E A D") !== -1) { | |
setTimeout(function() { | |
location.href = "https://" + location.hostname + "/main.php"; | |
},timeout); | |
} | |
} | |
} catch(scripterror) { | |
console.log(scripterror); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment