Logfile with Python


#1

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?


#2

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


#3

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


#4

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


#5

What i get is this:


#6

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.


#7

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


#8

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


#9

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']