Logfile with Python

Is there a way to create a Logging with Python?
What i mean is for example:
When i create with the “creator” Plugin one char, than i want to log on which account the char was createt.
But i think i didn´t get the username through python?

You could save a list of usernames / characters. There’s an API called get_startup_data() that returns the username.

1 Like

I tried this, but i get only the character name

def event_loop():
   login = str(get_startup_data())
   log(login)

The Login was through Manger

1 Like

It returns the data that was passed to it from the Manager. It should be there.

What i get is this:

1 Like

You’re definitely using the Manager with the username set? I added that function a long time ago for someone and it worked for him.

Yes. All what i have done is to make groups.
Its interessting that the bot starts when the string is empty

I also tried it by a char who is logging at the moment without the manager and there is also an empty string

It returns the startup data it got from the Manager. It doesn’t return anything if it was not set.

I only filled the fields with username, password, character and started the client with manager. With get_startup_data() you will get only character name and not username. Username is empty.

When i look for command line arguments, there are also no information about username:
['Folder\\phBot.exe', '--locale', 'isro', '--skipupdates', '--manager', '--manager-shared']