So, you have one free training in Rabona every day. It's important to train everyday and don't miss the timings. This script automatically executes your preset training when the daily training is available for your team.
import json
from rabona_python import RabonaClient
from lighthive.datastructures import Operation
from lighthive.client import Client
from datetime import datetime
# possible train types
# 433, 442, 352, 451, 4231, shot,dribbling, passing, defending,
# headball, speed, endurance.
ACCOUNTS = [
{
"username": "emrebeyler",
"auto_train_type": "433",
"posting_key": "<posting_key>>"
},
{
"username": "klopp",
"auto_train_type": "4231",
"posting_key": "<posting_key>>"
},
]
def create_custom_json_op(username, auto_train_type):
train_json = json.dumps(
{
"username": username,
"type": "train",
"command": {"tr_var1": auto_train_type}}
)
train_op = Operation('custom_json', {
'required_auths': [],
'required_posting_auths': [username, ],
'id': 'rabona',
'json': train_json,
})
return train_op
def main():
r = RabonaClient()
for account in ACCOUNTS:
# check if we can train, first.
userinfo = r.userinfo(user=account["username"])
if not userinfo.get("training_possible"):
# training is not possible, wait.
dt_delta = datetime.fromtimestamp(
userinfo.get("training_busy_until")) - datetime.now()
hours_left = int(dt_delta.total_seconds() / 3600)
print("[%s] %d hours left for the training. Waiting." % (
account["username"],
hours_left
))
else:
op = create_custom_json_op(
account["username"], account["auto_train_type"])
c = Client(keys=[account["posting_key"]])
c.broadcast(op=op)
print("[%s] [Training: %s] Done." % (
account["username"], account["auto_train_type"]))
if __name__ == '__main__':
main()
Notes
- Just fill the corresponding information at the
ACCOUNTS
dictionary and execute it via a cron entry. - It requires
lighthive
andrabona_python
libraries, installed. - You need to be familiar with Python & servers to work this out.
.
well, considering most of the players play default 4-3-3, I'd go with 4-2-3-1. :)
I already have that one ;)
.
This is very useful.
I have been learning a bit of Python recently so let me see if I can deploy this script succesfully,
cool!
Congratulations @emrebeyler! You received a personal badge!
You can view your badges on your board and compare yourself to others in the Ranking
Do not miss the last post from @hivebuzz:
I've no idea how to do that so I'll just win the league the old fashioned way. Hard work and determination. 😂
Or the new way and buy up lots of top players to win like man city.
Thank you! I was looking for something like this.