Need to modify current script to do another thing :)
|
|
Hello, I am just starting to learn how to write in GS and would like some help in developing similar script to improve my Mafia Wars experience. I just want a simple script to replace 'Health' Title (element id _user_health) to a link heal (http://apps.facebook.com/inthemafia/remote/html...) my Java skill is almost none but have c++ experience. |
|
|
Ask and you shall receive (in this instance... feel special). |
|
|
wow :) I feel special :) thanks so much :) |
|
|
I have another suggestion for ya. I've always found it to be annoying that in order to see your mafia, you have to click "My Mafia", then you have to click the "My Mafia" tab in the "Recruit" screen. Why not just make the main "My Mafia" go to you mafia? Here's how. Add this to the bottom of (but inside) the "if(elementsFound)" check:
/* TRW: Added to replace the "My Mafia" link to go to the list instead of the recruit screen. */
var elMafia = document.getElementsByTagName('div');
var mafiaLink;
for(var t=0; t<elMafia.length; t++) {
mafiaLink = elMafia[t];
if(mafiaLink.className == "mafia_link") {
mafiaLink.className += " gm_checked";
/* Have to do the replace twice, once for the href, once for the onclick */
mafiaLink.innerHTML = mafiaLink.innerHTML.replace(/recruit/, 'group');
mafiaLink.innerHTML = mafiaLink.innerHTML.replace(/recruit/, 'group');
}
}
If you click on your mafia number, it will still take you to the recruit screen. |
|
|
Done, will upload now... |
|
|
Love the addition. It looks like it is more and more feature to it to the point it may need a little change in the title to "MafiaWars++" lol :) |
|
|
Excellent! Any thought to the "bug" I listed in the other discussion? |