Officer channel
From DKPLP Doc
Officer channel refers to a modification of the standard predefined pattern sets that enables anyone in a specified channel to enter commands. This allows the work to be spread so that people other than the logger can enter for instance dropped loot.
Contents |
The idea
The idea is fairly simple. First we need to change the patterns' channel so that it only looks for a specific channel. We also need to change it so that it matches anyone telling the channel something (and we have to make sure that You is included as that usually has a special syntax).
Examples
EverQuest
Lets take the add command as an example. We want to allow anyone in channel foo to issue the add command, hence adding a person to the raid. In EverQuest (/who) it's by default
\[\w{3} (\w{3}) (\d{2}) (\d{2}):(\d{2}):(\d{2}) (\d{4})] You tell .*?:\d+, '\*[aA]dd (\w+)'
To allow only a specific chat channel named foo (change to whatever channel you want to authorize) we change the .*? (matches anything) to foo. So we get
\[\w{3} (\w{3}) (\d{2}) (\d{2}):(\d{2}):(\d{2}) (\d{4})] You tell foo:\d+, '\*[aA]dd (\w+)'
But still only You is allowed as the one that issues the command, so we have to make it You or anyone else.
\[\w{3} (\w{3}) (\d{2}) (\d{2}):(\d{2}):(\d{2}) (\d{4})] (?:You tell|.+? tells) foo:\d+, '\*[aA]dd (\w+)'
And now we're done. The command can be issued by anyone that's in channel foo.
EverQuest 2
Lets take the loot command as an example. We want to allow anyone in channel bar to issue the add command, hence adding a person to the raid. In EverQuest 2 (/whoraid) it's by default
\((\d+)\)\[.*?\] You tell .*? \(\d+\),"\*[Ll]oot (\w+) - (.*?) - (-?\d+(?:\.\d+)?)"\Z
Filtering the channels to only allow foo results in the following.
\((\d+)\)\[.*?\] You tell bar \(\d+\),"\*[Ll]oot (\w+) - (.*?) - (-?\d+(?:\.\d+)?)"\Z
Then we allow anyone in the channel to issue the command.
\((\d+)\)\[.*?\] (You tell|.+? tells) bar \(\d+\),"\*[Ll]oot (\w+) - (.*?) - (-?\d+(?:\.\d+)?)"\Z
Further improvements
One can also specify the exactly which individuals (names) that should be allowed to issue specific commands. It can be useful if one would like to issue the commands in a semi-public channel (e.g. the raid channel) without allowing everyone in the channel to issue the command.
Lets say that one trusts two people named Trustella and Trusty and want to restrict the add command that we created earlier by modifying the default EverQuest (/who) pattern. We would do it by exchanging the .+? (matches any name) to the actual names, hence we would get the following.
\[\w{3} (\w{3}) (\d{2}) (\d{2}):(\d{2}):(\d{2}) (\d{4})] (?:You tell|Trustella tells|Trusty tells) foo:\d+, '\*[aA]dd (\w+)'
The parser will now only listen to add commands issued by the logger, Trustella and Trusty in channel foo.
