You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Has Conquest Battle been working? Who created that code? Because I think it needs looking at. I hesitate to change it -- not knowing the assumptions the original developer made at the time (and these assumptions are not documented in the code as comments). Anyway...
I'm trying to use Conquest Battle and it is not working. The first thing that is not working is that the opponent list is not being refreshed. I have everything else turned off in CAAP so nothing else is changing the displayed page. So it appears that, when the CAAP timer to begin Conquest Battle expires, CAAP just looks at the same opponent list and, of course, doesn't find any opponents that meet the criteria for attacking.
So, I started looking at the code (with the intent of navigating away from the conquest battle page when no valid opponents are found) but I found something that (on the surface of things) looks hokey. There are two different arrays in the conquest.js page defined as follows:
conquest.targets = [];
targets = [];
The first one is defined like a global variable and the second one is defined like a local variable within the conquest.targeting() method. That part is fine, however, I find no reference anywhere that adds to the targets[] local array, yet, I see this code within the conquest.targeting() method:
targets.sort($u.sortBy(true, "score"));
for (it = 0, len = targets.length; it < len; it += 1) {
logOpponent(targets[it], 'sorted', '');
conquest.targets.push(targets[it].userId);
}
That, of course, isn't going to do anything because the targets[] local array is always empty. Thus, the global conquest.targets[] array isn't going to be sorted and I don't know if that is going to cause an issue.
Ideas?
Thanks,
Dave Clark (Vegan)
The text was updated successfully, but these errors were encountered:
It does work, the target variable is populated by targets that meet your criteria that you specify in the caap interface, you should change those to suit your character. Once you get your values correct and targets get poplated then they get sorted by their score and the IDs are pushed to caap.targets for other routines to use. Enable log level 2 in the caap interface to see the target filtering at work. The other point about caap not navigating away from the page and back again to refresh the page is correct however and this is something to yet be done, aswell as detecting when targets are dead. At the moment the refreshing relies on the fact that caap does other activities when a target meeting your specification was not found.
Has Conquest Battle been working? Who created that code? Because I think it needs looking at. I hesitate to change it -- not knowing the assumptions the original developer made at the time (and these assumptions are not documented in the code as comments). Anyway...
I'm trying to use Conquest Battle and it is not working. The first thing that is not working is that the opponent list is not being refreshed. I have everything else turned off in CAAP so nothing else is changing the displayed page. So it appears that, when the CAAP timer to begin Conquest Battle expires, CAAP just looks at the same opponent list and, of course, doesn't find any opponents that meet the criteria for attacking.
So, I started looking at the code (with the intent of navigating away from the conquest battle page when no valid opponents are found) but I found something that (on the surface of things) looks hokey. There are two different arrays in the conquest.js page defined as follows:
conquest.targets = [];
targets = [];
The first one is defined like a global variable and the second one is defined like a local variable within the conquest.targeting() method. That part is fine, however, I find no reference anywhere that adds to the targets[] local array, yet, I see this code within the conquest.targeting() method:
targets.sort($u.sortBy(true, "score"));
for (it = 0, len = targets.length; it < len; it += 1) {
logOpponent(targets[it], 'sorted', '');
conquest.targets.push(targets[it].userId);
}
That, of course, isn't going to do anything because the targets[] local array is always empty. Thus, the global conquest.targets[] array isn't going to be sorted and I don't know if that is going to cause an issue.
Ideas?
Thanks,
Dave Clark (Vegan)
The text was updated successfully, but these errors were encountered: