coccoinomane / crabada.py

Crabada bot with automatic reinforce. Snib snib! 🦀

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fallback strategies (related to inventory crabs)

coccoinomane opened this issue · comments

I was working on merging @yigitest 's most excellent pull request #27 to use inventory crabs for reinforcing (related to #13) when I realized there might be a better way to handle strategies.

Instead of having multiple InventoryOr... strategies, we need to be able to specify multiple strategies per team.

For example we could specify

TEAM_X_REINFORCE_STRATEGY="Inventory, HighestBp"

to mean: try first with the Inventory strategy and if that does not find a suitable crab, then fallback to HighestBp.

In this way, we need only one Inventory strategy, which the user can combine with whatever other strategy he/she likes.

One clear advantase is that you can combine the inventory strategy with the new HighCost strategies without the need to create an ex-novo strategy each time; for example:

TEAM_X_REINFORCE_STRATEGY="Inventory, HighestBpHighCost"

I am going to proceed in that direction, if anybody has doubts or can suggest improvements, please let me know :-)

Cheers,
Cocco

Hi @coccoinomane,

Just keep in mind that, there could be more than one inventory-hireable crabs, and users would want be able sort them according to their needs (BP or MP). In my PR #27 crabs from either inventory or tavern are sorted same way in the process() function.

Thanks @yigitest for your observation!

I can make two inventory strategies: HighestBpFromInventory and HighestMpFromInventory. Would this solve your concern?

Yes, of course. Thanks.

But on second-thought: this is a case of over engineering :) Any sane person with more than 2 crabs, would use them in a team instead of hiring. Single Inventory strategy should be fine.

That's a good point!

Although there might be some guy with exactly two inventory crabs who uses them one for looting and the other for mining 🤔

I think I will go ahead with the two separate inventory strats, it's a tiny over-engineering ;-)

That's a good point!

Although there might be some guy with exactly two inventory crabs who uses them one for looting and the other for mining 🤔

I think I will go ahead with the two separate inventory strats, it's a tiny over-engineering ;-)

This is super awesome! Thanks again @yigitest and @coccoinomane

Yes, of course. Thanks.

But on second-thought: this is a case of over engineering :) Any sane person with more than 2 crabs, would use them in a team instead of hiring. Single Inventory strategy should be fine.

Just to give my two cents (lol), 2 crabs can reinforce seven (7) 3.5h mining teams. With 14 teams you need 4 crabs to reinforce.

What I do is mine 2 teams first, wait 30 minutes and mine another 2 teams until I have 14 mining teams. I get 0 tavern spent for 3 days now thanks to you @yigitest and ofc @coccoinomane ’s bot

@nikohd12
How do you schedule for 1st and 2nd reinforcements?

I am not using a cronjob (running all the bot.mining functions in an infinite loop). But still, reinforce-defense timings are connected to the attacker's actions.

Thanks for sharing @nikohd12 , your mining strategy is impressive!

You are still using separate .env files, correct?

I guess you are not using REINFORCE_DELAY_IN_SECONDS=1800 because you need to send 2 teams at the same time, correct?

I am asking because I am unsure yet whether/how to implement time staggering 😅

Cheers,
Cocco

@nikohd12 How do you schedule for 1st and 2nd reinforcements?

I am not using a cronjob (running all the bot.mining functions in an infinite loop). But still, reinforce-defense timings are connected to the attacker's actions.

Hi @yigitest ,

I’m running the reinforce script every 2 minutes. The reinforce-defense timings don’t matter much cos as soon as we start mining we are getting looted which indicates Reinforce 1, this is the only crucial part of the timing. We need to ensure that there are 30 minute gaps between each team.

For my setup, I have 4 crabs. So i can afford 2 teams at the same time; 2 crabs for Reinforce 1. 2 crabs for Reinforce 2. Start next 2 teams, 2 crabs from the first team (Reinforce 1) will be free to reinforce for the next 2 Miners.

Sorry, I hope i didnt make it too complicated

Thanks for sharing @nikohd12 , your mining strategy is impressive!

You are still using separate .env files, correct?

I guess you are not using REINFORCE_DELAY_IN_SECONDS=1800 because you need to send 2 teams at the same time, correct?

I am asking because I am unsure yet whether/how to implement time staggering 😅

Cheers, Cocco

I am not looting now so I only use 1 .env. 10 second reinforce delays. I send all teams to manually mine. Once everything is staggered i now schedule to SendMining every 3 minutes and settle every 2 minutes.

Ahhh, I see.

You start by sending the teams manually, staggering them as you deem appropriate.

Then you rely on the bot to maintain your initial stagger, by setting a tight cron schedule.

May I ask how log does the bot preserve your initial stagger? Do you need to "reset" the initial stagger every now and then?

Cheers,
Cocco

Ahhh, I see.

You start by sending the teams manually, staggering them as you deem appropriate.

Then you rely on the bot to maintain your initial stagger, by setting a tight cron schedule.

May I ask how log does the bot preserve your initial stagger? Do you need to "reset" the initial stagger every now and then?

Cheers, Cocco

Hi @coccoinomane, I just noticed now too. My reinforce cost has grew over time and mining was off for 5~6 minutes now compared to before which were perfectly staggered.

Do you think there's a chance that we can an option to have a checker for each team before sending it to mine? Something like: Team 2 checks if Team 1 if x minutes past before sendTeamsMining().

MINE_STAGGER_TIME=x #stagger mines in x minutes