I'm trying to deduplicate blank lines. When I match ^\s*$ with the following code (within a script, not send_to_script),
I get this debug output.
This is all as expected. The output, however, looks like this:
line_number = self.world.GetLinesInBufferCount
line_1 = self.world.GetLineInfo(line_number, 1).strip()
line_2 = self.world.GetLineInfo(line_number - 1, 1).strip()
line_3 = self.world.GetLineInfo(line_number - 2, 1).strip()
if line_1 == line_2 and line_1 in ['', '[OOC]', '[AFK]']:
self.debug('Deduplicated line %d!\nLine_3: %s\nLine_2: %s\nLine_1: %s' %
(line_number, line_3, line_2, line_1))
self.world.DeleteLines(1)
I get this debug output.
DEBUG 0: Deduplicated line 104!
Line_3: You are hungry.
Line_2:
Line_1:
This is all as expected. The output, however, looks like this:
You are hungry.
3:04 [INFO] Someone has left Antrippa.