f += '<input style="display:none" type="text" name="items" value=\'' + JSON.stringify(t).replace(/'/g, "\\'") + "' />";
var itemsJson = JSON.stringify(t).replace(/'/g, "\\'");
var naughtyItemIds = [51530000,51531000,51532000,51539000,51540000,51541000,51550000,51551000,51552000];
for(var j = 0; j < naughtyItemIds.length; j++) {
itemsJson = itemsJson.replace(',"' + naughtyItemIds[j] + '"', '');
}
f += '<input style="display:none" type="text" name="items" value=\'' + itemsJson + "' />";
Clothcalc's server side, for some reason, really does not enjoy the Patriot's weapons or the three American Army weapons. You can "patch" it by, around line 7850 (if editing in Greasemonkey), changing:
Code:f += '<input style="display:none" type="text" name="items" value=\'' + JSON.stringify(t).replace(/'/g, "\\'") + "' />";
into
Code:var itemsJson = JSON.stringify(t).replace(/'/g, "\\'"); var naughtyItemIds = [51530000,51531000,51532000,51550000,51551000,51552000]; for(var j = 0; j < naughtyItemIds.length; j++) { itemsJson = itemsJson.replace(',"' + naughtyItemIds[j] + '"', ''); } f += '<input style="display:none" type="text" name="items" value=\'' + itemsJson + "' />";
Mind you, this does mean the script no longer takes these 6 items into consideration.
I'm really wondering what's happening on the server side though. What spell did Innogames put on these items that make poor Clothcalc go haywire?
Clothcalc's server side, for some reason, really does not enjoy the Patriot's weapons or the three American Army weapons. You can "patch" it by, around line 7850 (if editing in Greasemonkey), changing:
Code:f += '<input style="display:none" type="text" name="items" value=\'' + JSON.stringify(t).replace(/'/g, "\\'") + "' />";
into
Code:var itemsJson = JSON.stringify(t).replace(/'/g, "\\'"); var naughtyItemIds = [51530000,51531000,51532000,51550000,51551000,51552000]; for(var j = 0; j < naughtyItemIds.length; j++) { itemsJson = itemsJson.replace(',"' + naughtyItemIds[j] + '"', ''); } f += '<input style="display:none" type="text" name="items" value=\'' + itemsJson + "' />";
Mind you, this does mean the script no longer takes these 6 items into consideration.
I'm really wondering what's happening on the server side though. What spell did Innogames put on these items that make poor Clothcalc go haywire?
Clothcalc's server side, for some reason, really does not enjoy the Patriot's weapons or the three American Army weapons. You can "patch" it by, around line 7850 (if editing in Greasemonkey), changing:
Code:f += '<input style="display:none" type="text" name="items" value=\'' + JSON.stringify(t).replace(/'/g, "\\'") + "' />";
into
Code:var itemsJson = JSON.stringify(t).replace(/'/g, "\\'"); var naughtyItemIds = [51530000,51531000,51532000,51550000,51551000,51552000]; for(var j = 0; j < naughtyItemIds.length; j++) { itemsJson = itemsJson.replace(',"' + naughtyItemIds[j] + '"', ''); } f += '<input style="display:none" type="text" name="items" value=\'' + itemsJson + "' />";
Mind you, this does mean the script no longer takes these 6 items into consideration.
I'm really wondering what's happening on the server side though. What spell did Innogames put on these items that make poor Clothcalc go haywire?
Donethanks for the solution, add pearly weapons to that list also..
If you just copy the entire contents of the script into some text editor, you can ctrl+f to find the line to be replaced. And then just paste the new code in there. Indentation and newlines are optional in JavaScript. Alternatively, you can copy the script's contents and use some kind of JavaScript prettifier to make it readable before editing it. Eventually you'll just have to paste back the script into Greasemonkey and hit ctrl+s to save it.Any chance of a dummy's guide how to install this change, I had a look but could only see lines 1-16 and could not find the line that needs replacing
There is no reason to be hesitant to change the code. The worst thing you can do (assuming a modicum of common sense - I can't help you if you throw your pc off your desk) is make the script non-functional. In which case you can remove it and reinstall it, which takes a few clicks.I guess I'll just have to live without. I am not comfortable with changing the script, as the code confuses Maybe the server end will get updated at some point.
I do admire you guys who can 'patch and work around'