MendelssohnTW / robot.tw2

Script de automação para TW2
MIT License
2 stars 1 forks source link

farming stops after first few villages. #3

Closed Arrau closed 3 years ago

Arrau commented 4 years ago

Dear Mendel, I have come back to try out your amazing script again, but I am encountering the problem of farming stops working after first few villages, and will only farm those villages. Please let me know if it's by design or something I have done wrong.

Thank you very much and hope you have amazing day.

Arrau commented 4 years ago

Second question: Is it possible to set up the script server on my own with your source code? Or it's required to use it with a external service.

MendelssohnTW commented 4 years ago

Hi. Farm is stopping because there is something wrong with its cycle setup. You cannot set a very short time for each cycle. Or it could just be some conflict with some other application. If it is a conflict you should clear your browser's cache and reconfigure everything again. There is already a predefined configuration, but you can change it as you like.

Em qua, 10 de jun de 2020 22:24, Arrau notifications@github.com escreveu:

Dear Mendel, I have come back to try out your amazing script again, but I am encountering the problem of farming stops working after first few villages, and will only farm those villages. Please let me know if it's by design or something I have done wrong.

Thank you very much and hope you have amazing day.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/MendelssohnTW/robot.tw2/issues/3, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADSY3OMCBGVGT22EPJIEL7DRWAW3FANCNFSM4N26XE3Q .

MendelssohnTW commented 4 years ago

Yes, it's possible. But you must change the URLs of the extension and the main script file (tw2tools). Changing this you will have to configure your server with a certificate (HTTPS) and release the CORS to the game server. I don't remember which one now. But it's the game's website.

Em qua, 10 de jun de 2020 22:29, Arrau notifications@github.com escreveu:

Second question: Is it possible to set up the script server on my own with your source code? Or it's required to use it with a external service.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/MendelssohnTW/robot.tw2/issues/3#issuecomment-642351233, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADSY3OJAVDJNTPVN6NFEZF3RWAXNZANCNFSM4N26XE3Q .

Arrau commented 4 years ago

Thanks for the quick reply! For example I have 50 villages right now, what's the recommended minutes to wait for the farm cycle? I have cleared my cache of the website and reloaded the script, it's working better now, I left farming at 30 min per cycle as default, but still stops around 40 village mark. Should I stop other sector of the script to make it run better?

MendelssohnTW commented 4 years ago

Calculation is a little complex. But it depends on the number of search villages. An average of 1 min for each village. In an already complete world. To make it easier to understand. It takes 3 seconds on average for each Farm village. As they are 50 then it gives an average of 150 seconds per your village. But it depends on the computer too, as well as internet. But an average of 1 min for each village. I advise a cycle of one hour for 100 villages. If you stay with a short cycle it accumulates one cycle within the other and causes overloads and for the Farm.

Em qua, 10 de jun de 2020 23:23, Arrau notifications@github.com escreveu:

Thanks for the quick reply! For example I have 50 villages right now, what's the recommended minutes to wait for the farm cycle? I have cleared my cache of the website and reloaded the script, it's working better now, I left farming at 30 min per cycle as default, but still stops around 40 village mark. Should I stop other sector of the script to make it run better?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/MendelssohnTW/robot.tw2/issues/3#issuecomment-642366211, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADSY3OJFD4J2TEOJWUWNN7DRWA52TANCNFSM4N26XE3Q .

Arrau commented 4 years ago

Thank you very much! After putting the script to run at 50 min for 50 villages, I was able to make the script run through all my villages and worked flawlessly.

If you have time, do you mind elaborate on how do I release the CORS to the game server? Which file would I need to edit? Or is it something much more complicated than simple edit.

Much appreciated!

MendelssohnTW commented 4 years ago

U should to edit htaccess. Allow cors for game site.

Em qui, 11 de jun de 2020 00:57, Arrau notifications@github.com escreveu:

Thank you very much! After putting the script to run at 50 min for 50 villages, I was able to make the script run through all my villages and worked flawlessly.

If you have time, do you mind elaborate on how do I release the CORS to the game server? Which file would I need to edit? Or is it something much more complicated than simple edit.

Much appreciated!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/MendelssohnTW/robot.tw2/issues/3#issuecomment-642391103, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADSY3OOVL6FGKBJXPF5C3U3RWBI3ZANCNFSM4N26XE3Q .

Arrau commented 4 years ago

Thank you, I will try it out.

Arrau commented 4 years ago

Hi Mendelssohn, Is there a way to make sure the update of the setting stays? For some reason the script went back to not working by itself, it changed back to 30 min per far cycle and I am having hard time change it back to 50 min, so the conflict situation happened again and was unable to finish the farm run.

MendelssohnTW commented 4 years ago

Yep, you should to change focus field, before close window. Save when change focus field.

Em qui, 11 de jun de 2020 13:42, Arrau notifications@github.com escreveu:

Hi Mendelssohn, Is there a way to make sure the update of the setting stays? For some reason the script went back to not working by itself, it changed back to 30 min per far cycle and I am having hard time change it back to 50 min, so the conflict situation happened again and was unable to finish the farm run.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/MendelssohnTW/robot.tw2/issues/3#issuecomment-642800352, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADSY3OPR3IH3N5YAM2BMJJLRWECRDANCNFSM4N26XE3Q .

TeeTuTW commented 4 years ago

Hi Mendelssohn, Would you mind provide an example of how to release the CORS? I have wrote this line in the .htaccess but it's not working.

Header set Access-Control-Allow-Origin "*https://*.tribalwars2.com"

Not sure if that's the mistake or there are some server setting that I needed to config.

MendelssohnTW commented 4 years ago
SetEnvIf Origin ^(https?://.+\.tribalwars2\.com(?::\d{1,5})?)$ CORS_ALLOW_ORIGIN=$1 Header append Access-Control-Allow-Origin %{CORS_ALLOW_ORIGIN}e env=CORS_ALLOW_ORIGIN Header merge Vary "Origin"