valheim-discord-bot
valheim-discord-bot copied to clipboard
No Deaths
Hi ho, he doesn't read the deaths for me. the csv remains permanently unchanged.
_logsubprocess.py
TabError: inconsistent use of tabs and spaces in indentation
vdb_main.py Traceback (most recent call last): File "/usr/local/lib/python3.7/dist-packages/discord/ext/commands/core.py", line 85, in wrapped ret = await coro(*args, **kwargs) File "vdb_main.py", line 80, in leaderboards df = pd.read_csv('csv/deathlog.csv', header=None, usecols=[0, 1]) File "/usr/local/lib/python3.7/dist-packages/pandas/io/parsers.py", line 610, in read_csv return _read(filepath_or_buffer, kwds) File "/usr/local/lib/python3.7/dist-packages/pandas/io/parsers.py", line 462, in _read parser = TextFileReader(filepath_or_buffer, **kwds) File "/usr/local/lib/python3.7/dist-packages/pandas/io/parsers.py", line 819, in init self._engine = self._make_engine(self.engine) File "/usr/local/lib/python3.7/dist-packages/pandas/io/parsers.py", line 1050, in _make_engine return mapping[engine](self.f, **self.options) # type: ignore[call-arg] File "/usr/local/lib/python3.7/dist-packages/pandas/io/parsers.py", line 1898, in init self._reader = parsers.TextReader(self.handles.handle, **kwds) File "pandas/_libs/parsers.pyx", line 521, in pandas._libs.parsers.TextReader.cinit pandas.errors.EmptyDataError: No columns to parse from file
I have correctly set the path to the corresponding log file from Valheim. I also did a test and got the appropriate feedback
#datei = open(log, mode='r')
#if datei:
# print('Datei OK')
# with open('csv/deathlog.csv', 'a', newline='', encoding='utf-8') as dl:
# curtime = await timenow()
# deathup = csv.writer(dl, delimiter=',')
# deathup.writerow([curtime, 'Unbekannt'])
# print(curtime, 'Unbekannt', ' has died!')
#else:
# print('Datei kann nicht geöffnet werden')
Hi there mate, curtime
and pname
are internal variables,
it's best to leave them unchanged and only change the strings if you need localization. I may look at options for adding translations later.
German Translation via Google!
Pardon me. Emglish is not good.
As already said, the script reads the Valheim log file, but does not write the deaths to the csv. See error message. I also know that these are internal parameters.