Differences

This shows you the differences between two versions of the page.

docs:strategies:autoreader [2010/09/09 09:59] (current)
xtian created
Line 1: Line 1:
 +====== Strategy: AutoReader ======
 +
 +^Purpose  |To read Reports|
 +^When to use  |when want to read and optionally default some or all reports|
 +^When to avoid  | |
 +
 +Server strategy to automatically read messages and optionally send messages for certain events.
 +
 +Place either before or after all village strategies but inside server
 +
 +**Notes**
 +  * currently only supports the specific English strings below not local language
 +
 +==== Syntax ====
 +
 +<code xml>
 +   <serverStrategy class="AutoReader" desc="DESCRIPTION" minPauseMinutes="MINS" enabled="true" runWhile="RUNWHILE_UID" waitFor="WAITFOR_UID" uid="UID">
 + <output append="APPEND" format="FORMAT" />
 +                <delete type="DELETE" />
 +    </serverStrategy>
 +
 +</code>
 +==== Attributes and parameters ====
 +
 +|DESCRIPTION  |some optional description of your choice  |
 +|WAITFOR_UID  |See [[index|"Strategies"]]  |
 +|RUNWHILE_UID  |See [[index|"Strategies"]]  |
 +|UID  |Unique IDentifier. See [[index|"Strategies"]]  |
 +|MINS|the time in minutes to wait before running again|
 +|APPEND|true/false flag to indicate if should append to csv file or create new each run, default is true|
 +|FORMAT|list of type of reports to read (see DELETE) and output targets combined with "+" character.  Output to  "events" file, "log" file, or "csv" file called reports.csv. Default is to read all reports into log file|
 +|DELETE|trade/attack/rein/scout - type of report to delete, can be combined with "+" character, default is none|
 +
 +
 +
 +==== Examples ====
 +Simple Syntax, reads messages every 10 minutes and output them to events.txt, log.txt and also own csv file
 +It deletes any Trade or Reinforcement messages it finds leaving the others still available
 +
 +<code xml>
 +   <serverStrategy class="AutoReader" desc="Read Messages" minPauseMinutes="10" enabled="true" uid="rmss">
 + <output append="true" format="log+event+csv" />
 +                        <delete type="trade+rein" />
 +    </serverStrategy>
 +</code>
 +
 +
 +Complex Syntax with event message sending
 +
 +It reads only attack reports and sends messages according to the type of report.
 +
 +It also deletes without reading any Trade or Reinforcement Messages
 +
 +Therefore scout messages will remain unread
 +
 +<code xml>
 + <serverStrategy class="AutoReader" desc="Read Messages" minPauseMinutes="10" enabled="true" uid="ukxssrp">
 + <output append="true" format="event+attack" />
 +                <delete type="trade+reins" />
 +                <item title="attacked" name="report" id="" msgTitle="lost defenders at %s" msgText="incoming" desc="send message if attacked and lose troops" />
 +                <item title="farmed" name="report" id="" msgTitle="lost res at %s" msgText="we should build a cranny" desc="send message if attacked and lose res" />
 +                <item title="dodged" name="report" id="" msgTitle="no losses at %s" msgText="missed" desc="send message if attacked with no impact" />
 +                <item title="casualty" name="report" id="" msgTitle="lost attackers at %s" msgText="build more" desc="send message if lose some on attack" />
 +                <item title="empty" name="report" id="" msgTitle="empty" msgText="dont attack there again" desc="send message if empty attack" />
 + </serverStrategy>
 +</code>
 +As a protection from flooding with IGM a message is only sent once for a report relating to a title of that type.  However an item line can be included more than once so that a "farmed" item could be included 5 times which would generate 5 messages.
 +I would suggest with slightly different text so the last one could say "oh no not again"
 +


Personal Tools