Facebook MobWars Helper

By Piotr P. Karwasz Last update Dec 23, 2008 — Installed 91,830 times.

Script mods from TheDruidsKeeper

in
Subscribe to Script mods from TheDruidsKeeper 141 posts, 44 voices



dudulz User

How about to refresh the page after doing a job? In the actual site layout, after doing job the page stays with the result and the Script Status stays at "Doing <job>... in 0s"</job>

 
Twangy User

I`m really struggling since the latest changes to Mob Wars. The script only seems to work with a bit of prompting (changing pages) and the property buyer has been switched off as it keeps withdrawing money from the bank then putting it back in, then out, then in, its like the Mob Wars Hokey Cokey!

Is anyone else experiencing the same problems? Another one is that Mean bank Loss, Upkeep and Total are all red and minus!

I did try reinstalling the older Firefox but thats not cured anything!

HELP !!!!!!!!

 
TheDruidsKeeper Scriptwright

OK, i modified the timer on the script so that it will refresh the page and keep going after property purchases / job actions.

@Twangy I'm not sure what is causing the "Hokey Cokey", but I would recommend either turning of auto deposit, or turn off "using money from bank".

Also, since I've been experiencing a huge lack of time, I haven't had the chance to update the auto city buy mod yet for the new property categories. Anyone can feel free to get it working with them and post the changes so I can put them into the script though. :)

 
Twangy User

Cheers Druid, you`re a star! I`ll play around with the settings on the auto buy, it is probably just something I`m doing wrong!

 
TheDruidsKeeper Scriptwright

I disabled the extra row of links since I realized that the original links are back to normal.

 
SoulKeeper User

Is it just me or the Quickheal is not working anymore?

 
J. M. Coward User

@TheDruidsKeeper, what did you change to get the timer to work?

 
SoulKeeper User

Just a heads up to those who use the search script!!!

Is not working anymore, they know when you do it. You will loose any searches left for the rest of the day.

 
TheDruidsKeeper Scriptwright

@J.M.
To get the timer to work I basically cheated: in the timer function that the entire script uses (look for Timer.start = function... when the timer is up it checks if the action is an object, if so it 'clicks' it: next_page.click();. That is where the problem was occurring with the Ajax implementations (since the page would no longer refresh), so I added this line: setTimeout(Timer.start, 5000, window.location.href, message, timer); to manually refresh the page after 5 seconds in case it hasn't already happened.

@SoulKeeper
The search script I wrote on page 3 (http://userscripts.org/topics/18417?page=3#post...) looks like it still works just fine for me, but just in case I will increase the time between searches from 0 - 60 seconds to 30 - 90 seconds to see if that has better success. Let me know if this works or if a bigger range is needed.

I haven't gotten around to fixing the quick heal yet, but you're right it is broken. I'm sure it is just some xpaths that are messed up from the changes, it's just a difficult mod to fix since it is all done via ajax.

As another note of good news, the original author of the script has sent me message as a request for me to simply send him the updates to the script and he will update the core. So I will start doing that once I stop being lazy and get around to fixing the city auto buy and the quick heal.

 
program3rror User

Is anybody having a problem loading the Druid's script after activating the FB username feature?

While I'm here, wicked script, thanks for all the hard work Druid....

 
Piotr P. Kar... Script's Author
FirefoxX11

<quote>As another note of good news, the original author of the script has sent me message as a request for me to simply send him the updates to the script and he will update the core. So I will start doing that once I stop being lazy and get around to fixing the city auto buy and the quick heal.</quote>

Haven't received anything from TheDruidsKeeper yet, but maybe I can find some time to update the script.

 
Kevinharbin User
FirefoxWindows

[quote]Is anybody having a problem loading the Druid's script after activating the FB username feature?[/quote]

YES! That's exactly when it stopped loading. I haven't found a solution to it either.

 
dudulz User
FirefoxWindows

Does anyone still using this script or made changes so it would work halfway?

 
J. M. Coward User
FirefoxWindows

Mine is *barely* working. It can do NYC jobs, and that's about it. I'm hoping to take some time to update to that January greasemonkey release, as Firefox 3.5 is out now, and I'd like to use it.

 
nicegirl99 User
FirefoxWindows

Mine does the hitlisting pretty well and only recently stopped doing the autopurchases because it can't see the cash anymore. It doesn't seem to see the energy either so it has stopped doing jobs.

 
J. M. Coward User
FirefoxWindows

There used to be a switch/case section that would let the script get the hero stats (money, health, energy, &c.); I commented out most of it and replaced it with the following:

/* Other data */
  /* Cash */
  var cash_span = document.getElementById('app8743457343_cur_cash');
  var re = /\$([0-9]+)/;
  var result = cash_span.innerHTML.replace(",","","gi").match(re);
  this.cash = parseInt(result[1]);
  /* Health */
  var health_span = document.getElementById('app8743457343_cur_health');
  this.health = parseInt(health_span.innerHTML);
  var max_health_str = health_span.parentNode.innerHTML;
  max_health_str = stringCleaner(max_health_str);
  re = /\/([0-9]+)/;
  result = max_health_str.match(re);
  this.max_health = parseInt(result[1]);
  /* Energy */
  var energy_span = document.getElementById('app8743457343_cur_energy');
  this.energy = parseInt(energy_span.innerHTML);
  var max_energy_str = energy_span.parentNode.innerHTML;
  max_energy_str = stringCleaner(max_energy_str);
  result = max_energy_str.match(re);
  this.max_energy = parseInt(result[1]);
  /* Stamina */
  var stamina_span = document.getElementById('app8743457343_cur_recovery');
  this.stamina = parseInt(stamina_span.innerHTML);
  var max_stamina_str = stamina_span.parentNode.innerHTML;
  max_stamina_str = stringCleaner(max_stamina_str);
  result = max_stamina_str.match(re);
  this.max_stamina = parseInt(result[1]);
  /* Experience */
  var exp_div = document.getElementById('app8743457343_cur_experience');
  var exp_str = exp_div.innerHTML;
  exp_str = stringCleaner(exp_str);
  re = /Exp: ([0-9]+)\/?([0-9]+)?/;
  result = exp_str.match(re);
  this.exp = parseInt(result[1]);
  /* Level */
  re = /Level: ([0-9]+)/;
  result = exp_str.match(re);
  if (this.level != parseInt(result[1])) this.new_level = 1;
  this.level = parseInt(result[1]);

It's not at all optimized; it's a quick hack I threw together to make sure I could still do NYC jobs.
It references a stringCleaner function that cleans up the HTML for regex parsing:
function stringCleaner(str) {
  str = str.replace(/<[^>]*>/g, '');
  str = str.replace(/[, \t]/g,'');
  str = str.replace(/\r|\n|\r\n/g, '');
  str = str.replace("&nbsp;", " ", "gi");
  return str;
}