GM fix for autoturning evil plushy items

Talk about the game. What game? The game with the power? What power? The power of ... aw, skip it.

Moderator: Moderators

Post Reply
Satan
Posts: 1855
Joined: Mon Nov 19, 2007 6:29 pm
Location: Florida
Contact:

GM fix for autoturning evil plushy items

Post by Satan »

Modified two functions to run on elephants. I don't know about compatibility with different versions, but these /should/ work if you just replace what's the there. If you want it to work for a plushy other than the elephants, replace 1428 with the item number of the plushy you want.

function stepToNextCombat() {
var searchy = find('.//td[contains(.,"Patrol again")]');
if (searchy != null) {
var linkk = find('.//a',searchy);
var strat = document.getElementById('Strat');
if(strat[strat.SelectedIndex])
GM_setValue('selectedStrat',strat[strat.SelectedIndex].value);
window.location = linkk;}
searchy = find('.//td[contains(.,"Back to inventory")]');
if (searchy != null)
{
GM_xmlhttpRequest({
method: "GET",
url: "http://www.twilightheroes.com/use.php",
headers: {"User-Agent": navigator.userAgent },
onload: function(r) {
var rsp = r.responseText;
var pat = /(use\.php\?which=1428&pwd=.{40,40})/; //replace 1428 with item number if not elephant
if (!r.responseXML)
r.responseXML = new DOMParser().parseFromString(rsp,"text/xml");
var cfv = pat(rsp);
window.location = cfv[1];}});
}
GM_setValue('roundNumber',-1);}

function endOfTurn() {
var searchy = find('.//td[contains(.,"Patrol again")]');
if (searchy != null) {
var linkk = find('.//a',searchy);
if (linkk != null) {
return true;}}
searchy = find('.//td[contains(.,"Back to inventory")]');
if(searchy != null)
{
return true;
}
return false;}
Leader of PFE league. If you wish to worship me, ask me about joining my secondary league Cult of Satan (the largest league in the game!).
Muhandes
Posts: 732
Joined: Mon Nov 03, 2008 12:54 am
Contact:

Re: GM fix for autoturning evil plushy items

Post by Muhandes »

Works for me. Well done!
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests