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

Anti-Ban Features #21

Closed makrohard closed 5 years ago

makrohard commented 6 years ago

The bot works quite well and does what it's supposed to do. Unfortunately one gets banned fast. I'm not sure what exactly triggers the ban, it might be constant activity. I got banned after about 40 h. Maybe It'll help to implement some more setting that will allow to pause maybe 2 hours every 6 h or so.

m3talstorm commented 6 years ago

The bot been around a while now, maybe they have put in some measures to detect it.

rem38 commented 6 years ago

Hi, I wrote my own foe-bot using JAVA, and i just get ban too. 2 of 5 account where banned (i do multi account), and inno dont want to say why. i think it is because i dont communicate with their websocket. I dont know what informations are trade with this protocol. My bot was running 5min each hour about 2weeks.

druban commented 6 years ago

I've been banned a time or two, then decided to make improvements to my local version. First of all - UserAgent - make sure it's the same as your current browser. Make sure Flash version is up to date (in the request, that is). 2nd - modify code that does sit in the taverns and aids friends. Currently, it's kinda dumb - it deals with players in the order sorted by player id. There's no way human would do that. So, get a list sorted by player's score and then sequentially go over it, checking each player if we can sit in the tavern and/or aid it. The idea is, basically, if you're aiding a player, check if we can sit down in his tavern as well. The same applies for building pickups and productions. Don't pick them up in the sequence of building ids. That's dumb and can be easily detected as well. And so on and so forth. There could be other things I improved in my local copy in regards to this, but these are main things that need to be addressed. I have code for all that. Also, I added an ability to train troops and fixed existent hidden reward code. Let me know, if you're interested. Cheers!

druban commented 6 years ago

And of course, random delays have to be inserted pretty much everywhere. You can't blast through aiding/tavern sitting for 90+ players in like 10 seconds, for example.

peasodecesar commented 6 years ago

@Druban, can you share your local version?

druban commented 6 years ago

@peasodecesar If m3talstorm is willing to incorporate it into the main code

m3talstorm commented 6 years ago

@druban Would have to see it first :) submit a PR and ill have a look, but, I don't play FoE anymore.

druban commented 6 years ago

I didn't want to create my own branch for this. So here's promised patch. foe.diff.gz

Changes are: troops autotrain hidden reward code (from ruscon) - I simply fixed it so it'd work w/o server returning an error tavern threshold (from ruscon) Improved logic for tavern sitting / aiding players Randomize pickups and productions Some typos were fixed Perhaps some cosmetic changes

Let me know if you have any questions

druban commented 6 years ago

@m3talstorm If you need help w/ code maintenance, I'm available, since I'm still playing the game

edgeman16 commented 6 years ago

Do we know if there's an updated secret etc now? Also, now there's an HTML5 version of the game, does this allow interaction via the DOM with user scripts now, that Flash did not allow? Sorry for hijacking this issue but as m3talstorm doesn't play I thought this was the best place to ask re: HTML5

wq6830418 commented 6 years ago

i had the new code that by myself, now i try the Websocket keep alive

VividWombat commented 6 years ago

@druban maybe you'd like to fork the repo and maintain that. would be useful

wq6830418 commented 5 years ago

I had write two new codes. One write by C# and other is Python. all use Websocket keep alive. had runing 5 months not ban. now had one question that if not use Flash in future, and how to take the secret in Html5. thanks