Facebook Mafia Wars Exp Remaining

By ThatOneGuy Last update Apr 24, 2010 — Installed 57,542 times.

Bugs

in
Subscribe to Bugs 26 posts, 10 voices



ThatOneGuy Script's Author

Ok guys, I think I worked out all the bugs... please let me know if you find anything.

 
ecoWorrier User

Nice One Centurion!

A true example of KISS (Keep It Simple Stupid)

Great little script - well chuffed - thanks.

EW

 
Lamja User

very nice script gj dude

 
ThatOneGuy Script's Author

Thanks guys.

 
smileyz User

I'm using this script and feel like I needed to say thank you as well. Its a great little script!

Thanks!

 
Tim Wilson Scriptwright

I don't know if you would consider this a "bug", but the link you use to do the heal does not have all of the parameters passed on the URL, and it does it as a link instead of the AJAX method Zynga uses. Here's the code to do it.

Add this section of code after looking for "_user_max_health":

	  /* TRW: Added to do heal via AJAX, using the code Zynga built into the "Hospital" link. */
	  if( elExp[h].className == 'heal_link' ) {
		var hospitalLink = elExp[h].getElementsByTagName('a')[0];
		var healthHref = hospitalLink.getAttribute("href").replace(/view/, 'heal');
		/* Replace "view" with "heal" to do the actual healing.
		var healthOnClick = hospitalLink.getAttribute("onclick").replace(/view/, 'heal');
		healthHTML = '<a href="' + healthHref + '" onclick="' + healthOnClick + '">' + userHealth + '</a>';
	  }

In the if() for elementsFound, add this:
	  if( healthHTML == null ) {
		healthHTML = "<a href=\"http://apps.facebook.com/inthemafia/remote/html_server.php?xw_controller=hospital&xw_action=heal\">" + userHealth + "</a>";
	  }

Then where you set userHealthElement.innerHTML, just set it to the healthHTML variable set above.

I also have a suggestion that I've coded. I'm putting that in the other discussion.

 
elektroda User

Nice work with script..very handy :)Thanks

 
ThatOneGuy Script's Author

Thanks for all the praise.

Tim, that is more a design "feature" than a bug. The health button is a link that doesn't use AJAX because I prefer to middle click it, which will load it in a new tab and I can continue attacking/robbing or whatever I was doing because the original tab has not changed screens. It's the same thing for the skill advancement.

If I'm the only one that likes this I suppose I can change the script (and figure out how to do the options on GM).

 
Tim Wilson Scriptwright

ThatOneGuy: Agreed, it isn't completely a bug. However, the middle-click will still work for you. Middle-click uses the link in the "href" attribute. But left-click uses the "onclick" attribute. The other thing is there are other parameters on the URL that get passed back to Facebook. I don't know what they do, I just thought they should be there. It doesn't much matter, I can always modify the script and add it back in.

 
ThatOneGuy Script's Author

Tim,

Done. Also changed all other links to use the AJAX as well.

-T1G

 
Tim Wilson Scriptwright

Nice script! Thanks for taking my suggestions.

 
Viiper User

Found a bug...

Posting a notification breaks the script...

e.g. Script breaks on posting wishlist, Job request help etc.

P.S. - Everything else is fine and looking great. Thanks for the script :)

 
ThatOneGuy Script's Author

Ok, those sound like they may be in the same realm as the changing city bug that I've already noticed...

I will make sure to test those when I think I have that bug fixed.

Thanks for letting me know.
-T1G

 
sbacc User

Hi there
Is anyone using this script in Google Chrome? I got it to work or partly and was wondering if anyone had tried this. The points and ratio to the next level work and the profile points area but not the job ratio.
Any help would be great
Thanks

 
Tim Wilson Scriptwright

Anyone using Firefox 2? I'm having problems with the app. The heal link works, and the experience remaining works, but the property rate doesn't, and my suggestion for the "My Mafia" link doesn't work. Anyone else using Firefox 2?

 
ThatOneGuy Script's Author

It looks like the "My Mafia" link is broken with Mafia Wars Cuba update as well...

 
ThatOneGuy Script's Author
FirefoxWindows

Ok, I've fixed the Cuba bugs, please let me know if you have any other problems :)

(I have not gotten the chance to test the notification bug, but will know tomorrow night if that breaks it or not)

 
DeanLa User
FirefoxWindows

Great script.
One bug:
I can't seem to enter fights with the script on.

 
bappybd User
FirefoxWindows

Yah me too..........I can't enter fight page..........every time I enter Fight page its says loading mafia....then freezes there!!

 
ThatOneGuy Script's Author
FirefoxWindows

Yeah, for whatever reason they set the fight link to be handled differently. I'm not sure why anything I was doing was interfering with it but I fixed it by modifying the fight link back to the working the same as everything else in the game so that it at least works for now.

Also, let me know what you guys think of the visual changes.

 
bappybd User
FirefoxWindows

cool...........fight page is working.........new visual changes are also good

Is there any way of autometically go back to fight page after healing??.......where should i have to change the javascript??

 
bappybd User
FirefoxWindows

Sorry for double post.....

I have also one request......Can you change the Inventory links to shortcut for Weapons, Valut and Gifting links like you did in profile/state increase link??

thnks in advance!!

 
ThatOneGuy Script's Author
FirefoxWindows

In response to your first post... if you click on your current health (when it's not 100% it should be a link) then you will heal without leaving the page you are on.

In response to the next one... I might, busy schedule for a while to come though so not sure when the urge will hit me to work on this script more though... keep an eye out for updates :)

 
ThatOneGuy Script's Author
FirefoxWindows

Ok, the Inventory link has now been changed as requested. To be honest I wish I had done it sooner! I've been using t for a day now and am already hooked.

Also, just wanted to mention: I have friends that are having problems with the fight link when they are using IE or Firefox without any scrips so I'm not sure why, but it definitely seems they have a bug in MafiaWars, but my script continues to fix it :)

 
bappybd User
FirefoxWindows

Many many thnks for the inventory quick links!!

Cross
Presentational HTML allowed.
Use <code> for inline code and <pre> for code blocks. Use &lt; and &gt; for literal < and >.
We help break paragraphs and link your links.
or cancel