Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conquest Battle Not Working #71

Open
DaveLClarkI opened this issue Jan 26, 2013 · 1 comment
Open

Conquest Battle Not Working #71

DaveLClarkI opened this issue Jan 26, 2013 · 1 comment

Comments

@DaveLClarkI
Copy link

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)

@Xotic750
Copy link
Collaborator

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.

@ghost ghost assigned Xotic750 Jan 26, 2013
@Xotic750 Xotic750 reopened this Jan 26, 2013
@Xotic750 Xotic750 removed their assignment Feb 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants