m3talstorm / foe-bot

:robot: A simple bot to automate the main functions of Forge of Empires (FoE)
MIT License
45 stars 15 forks source link

Feature Request: Adjust user-agent and add random timeframes to avoid ban #20

Closed bradpoulton closed 5 years ago

bradpoulton commented 6 years ago

My testing account just got banned. It has been running for about 10 days. Here is the error message:

Reason: Your account has been temporarily blocked because our system detected that you were using prohibited software to interact with our game. Please keep in mind that usage of bots and scripts is not permitted in our game. We would like to ask you to deactivate the prohibited software immediately. Thank you for your cooperation.

I assumed this would occur after enough time. I don't know what user-agent string is being used, but ensuring it looks like a chrome browser would be helpful.

Second, using a cron type scheduler to collect resources might help to prevent bans, e.g. collect resources at random minute times, etc. or only collecting once per day.

bradpoulton commented 6 years ago

OK you can ignore me. Looks like you have already implemented these protections.

Here: https://github.com/m3talstorm/foe-bot/blob/master/foe/request.py#L57

and here: https://github.com/m3talstorm/foe-bot/blob/master/foe/main.py#L68

They must be monitoring for very regular activity. I think adjusting the script to only collect once per day might help if avoiding detection.

sammeowww commented 6 years ago

maybe to implement the rest time (e.g. 30 minutes) every few hours (e.g. 4 hours), similar to https://foe.botsoft.org/en/ however not sure if the sid will be change or timeout after the rest time