nuaoa / announcementwindow Goto Github PK
View Code? Open in Web Editor NEWA Dwarf Fortress announcement filter written in Python.
A Dwarf Fortress announcement filter written in Python.
Opening the Filters Configuration window is very slow and resource intensive. It takes about 26s to generate the filters list completely. The list is filled gradually, while this happens the filter window slowly expands, and the scrollbar keeps flickering up and down.
During this one CPU core is more or less saturated.
Tested on 10.7.5 w/ homebrew python 2.7.10 and 10.9.5 w/ factory settings (python 2.7.5).
Would be really nice to add two logs for the events in terms of actual log files.
I want to do "events" stream overlay and it would be really nice to use this program, but i'd like to be able to get output of the program in file, not in the window cause I cant do "styling" of the window, but I can do it for files.
I was having issues with the filters in the latest LNP not catching battle_minor events, before I realized that the issue was caused by Toady fixing some weird casing stuff in the announcements.
For example, what used to be
The captain of the guard strikes at The Mace Lord but the shot is easily deflected by the -iron mace-!
became
The captain of the guard strikes at the Mace Lord but the shot is easily deflected by the -iron mace-!
(Note the change in case of the "The" before "Mace Lord")
Following are the battle_minor rules that I'm using now that resolve the issue. This could probably also been fixed by changing the problem words in the filter to "((T)|(t))he" but I'm lazy and this works.
[battle_minor][hitevents_miss] "The (.+), lightly tapping the target!"
[battle_minor][hitevents_miss] "The (.+), but the attack glances away!"
[battle_minor][hitevents_miss] "(.+), but the attack is deflected by the (.+)'s (.+)!"
[battle_minor][hitevents_miss] "(.+), but it is deflected by the (.+)'s (.+)!"
[battle_minor][hitevents_miss] "The (.+) strikes at the (.+) but the shot is parried!"
[battle_minor][hitevents_miss] "The (.+) strikes at the (.+) but the shot is ((deftly )|(easily )|(narrowly )|(just barely )|(effortlessly )|())parried by (.+)"
[battle_minor][hitevents_miss] "The (.+) strikes at the (.+) but the shot is ((deftly )|(easily )|(narrowly )|(just barely )|(effortlessly )|())deflected by (.+)"
[battle_minor][hitevents_miss] "The (.+) the (.+) but the shot is blocked(.+)"
[battle_minor][hitevents_miss] "The flying (.+) misses (.+)!"
[battle_minor][hitevents_miss] "(.+) blocks the flying (.+)!"
[battle_minor][hitevents_miss] "The (.+) misses the (.+)!"
[battle_minor][status] "The (.+) (has been stunned|is knocked over|has been knocked unconscious|stands up|passes out|falls over|regains consciousness|is no longer stunned).+"
[battle_minor][status] "The (.+) (charges at|collides with) the (.+)!"
[battle_minor][status] "They tangle together and (.+)!"
[battle_minor][status] "The (.+) bounces backward!"
[battle_minor][status] "The (.+) collapses and falls to the ground from over-exertion\."
[battle_minor][status] "The (.+) looks surprised by the ferocity of ((the (.+)'s)|(Your)) onslaught!"
[battle_minor][block_dodge] "The (.+) (blocks|jumps away|jumps out|scrambles out of|scrambles away|rolls out of|rolls away|falls over).+"
[battle_minor][block_dodge] "(((.+) jumps)|(You jump)) away from the flying (.+)!"
[battle_minor][block_dodge] "(((.+) jumps)|(You jump)) away from the (.+)!"
[battle_minor][block_dodge] "(.+) bats the ((spinning)|(flying)) (.+) out of the air!"
[battle_minor][block_dodge] "(.+) scrambles away from the flying (.+)!"
[battle_minor][block_dodge] "(.+) strikes at (.+) but the shot is blocked with (.+)!"
[battle_minor][block_dodge] "(((.+) misses)|(You miss)) (.+)!"
[battle_minor][block_dodge] "(.+) jumps away from the spinning (.+)!"
[battle_minor][block_dodge] "(.+) blocks the spinning (.+)!"
[battle_minor][block_dodge] "(.+) bats the spinning (.+) aside!"
[battle_minor][block_dodge] "(.+) scrambles away from the spinning (.+)!"
[battle_minor][block_dodge] "(.+) rolls away from the spinning (.+)!"
[battle_minor][block_dodge] "The (.+) bats the (.+) aside.+!"
The following filter catches workflow log messages. Currently they're caught by the emotions filter, which works, but this change puts them in the same category as the rest of the dfhack messages.
[dfhack][workflow] "((Stopping)|(Resuming)) production: (.+)"
[dfhack][workflow] "Stock level is low: (.+)"
[dfhack][workflow] "Cannot produce: (.+)"
┌[txtsd@dungeon-of-data]─[~/git/AnnouncementWindow] [126] [15-12-13 21:46:51]
└─▶ python run.py
Traceback (most recent call last):
File "run.py", line 1, in <module>
import Window
File "/home/txtsd/git/AnnouncementWindow/Window.py", line 16, in <module>
import Config
File "/home/txtsd/git/AnnouncementWindow/Config.py", line 100, in <module>
settings = config()
File "/home/txtsd/git/AnnouncementWindow/Config.py", line 44, in __init__
self.load()
File "/home/txtsd/git/AnnouncementWindow/Config.py", line 67, in load
self.parser.set(self.section, 'save_hidden_announcements', self.save_hidden_announcements)
File "/usr/lib/python3.5/configparser.py", line 1189, in set
self._validate_value_types(option=option, value=value)
File "/usr/lib/python3.5/configparser.py", line 1174, in _validate_value_types
raise TypeError("option values must be strings")
TypeError: option values must be strings
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.