Effective 2 December 2009, Zyenga made major changes to the format of Mafia Wars pages. As a result none of the applets or navigation page indexed here are functional. They are withdrawn.

Mafia War Tools

My experiences with waiting for FireFox 3.0 to load Mafia Wars pages inspired these bookmarklets. To install, drag bookmarklet name to the bookmark bar of you browser. To delete, open the Organize Bookmarks window of your browser.

Table of Contents

Quick Bank
Navigation Aid

QBA (Quick Bank)


QBA is a quick bank deposit applet. It deposits all cash on hand in the current city. The 10% laundering fee will be charged. It is heavily based on Vern's Free Bank (which no longer works as Zyenga has minimum deposit of $10). It works in New York, Cuba and Moscow.


Gansters from 30s
My intent was to provide a convenient way to view the members of my mafia. With all the data on a single page, techniques such as searching for a name or sorting could be used. This has been achieved using two programs:
My Mafia Gather (MMG) which executes in the My Mafia pages generated by Mafia Wars. It generates a result page which contains data for all members except Hired Guns.
My Mafia Sort (MMS) is loaded into the MMG output page. MMS can sort the rows by name or number. Some other functions are also provided.
At this time these programs only work with the FireFox browser.
Sample output


This is a revised version of MMGATHER which supports the MY Mafia format change which Zyenga introduced in early October 2009.


  1. Drag the MMG bookmarklet to your browser toolbar. (In Firefox the toolbar is below the line which gives the URL of the current window and above the line which names the tabs (assuming multiple tabs are open).
  2. Click on this link to load the first page of My Mafia"
  3. From the first page, invoke the MMG bookmarklet.
  4. [optional] Select appearance of Promote, Energy, Gift buttons. Text is recommended, None reduces the size of the resulting file.
  5. Push GO button and wait (process takes about (13 seconds per page).
  6. When the process starts a new window/tab with title "MMG work" is created. Do not close this window/tab as it will eventually hold output.
  7. After the last page has been processed, the results will appear in a tab with title "MMG output".
  8. Use Window menu or tab bar to make sure MMG Output is displayed.
  9. From File menu Save As.. (KB shortcut cmd-S or alt-S)
  10. Near the bottom of the "Save As" box is a pull-down menu labelled "Save As:". Select "text Files" from this pulldown.
  11. The file name must have an extension of “html” or “htm” so that result page will be recognized as HTML.
  12. After saving the file, you can view results by using Firefox File menu Open File to open the file which you just saved. You are done.

MMG Known Problems

1] To avoid problems with Firefox blocking of popup windows, the MMG Work window is created immediately after the GO button is invoked. If you wish to watch the progress of MMG, you have to manually return focus to the Mafia Wars tab in which MMG is running.
2] Facebook Language must be English.

MMSORT Features

Sort by name (Facebook or Mafia Wars)
Sort by number (level, fights etc)
Append new pages from MW
Save sorted result
Promote (to Top Mafia)
Energy (send maybe)

Screen Miscellaneous

Upper left corner gives version numbers for the MMG program which created the page and the MMS which was loaded with the page.
Row buttons affect the behavior of the Promote, Energy and Gift buttons. All three load a Zynga Mafia Wars page. This page either replaces the My Mafia page or loads into a new window.
Append button reveals controls for the update facility described below.
Make Copy creates a duplicate of the current window. The purpose is to allow a sorted version to be saved via View Page Source etc and copy into a text editor. (Steps 6] to 12] of MMGather instructions tell how to save this window.)
PEG buttons will be absent if none was chosen as the option in MMGather.
NOTE 23 Oct. Promote and Energy buttons are not currently working as a result of Zyenga's recent changes in parameter format.
Promote button for every member behaves like the MW version. Sorting by level before using this button is suggested.
Energy button always appears regardless of whether member needed energy when MMGather was executed. This differs from MW where the button only appears if the member needs an energy pack. If you attempt to give energy to someone who doesn’t need it, it won’t work but no harm will be done. You can examine the loaded page to see if an energy pack was given. Look for text: “You sent an energy pack to <MW Name>,” just below the “Home Jobs Fight row”.
Gift behaves exactly like the MW version.

Known Problems

