ISN2 wrote:sherkaner wrote:Hmm, as far as I know there haven't been any completed entries. I'm now trying to alter/simplify it a bit here: https://github.com/sherkaner/addons-for-Conquerclub
But you're free to either join me or start with that version of the script as the startpoint, and I'd advice you to look through the code first and then determine whether you still want to.
I have already standardized whole of the code, didn't start any editing yet, just standardized and formatted codes and it's now ready for my start, I will start from first but will be happy to hear any advises if you have, specially about that matrix variable, I didn't look at it fully but didn't figure it out too (Why some combinations of indexes of it's above array are defined in it but some aren't defined!?), just saw it when formatting ...
Ah, the medmatrix. I changed it into the following (and that seemed to work):
- Code: Select all
var medmatrix = []; // possible combinations of settings to get medals.
for (var i = 0; i < 6; i++) { // 6 types of settings that could lead to medals
for (var j = medmatrix.length - 1; j > -1; j--) {
var temp = medmatrix[j].slice(0);
temp.push(i);
medmatrix.push(temp);
}
medmatrix.push([i]);
}
medmatrix.sort(function(a,b) { // longest combinations should be shown first
return b.length - a.length;
});
So it's just really all possible combinations of settings that could get you to medals (medcombo and medcombourl seem related to the 6 settings btw). But I assume there is a better way that doesn't involve building the whole matrix though.
But I didn't put that in because I've made a breaking change somewhere else, now I've put it in the JSON branch (braking change: replaced eval/uneval with JSON.stringify and JSON.parse for storing/retrieving variables).






