Video:
Bitte melden Sie sich an, um dieses Medienelement zu sehen.
Code:
Code
- with open('mob_drop_item.txt', 'r', encoding='latin2') as infile:
- lines = infile.readlines()
- new_lines = []
- count = 1
- for line in lines:
- line = line.rstrip()
- parts = line.split('\t')
- if '}' in line:
- count = 1
- if len(parts) >= 2 and parts[1].isdigit():
- parts[1] = str(count)
- count += 1
- new_line = '\t'.join(parts) + '\n'
- new_lines.append(new_line)
- with open('new_mob_drop_item.txt', 'w', encoding='latin2') as outfile:
- outfile.writelines(new_lines)
- print("""
- █▀▀▀ █▀▀█ ▀▀█ █░░█ █▀▀▄ ░ █▀▀█ ▀█░█▀ █░░█
- █░▀█ █▄▄▀ ▄▀░ █▄▄█ █▀▀▄ ▄ █░░█ ░█▄█░ █▀▀█
- ▀▀▀▀ ▀░▀▀ ▀▀▀ ▄▄▄█ ▀▀▀░ █ ▀▀▀▀ ░░▀░░ ▀░░▀
- """)