Mobwars Page Layout Changed
|
|
I found I was getting an error from the script after the devs changed the mobwars Jobs page to add the new job (they also added a typo to their code, but moving on). I traced it to the itemslist.updateData function, where I saw that the regular expression for getting the Experience and Energy for a job no longer worked. I opted for quick and dirty, 'cause I'm late for work; my solution: Replace Optimize away. |
|
|
J.M, I have also noticed the new jobs, properties and weapons available on the new page. I'm using Piotr release 12/23/08 script, and the script displays "resting" when its on the jobs page. Which version of this mod did you put in? I did search and replace the code you suggested but it's does not solve my problem. do you have any other suggestions? Thanks!! |
|
|
Kemm,
|
|
|
something weird is going on.. whenever I turn on the mobwars helper script, I see the browser contacting www.freecause.com for some info or something, and it's extremely slow to load the page. when I turn the Greasemonkey off and refresh the page, it doesn't contact www.freecause.com at all, and the page loads faster.. am I being hijacked? |
|
|
Kemm,
|
|
|
@kemm: have you got installed the mobwars toolbar? i think, that she is contacting freecause.com my helper script is also resting in jobs page. if my new job "Shipping Docks Raid" causes the problem? On other pages, helper says "Doing Shipping Docks Raid". But when it changes to jobs page, it change to "resting". |
|
|
What's happening to Kemm is happening to me also...no idea why it's contacting that page. |
|
|
The mob wars toolbar is from freecause.com. Occasionally some images from there are pulled to the page for sponsors / toolbar advertisement, but greasemonkey wont be contacting that site unless you have a script that specifically does it (like the one I posted to get the godfather posts). @VoiceX: Check your error console to see if anything useful is posted there from the script when you are on the jobs page. |
|
|
@Druid: where 2 find the error console? |
|
|
In firefox go to Tools -> Error Console Or hit ctrl+shift+J |
|
|
Ok, so I note the layout changed again. I can't tell what the major differences are yet, but for now, it looks like the mob size moved to a parenthetical on top of the Mob button on the nav. So I did the following in the I replaced:
with:
As always, this is brittle as hell and could stand some refactoring. |
|
|
And yet another change to jobs & stockpiles. I've got my jobs working again using the following replacement to the item ID regex in
replaced with:
I've noticed that the weapon/power_item/vehicle and pawn shop are new stockpile areas. I'll see if I can figure something out there, but in the meantime, that fixed my auto-jobs functionality. |
|
|
@J. M. Coward, You will also need to update the Itemlist.prototype.updateData function since the different items are split to separate pages. Personally, I changed the beginning of that function to be like this:
Itemlist.prototype.updateData = function() {
var pages = ['stockpile', 'jobs', 'city'];
if (pages.indexOf(Page.c_page) != -1) {
var pageStocktype;
if (Page.c_page == 'stockpile'){
if (document.location.href.indexOf("show_type=") > -1)
pageStocktype = document.location.href.substring(document.location.href.indexOf("show_type=") + 10)
else if (document.location.href.indexOf("pawn_shop") == -1)
pageStocktype = "weapon";
if (document.location.href.indexOf("power_item") > -1) pageStocktype = "weapon";
}
for (var item in this) {
if (this[item].type != Page.c_page) continue;
if (this[item].stocktype != pageStocktype) continue;
delete this[item];
}
var header = document.getElementById('app8743457343_content');
var divs = Utils.getElementsByXPath('.//a[contains(@name,"item")]',header);
for (var i = 0; i < divs.length; i++) {
var div = divs[i].parentNode.parentNode;
var item_id = divs[i].name;
var item;
switch(Page.c_page) {
case 'stockpile':
item = new Stockitem();
item.stocktype = pageStocktype;
break;
|
|
|
That's a good start. I'm finding that my upkeep value is incorrect, however, so I'm tracing through using upkeep to see why it isn't being calculated correctly. |
|
|
maybe try using this in function inventory_exec instead of calculating upkeep per owned item:
if (document.getElementsByClassName("upkeep").length > 0)
boss.total_upkeep = document.getElementsByClassName("upkeep")[0].innerHTML.match(/[\d,]+/)[0].replace(/,/g, "");
|
|
|
looks good. how do i apply, what do i replace? u guys rule |
|
|
J.M. COWARD i undertsnad your directions, im applying the fix now. ill let ya know how it works for me. is this fix for fbmw* or fbmw++? |
|
|
japes, you're not going to like the answer to that. I've been clinging to the original script, old schooler that I am. I've glanced at the new stuff in both those scripts, but since I prefer to handle fighting myself, and I agreed with Piotr's original insistence in not having an auto-hitlister, I've been updating his script since October. I've added some tweaks of my own (I occasionally sell undeveloped land, so I want the max number of properties I can sell in the sell box to be 10 instead of 1, &c.). Thus, I'm unfamiliar with specifics of how those scripts work. I *am* considering a switch to take advantage of the up-to-date Greasemonkey features. I ported my modified version of Piotr's script to a largely incompatible FB app, so I'll have to make sure that I can port either the ++ or the * script before making the switch final. |
|
|
New jobs weren't showing up for me in the preferences screen (I just unlocked a new job by reaching a new level). I had to replace the following:
/* Drops */
tmp = div.innerHTML.match(/(\d+\%)/);
with this:
/* Drops */
tmp = div.innerHTML.match(/(\(\d+\%\))/);
|