FBMW++

By Pea Cracker Last update Feb 24, 2009 — Installed 39,028 times.

Fix for new Greasemonkey version

in
Subscribe to Fix for new Greasemonkey version 18 posts, 8 voices



newb5000 Scriptwright

I came up with a fix for the empty preferences dialog as well as the script basically not working at all with the latest Greasemonkey update.

All you need to do is (in Firefox) go to:
* Tools -> Greasemonkey -> Manage User Scripts
* Select FBMW++ from the list and hit the Edit button at the bottom
* If you have edited your scripts before, your editor of choice will open up, otherwise you need to select an editor (for example C:\Windows\notepad.exe).

Copy and paste the script in the next post, then save.
The script will work once again in the latest version of Greasemonkey.

Before I post the script, a few notes:

* I edited the script which is installed on MY machine (version 1.27j). I cannot remember whether I installed it from remarkable's page or from Pea Cracker's page. There shouldn't be a difference, but I am pointing this out just in case. I see that there is a third copy of the script on this site with some add-ons. I have not tried that third copy and hence do not know if you will lose functionality if you replace your script with the one I am posting.

* To the script developers, I changed the following:
- I made every function ending with _exec, _preferencesHandler and _preferencesInterface a member function of the top level 'this' object. So for example, the line:
function hitlist_preferencesInterface(prefs)
changes to
this.hitlist_preferencesInterface = function(prefs)
- I did the same for the functions 'jobs_dojob' and 'bank_deposit'
- The heart of the problem was that you cannot execute a function by saying this[functionName]() if the function is not declared as a member function. It has to do with the XPCNativeWrappers that Greasemonkey uses. See the following link: http://www.oreillynet.com/pub/a/network/2005/11...

* I do not know how to format my posts, so forgive me if the formatting is bad

* I'm posting the full script in the next post because I do not want to create yet another copy of the script on this site.

NOTE: Sorry guys, posting the script here doesn't work. I need to get the fix to one of the authors then. Any other ideas?

 
newb5000 Scriptwright

Ah I found a way - host it on Google :)

Here's the link:
http://docs.google.com/Doc?id=dtkvvwb_0cnq397d2

Copy and paste up until the last line, which is:
//GM_log('EOS.');

 
sm00th101 User
that didn't fix it for me. Having worse issues than I had before install. I did reset the database too to no avail. It's endlessly looping to check all my stats like I just leveled up (or reset the DB), and I got it to stop a couple times, but I don't know how. It started right back up again anyways when I clicked anything. However, the looping starts back up when I go to the MW home page. I also think we should not explain so much or give the MW devs props for their new war against us, since I have a feeling they are reading all these posts as much as we are.
The total number of people using this script is very tiny though, so it's a waste of time focusing on this group IMHO. We are mostly just automating the mundane tasks. I can get out a calculator and re-evaluate the best RoR for each building purchase OR I can use this script to tell me. and what's the difference whether I click "buy" or have it done? Before I used the hitlist bot, I just sat and clicked "hitlist" over and over again forever. Now I can do a few other things while I'm at it. The captcha's ensured that nobody could constantly refresh pages if they weren't around, so all this other shit is just pointless. What it really does is stops the regular players who don't constantly refresh the hitlist from collecting bounties at all. That makes it so you can't really just see the "hitlist" link turn blue and click it and try to get a bounty while you do other things. Instead, you have to actively commit time just to refreshing the hitlist, which isn't very fun, just work.

EDIT: This also happens when I revert back to the last official version of the script after resetting the database. Now I just want my old DB back :(
 
Skippy User

It wouldn't matter... They changed MobWars again, so all the scripts are broken.

 
sm00th101 User

but I could at least see the page w/ the script running without an endless loop running

 
Skippy User

No you wouldn't...

 
newb5000 Scriptwright

The link above has been updated with XeNoMoRpH's suggestion from here: http://userscripts.org/topics/22632
So the script works for me using the latest Greasemonkey version as well as the latest MobWars update.

Sorry sm00th101, no idea why you get the endless looping. I remember having the same problem a while back but closing the browser and reopening it fixed it at that stage. Maybe try the link again (I just updated it to include XeNoMoRpH's suggestion).

 
sm00th101 User
yeah, skippy I would. The script didn't work, but it just stayed on 'resting' until I reset the database. So I could leave it running and if the devs had changed anything back, I could see right away, if I hadn't reset the DB.
Anyways, yes, that latest suggestion seems to have made it magically work. good job, coding gods :)
 
davevg User

I have the loop running with the dynamic function names on a dev pc, but I'm still trying to iron out the issue of it always resting. So the preferences load and save, but not much more yet. Inside of Preferences.populate, basically evaling in the function name. I'll post my changes if I finish them before someone else does.

 
Skippy User

Ah, I see what you're saying sm00th101. I thought by "running", you meant the script would continue to function.

 
davevg User

Here is a version working on the new greasemonkey in my dev environment (I have not tested everything in it so YMMV). Fixes the function names, and permissions issues I came across while using GM_setValue. It also captures the hitlist captcha so you don't keep refreshing that page. :)

http://pastebin.com/m3390af63

 
ManySheeps User

This is working beautifully for me. I'll post a link to this one the other FBMW++ page too.

 
davevg User

One other small change if you are having problems with older versions of firefox

Find this:

var more = header.getElementByClassName('cStatVal');

Replace it with this
var more = Utils.getElementsByClassName('cStatVal', header);

Was the last changed needed to get it to work on Firefox 2.x on ubuntu. FF 3.x works fine with or without the change.

 
Grunt0311 User

Looks like the auto-heal/hospital may be broken again. at least it isn't working for me. anybody else having this problem?

Also not registering attack and defense stats, either:

"Attack strength: NaN, Defense strength: NaN"

 
davevg User

If you are using the new greasemonkey, it may be due to the security issues again. I wrapped all of the GM_setValue's, but I think we also need to do the GM_xmlhttpRequest's as well. Here is an old post explaining the change from the previous version.

http://wiki.greasespot.net/0.7.20080121.0_compa...

I probably won't be able to look into this this week, but that should give someone else enough information to possibly give us a fix.

 
fatphatboy88 User

im having the same problem as Grunt. The auto heal is not working. Which sucks because that is pretty much the main reason I even use a script, for the auto heal, then auto job, and auto buy.

 
Tim Smart Scriptwright

Yeah I have been looking at this too. I will try wrapping the xmlhttpRequest's and see that works out.

 
Tim Smart Scriptwright

OK got everything working with new Greasemonkey. Posted it here: http://userscripts.org/scripts/show/41733 . Supports new Hitlist captchas etc etc and has MWcaptcha integration to solve your captchas.

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