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>
<table class="blanktable"><tr><td class="vtop"></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>