Tooth & Claw Facebook Ajax application help

Subscribe to Tooth & Claw Facebook Ajax application help 1 post, 1 voice

 
kevin koh User well i had written a script to improve my game play in this facebook game... and i have met a few problems... the game needs a facebook account and needs to be added at http://apps.facebook.com/toothandclaw and the game address is at http://tandc.friendsandfoesstudios.com/ so letme start with my script function... first, it removes the top ads(works) it displays both the 'clickmap' and the 'lookoutview' instead of switching its display between the two (does work, but after i do an action what would update the map, my lookoutview goes gone T.T) it changes the lookoutview radius to 11 thought the picture's address (cant figure it out, the address has dynamic variables, dont noe how to replace only one part in the 'src') it has an extra button that does the site's 'refreshen' function (my button does not appear!) okae this is actually my first javascript and my first greasemonkey script, i have some scripting knowledge in VBS(autoit) okaes heres my script : // ==UserScript== // @name Tooth And Claw Auto Refresh // @description Refreshes the page every 30 seconds // @include http://tandc.friendsandfoesstudios.com // ==/UserScript== var lookoutview, eventbuttonsx, fullrefresh, eventbuttons, adsx, ads; lookoutview = document.getElementById("lookoutview"); if (lookoutview) { lookoutview.setAttribute('style',"''"); } adsx = xpath("//*[@id='banner']"); if (adsx) { ads = adsx.snapshotItem(0); ads.parentNode.removeChild(ads); } eventbuttonsx = xpath("/html/body/div[2]/div/table/tbody/tr/td[4]/ div[4]/div[2]/a[3]"); if (eventbuttons) { fullrefresh = document.createElement('a'); fullrefresh.class = "''" fullrefresh.onclick = "fnf_working(true);; new Ajax.Request('/ freshen', {asynchronous:true, evalScripts:true, onComplete:function(request){fnf_working(false);}}); return false;" fullrefresh.href = "#" fullrefresh.innerText = "Page Refresh" eventbuttons = eventbuttonsx.snapshotItem(0); eventbuttons.parentNode.insertBefore(fullrefresh, eventbuttons.nextSibling); } function xpath(query) { return document.evaluate(query, document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null); } //592462 //element.translate(string1,string2,string3) //replace //"Page Refresh"; // err you can ignore the comments at the last part =D okae i havent not put in my code to do the change radius of lookoutview part... but there is already problems in the script.. i hope i could get help... and ya this is the source of the page(at one point it is dynamic) <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http:// www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html><head> <meta /> <title>Tooth&Claw: a Friends&Foes game</title><link href="/stylesheets/cache/bundle.css?1209723617" /></head><body>
Tooth & Claw requires Javascript to be enabled.
And your browser has it turned off,
or a netfilter has prevented our javascript from downloading.
<iframe src="http://apps.kitnmedia.com/superrewards/ banner_fbml.php?h=mjsqkki&fb_sig_user=598147885" height="58" width="646"></iframe>
<table width="100%"><tr><td class="top_icon">
Zombie
Loading
</td><td class="character">

KevinK

the zombie </td><td> Health: 10050/50 pts</td><td> Energy: 617/250 pts</td></tr></table>
<table class="blanktable" width="100%"><tr><td width="12">   </td><td width="270">
<table width="100%"><tr><td></td><td class="tdc"><image title="Switch map view" src="http://tandc.friendsandfoesstudios.com/images/ui/eye.png"></image></td><td>night<image title="9 pm" src="http:// tandc.friendsandfoesstudios.com/images/clock/clock07.png"></image>&lt;/td></tr></table>
<table class="place"><tr><td class="top"></td><td class="topright"></td></tr><tr><td class="middle"></td></tr><tr><td class="bottom"></td><td class="bottomright"></td></tr></table>
<table class="place"><tr><td class="top"></td><td class="topright"></td></tr><tr><td class="middle"><form class="simple"><input /><input /><button class="butstyle"></button></form></td></tr><tr><td class="bottom"></td><td class="bottomright"></td></tr></table>
<table class="place"><tr><td class="top"></td><td class="topright"></td></tr><tr><td class="middle"></td></tr><tr><td class="bottom"></td><td class="bottomright"></td></tr></table>
<table class="place"><tr><td class="top"></td><td class="topright"></td></tr><tr><td class="middle"><form class="simple"><input /><input /><button class="butstyle"></button></form></td></tr><tr><td class="bottom"></td><td class="bottomright"></td></tr></table>
<table class="place"><tr><td class="top"></td><td class="topright"></td></tr><tr><td class="middle"><form class="simple"><input /><input /><button class="butstyle"></button></form></td></tr><tr><td class="bottom"></td><td class="bottomright"></td></tr></table>
<table class="place"><tr><td class="top"></td><td class="topright"></td></tr><tr><td class="middle"></td></tr><tr><td class="bottom"></td><td class="bottomright"></td></tr></table>
<table class="place"><tr><td class="top"></td><td class="topright"></td></tr><tr><td class="middle"></td></tr><tr><td class="bottom"></td><td class="bottomright"></td></tr></table>
<table class="place"><tr><td class="top"></td><td class="topright"></td></tr><tr><td class="middle"></td></tr><tr><td class="bottom"></td><td class="bottomright"></td></tr></table>
<table class="place"><tr><td class="top"></td><td class="topright"></td></tr><tr><td class="middle"></td></tr><tr><td class="bottom"></td><td class="bottomright"></td></tr></table>
<image src="http://tandc.friendsandfoesstudios.com/graphics/overview? cck=596169&cai=8256&cx=15&cy=52&r=3&f=1&bgc=b8b8b8&sid=819d28b24247d71ed1e4e82de59740e0&ct=zombie&tx=1209724690"></image>
You are inside a mausoleum
<table class="blanktable"><tr><td width="65%"> 1500 52nd Ave S </td><td class="tdr">Zombie-starZombie-barricaded</td></tr></table>

This place is a zombie nexus.

Inventory: Full
<table width="100%"><tr><td class="graphic"><image src="http://tandc.friendsandfoesstudios.com/graphics/inv/ machete.png"></image></td><td class="words">Machete</td><td class="close"> </td></tr><tr><td class="fb_sm_note bottom">

Don’t hesitate, amputate!

</td></tr></table>
<table width="100%"><tr><td class="graphic"><image src="http://tandc.friendsandfoesstudios.com/graphics/inv/ trash_can_lid.png"></image></td><td class="words">Trash Can Lid</ span> </td><td class="close"> </td></tr><tr><td class="fb_sm_note bottom">

Protection from the real garbage

</td></tr></table>
<table width="100%"><tr><td class="graphic"><image src="http:// tandc.friendsandfoesstudios.com/graphics/inv/espresso.png"></image></td><td class="words">Latte</td><td class="close"> </td></tr><tr><td class="fb_sm_note bottom">

Food for troubled times

</td></tr><tr><td class="graphic">   </td><td class="actions">drink1ep</td></tr></table>
<table width="100%"><tr><td class="graphic"><image src="http:// tandc.friendsandfoesstudios.com/graphics/inv/espresso.png"></image></td><td class="words">Mocha</td><td class="close"> </td></tr><tr><td class="fb_sm_note bottom">

The quicker picker-upper

</td></tr><tr><td class="graphic">   </td><td class="actions">drink1ep</td></tr></table>
<table width="100%"><tr><td class="graphic"><image src="http:// tandc.friendsandfoesstudios.com/graphics/inv/silver_knife.png"></image></td><td class="words">Silver Knife</ span> </td><td class="close"> </td></tr><tr><td class="fb_sm_note bottom">

a.k.a. Long John

</td></tr></table>
Skills
Builder
<table class="blanktable"><tr><td class="tdc vtop">Builder
</td><td class="tdc vtop">Empty
</td><td class="tdc vtop">Empty
</td><td class="tdc vtop">Arrow_inactive</td><td class="tdc vtop">Empty_gray
</td></tr></table>
Earn skills by doing things.
Promotional
<table class="blanktable"><tr><td class="vtop">Funslots</td><td class="vtop"> Are your friends lucky? Are you? Find out with FunSlots, a slot machine game where multiple matches of friends' photos means big payouts. Increase your odds by inviting your friends to play; even better odds if they start playing Funslots too! </td></tr></table>
</td><td width="12">   </td><td width="340">
Actions
Your energy is very low, to get more you can:

1) Wait. You get 6 more every hour,
2) Invite new people at 10 ep per person,
3) Buy some at the
Store, or
4) Check out these Offers</ a>. *NEW*

Inside a mausoleum in Strange Cemetery <form class="action"><input /><input class="action fbfree" />
2ep
</form>

<form class="action"><input /><input class="action fbfree" /> barricade <input /> with your <select><option>hands</ option> <option>teeth</option><option>machete</option></option><option>silver knife</ option> </option></select>
1ep
</form>

You may move freely about this location.
<form class="action"><input /><input class="action fbfree" /><input class="text grey_speak" /></form>
Events
  • You will regnerate as long as you remain here.(21 minutes ago)
Stats
<table class="blanktable"><tr><td> Survived for 31 days </td><td class="tdc"> 0 infects </td><td class="tdr"> 0 enemy kills </td></tr></table>
<table class="blanktable"><tr><th class="fb_sm_header" width="40%"> Ownership <image title="Zombies 11%" src="http:// tandc.friendsandfoesstudios.com/graphics/maps/own59.gif?t=20162078">&lt;/image></th><th class="fb_sm_header"> Population
<image title="Zombies 28%" src="http:// tandc.friendsandfoesstudios.com/graphics/maps/pop59.gif?t=20162078">&lt;/image></th></tr><tr><td><image src="http://tandc.friendsandfoesstudios.com/ graphics/maps/animap.gif?t=1209724210"></image>
Status Report: Fri May 02 10:30:10 UTC 2008
Here
</td><td>
Personal
<table width="100%"><tr><th class="fb_sm_regular tdl"> Enemy Kills </th><td class="tdc"> -- </td></tr><tr><th class="fb_sm_regular tdl">Location Claims</th><td class="tdr">68</td></tr><tr><th class="fb_sm_regular tdl">Claims Destroyed</th><td class="tdr">--</td></tr><tr><th class="fb_sm_regular tdl">Barricades Destroyed</th><td class="tdr">15</td></tr></table></td></tr></table>
 
</td><td width="12">   </td></tr></table>
<table width="100%"><tr><td>Beta_mark</td><td> This software endorsed by werewolves everywhere.
© 2008 Friends&Foes Studios, LLC All rights reserved.
Friends&Foes and Tooth&Claw are trademarks of Friends&Foes Studios, LLC.
</td><td class="tdr"></td></tr></table>
</body></html> i hope i could get help with my first script =)