Welcome
Welcome to the Castle Age AutoPlayer forums

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. In addition, registered members also see less advertisements. Registration is fast, simple, and absolutely free, so please, join our community today!

Code ideas

Discussion and information regarding the current Community Build

Code ideas

Postby Artifice » 01 Jan 2014, 01:13

Hello!

I've been away for a while and am starting to play CA again. In particular, I want to get Guild and Festival battle up and running. Here's my current to-do list on the code:

Work over the Monsters code -- it's doing some things I don't understand, like strengthening when I have Fortify when under set to zero, and flipping between screens when doing monsters review, and frequently forgetting my monster list to review them all again.

Add Loadouts code -- picking generals isn't enough now that equipment matters. I want to add code to the Generals section that allows you to add specific loadouts for specific tasks, just like picking a general.

Build Guild/Festival Battle Dashboard -- first step is to add a code that provides an overview of all Towers in a guild battle, and records your win/loss against those targets for history, so you know who to hit and who to avoid.

Automate Guild/Festival Battles -- once the above are done, ultimate goal is to allow full automation of guild battles. This is a big task, and will require thinking about strategy templates -- go for Guild Coin, work on guild achievements, class strategies, etc.

Thoughts, comments?

My thanks to all who have improved CAAP and kept it up to date with all the FB/CA changes!

Artifice has been thanked by:
Artifice
Site Admin
Site Admin
 
Posts: 267
Joined: 23 Nov 2013, 07:47
Has thanked: 40 time
Have thanks: 191 time

 

Re: Code ideas

Postby yinzanat » 02 Jan 2014, 18:11

These are things I've been thinking about doing for well over a year (for some at least), just haven't had any time, seems life takes away playtime.

Other things I've thought about:
Optimizing dark rage (I simulate it now by setting the monster to attack at X stamina (just about max) until the rage bar is full, then I hit the guy 5x activate rage and set stamina to available, until rage is over and repeat). This would have to deal with mist monsters special because the rage bar is only visible when you attack.

Change to cleric when the mist land you're defending is about to leave protection. This might be better to reverse to change to guild battle class and idle at cleric, then earth lands will have a greater chance to be cleric. Also using defensive spells for mist defense, would have to work with conquest attack because they take from the same token pool.

Festival Duels.

I'll do what I can to help, but my time is limited.

yinzanat has been thanked by:
yinzanat
Moderator
Moderator
 
Posts: 578
Joined: 14 Jun 2011, 22:48
Has thanked: 4 time
Have thanks: 226 time
Highscores: 1

Re: Code ideas

Postby Artifice » 25 Jan 2014, 12:32

Yinzanat, as you'll see in my other post, I've completed the Loadouts code. Once I figure out how to sync my changes back into the Community Build, it will be available as an automatic update.

I've also added a timer feature to the loadouts, so you can set a time when certain loadouts will automatically be loaded. I use this to load my PreGB Loadout before every Festival battle. It also enables you to turn off general changes during certain times of the day, for instance if you're away from your CAAP computer, but still want to do a guild battle or change generals for some other purpose.

It's still manual at this time, but if you wanted to use CAAP to set your Cleric build for when a LoM goes into defend, that works now by manually setting the times for the Loadouts.

Now working on enabling CAAP to automatically start up Guild Battles on a fixed schedule. After that will be Guild Battles Dashboard and then hopefully an autoplayer for guild battles and festival battles.

Artifice has been thanked by:
Artifice
Site Admin
Site Admin
 
Posts: 267
Joined: 23 Nov 2013, 07:47
Has thanked: 40 time
Have thanks: 191 time

Re: Code ideas

Postby LordBandit » 25 Jan 2014, 14:36

I just got d213 and see the default loadouts box under generals and also noticed that the check generals timer function is gone (which is great as far as I'm concerned). Are those the only changes in this release?

Since you are looking at code ideas can you split the Action Order into 2 parts and have those pesky things like bless cassie and collect wood and check keep and item archives and many many more only done during either a time window we set or a normal idle period like when we are in bed...LOL It seems like everytime I go to do something manually in CA that caap picks that moment to check coins, check keep or check generals...really really annoying.
LordBandit
Moderator
Moderator
 
Posts: 652
Joined: 21 Jun 2011, 20:30
Has thanked: 109 time
Have thanks: 52 time

Re: Code ideas

Postby yinzanat » 26 Jan 2014, 03:20

Loadouts, nice! Gotta dig into this one.

yinzanat has been thanked by:
yinzanat
Moderator
Moderator
 
Posts: 578
Joined: 14 Jun 2011, 22:48
Has thanked: 4 time
Have thanks: 226 time
Highscores: 1

Re: Code ideas

Postby LordBandit » 26 Jan 2014, 03:25

Found some problems with this loadout code...questing is broke...sometimes. If you have quests set to 'at x energy' and it reaches that amount and caap goes to 'max energy quest' it will cycle between the idle general and the default loadout general constantly and never do any quests. I didn't have time to pull an error log for those that I saw it happening on, but turning off the equipped scan and setting the subquest to the same as the default loadout it worked about 50% of the time...the others I had to manually run the quests down to under the min amount set in the 'at x energy' before it would change gears and go on.

The other problem was with the general stats scan - it would start the scan and select a general and then cycle between that general and all 20 of the loadout slots...back and forth 20 times for each general...had to turn that off just because of that. Not sure what that scan does or what it actually affects but it took an hour and a half to do my account with 110 generals....

LordBandit has been thanked by:
LordBandit
Moderator
Moderator
 
Posts: 652
Joined: 21 Jun 2011, 20:30
Has thanked: 109 time
Have thanks: 52 time

Re: Code ideas

Postby Artifice » 26 Jan 2014, 13:49

Thanks, Yinzinat!

Lord Bandit,

Thanks for the x energy bug report. There was a timer for Checking generals that I hadn't removed that was causing the issue. I've already pushed a fix to Magowiz. Once he promotes, it should fix some of those problems.

For the general stats scan, I wasn't able to replicate the issue. The general scan is set to check max energy/stamina for all 20 loadouts, and then check all the generals with the default loadout. I cleared my generals to test this, and it worked as intended. It does take about 20 seconds per loadout, because it has to change the general, then go to the Keep to check for the actual change of stats. If you have the console open and are looking at log level 2, you can see CAAP counting through your generals. Each general is only listed twice, once to load, and once to move to the keep. At about 20 seconds per general, for 110 generals and 20 loadouts, this should take (110 + 20) * 20 seconds = about 45 minutes. This may be slower depending on computer and bandwidth speeds.

Once the initial check is done, the loadouts are reviewed daily and the generals weekly. This data is important to confirm the max energy and stamina, so a general isn't equipped that would lower your max stat below your current points.

Let me know how it works after the bug fix!

Artifice has been thanked by:
Artifice
Site Admin
Site Admin
 
Posts: 267
Joined: 23 Nov 2013, 07:47
Has thanked: 40 time
Have thanks: 191 time

Re: Code ideas

Postby LordBandit » 26 Jan 2014, 15:56

Thanks Artifice I knew it took some time to get through that scan...so is there anyway at all we can split up the Action Order and have all this stuff occur during our 'human' idle times and not 5 minutes before a guild battle starts?
LordBandit
Moderator
Moderator
 
Posts: 652
Joined: 21 Jun 2011, 20:30
Has thanked: 109 time
Have thanks: 52 time

Re: Code ideas

Postby LordBandit » 26 Jan 2014, 23:48

Artifice - it's still not working 100%. When caap switches to Max Energy Quest and you don't have your Idle general set to the same general as your quest loadout general it will loop infinitely back and forth.

general.checkResults_generals
[Array[80], hasIndexOf: function, sortNum: function, shuffle: function, compare: function, find: function…]
utility.js:2004
(3)141.0.0d214 |6:42:17 PM| Changing to idle general to get Max energy utility.js:2006
(3)141.0.0d214 |6:42:17 PM| Changing from Vanathan to Meekah utility.js:2006
(3)141.0.0d214 |6:42:17 PM| Click on image
["hero_meekah.jpg", hasIndexOf: function, sortNum: function, shuffle: function, compare: function, find: function…]
utility.js:2004
(3)141.0.0d214 |6:42:20 PM| general.checkResults_generals
[Array[80], hasIndexOf: function, sortNum: function, shuffle: function, compare: function, find: function…]
utility.js:2004
(3)141.0.0d214 |6:42:22 PM| Changing to idle general to get Max energy utility.js:2006
(3)141.0.0d214 |6:42:22 PM| Changing from Meekah to Vanathan utility.js:2006
(3)141.0.0d214 |6:42:22 PM| Click on image
["hero_vanathan.jpg", hasIndexOf: function, sortNum: function, shuffle: function, compare: function, find: function…]
utility.js:2004
(3)141.0.0d214 |6:42:25 PM|

For example in this one... I have a loadout I call Def (ense) and had it set as my default loadout. I had the same loadout set for Questing since I am trying to level up the general in that one, but...I had Vanathan set as my Idle general and once I changed that to the general in the loadout (Meekah) it started working.

LordBandit has been thanked by:
LordBandit
Moderator
Moderator
 
Posts: 652
Joined: 21 Jun 2011, 20:30
Has thanked: 109 time
Have thanks: 52 time

Re: Code ideas

Postby LordBandit » 30 Jan 2014, 03:54

Further watching shows that your default loadout general, idle general and quest general all MUST be the same or when it gets to 'Max Energy Quest' it will infinitely loop between generals... This is of course not an ideal situation but until it is fixed it has to be this way... It will also trip up sometimes, not always though, when you are doing a top level quest, even though those generals all match...haven't figured that one out yet since it doesn't do it all the time.

LordBandit has been thanked by:
LordBandit
Moderator
Moderator
 
Posts: 652
Joined: 21 Jun 2011, 20:30
Has thanked: 109 time
Have thanks: 52 time

Next

Return to Community Build

Who is online

Users browsing this forum: No registered users and 1 guest

cron
suspicion-preferred