Website TW-DB.info - English support

Bad Billy Jack

Well-Known Member
Looks like indy event breaks cloth calc. As soon as I got the patriot's short saber in a world, clothcalc would no longer update. Clothcalc still works, just won't update.

That's my best guess on what's happening
 

MFRavenhawk

Well-Known Member
Interesting responses, but I had the problem on Arizona even before the event started. Haven't had an issue yet on Houston, but I haven't collected the sabre yet, either.
 

drphil3

Active Member
i got the same deal on fairbanks, but at the site, the calculator doesn't work either, just says json error.
 

Harsha..

Well-Known Member
got the same issue as the others here. even though the script is really old, it's incredibly useful and would love it to work once again.
 

lebareslep

New Member
Clothcalc's server side, for some reason, really does not enjoy the Patriot's weapons, Pearl 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,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 + "' />";
Mind you, this does mean the script no longer takes these 9 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?
 
Last edited:

Junkz

Well-Known Member
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?

Thanks for the temporary solution :)
 

Theseventh

Member
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?
thanks for the solution, add pearly weapons to that list also..
 

Snr Sarg

Well-Known Member
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?
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
 

lebareslep

New Member
thanks for the solution, add pearly weapons to that list also..
Done

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
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.