1] Premature use of the Promote, Energy and Gift buttons. If you start the browser and then attempt to use one of these buttons without playing a little Mafia War, there is no established session. This will prevent proper loading of the MW pages via these buttons.
2] The sort buttons are not usable until page load is complete. A sort request during page loading results in a minor error message.

Update Procedure

For someone with a large and growing Mafia, the Update procedure may be faster than creating a new file from scratch. (MMGather takes about 15 seconds to process one MW page). The update procedure takes a partial file created by MMG and appends it to a pruned existing file. The pruning algorithm is to find the page numbers which occur in the partial file. Data in the old file from these page numbers is deleted from the merged file.
1] Determine the highest page number occurring in the old file (sort by page number may help).
2] Use an energy button to go to that MW page.
3] From this page invoke the MMG bookmarklet and push the GO button. Result will be a partial file containing data from this page and all successor pages. File name will be "MMS Output".
4] Follow steps 6] to 12] of the MMGather instructions to save the partial file and load it into a window or tab.
5] Load the original file into a tab/window and click on the Append button to reveal the update parameters.
6] Copy the complete file name (which starts with file:// ) of the partial file into the input box. This name appears above browser display of the partial file.
7] Push Return or Start Merge.
8] The result will usually appear in a new window which has the title of the existing file followed by “ merged”.
9] Follow steps 6] to 12] of the MMGather instructions to save the merged file.


MMGather takes about 13 seconds per page to create the original file. Some of this is due to the speed of the 700 Mhz eMac and my sloppy coding. There are also delays in loading pages from the Mafia Wars server plus a minimum two second delay between page capture and requesting the next page. Although substantial speedup might be possible by overlapping analysis of one page with loading of its successor, I am reluctant to attract the attention of Zyenga by overloading their server.
Result file size (assuming PEG buttons as text) is around 530 bytes per row. Selecting PEG option of "none" reduces this by 11%. Selecting PEG option of "icon" gives a 25% increase.
MMSORT Firefox takes about 6 seconds (3 seconds in Safari) to sort six hundred rows on the eMac. This time is a little sluggish and but improving it further looks difficult.


At this time (September 2009) MMGather has only been tested on Firefox 3.5.3. There are some medium-sized troubles and one major problem with Safari. The major problem with Safari is that there is no easy way to save the output. Safari does support the sort functions of MMSORT and is twice as fast as Firefox. It might be possible to make it work on Opera but I doubt it is worth the effort. Internet Explorer looks impossible.

Navigation Aid

NavBars is an HTML page which has links for most Mafia Wars pages. An item such as "Inventory" would have buttons labelled: Weapons, Armor, Vehicles, Loot, Collections, Gifting. "Jobs" would also be broken down this way. For some selections there would be a choice between New York and Cuba. The page can be found here.


KLONE is intended for use by bookmarklet authors rather than typical Mafia Wars players. The KLONE bookmarklet was written in anticipation of the reintroduction of the performance upgrade. One property of the upgrade is that page content is dynamically loaded rather than having one large page prepared by the server. Existing Mafia Wars pages contain lots of style sheets etc which are only relevant to one MF page. Eliminating the junk would speed page loading and rendering.


KLONE normally operates by inserting a small control panel at the top of the page. The bottom line of the panel contains a choice of output format (HTML vs text) and a GO button. HTML output is preferred but may not work if the page contains Javascript which is executed during rendering. HTML output will preserve the line breaks of the original HTML. Text output option will replace some of the original blanks with newlines. Firefox save text cmd will save the resulting text.

KLONE operates abnormally with a page which begins with a <frameset> rather than a <body>. If the control panel insertion fails, KLONE will attempt to create an output window in text mode. Firefox will reject this as an attempt to open a popup window. If you authorize popup windows from the page source, then KLONE will copy the source.

The source for KLONE is here.


webmaster AT

One applet which I would like to write is:

Full Heal in New York This would be useful when fighting in Cuba but would be usable in New York. Intent would be to optionally go to New York hospital for heal and then (if needed) return to Cuba.

Thanks to Vern for providing the model which enabled me to get started to this.


These credits are copied from Spockholm's
- Huge credits to Bobby Heartrate, many of these bookmarklets are based on snipplets of code that was first created by Bobby. Without his work many of these tools would not be as useful or even exist.
- Vern should also have credits, he has taken bookmarklets to a new level.