Twilight Forums

Idle chat for wannabe heroes
It is currently Tue Sep 30, 2014 1:00 pm

All times are UTC - 7 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Wed Dec 08, 2010 10:35 pm 
Offline

Joined: Mon Nov 19, 2007 6:29 pm
Posts: 1827
Location: Florida
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!).


Top
 Profile  
 
PostPosted: Fri Dec 10, 2010 3:16 am 
Offline

Joined: Mon Nov 03, 2008 12:54 am
Posts: 732
Works for me. Well done!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group