DKP Log Parser Forum Index
 Forum FAQ   Search   Register   Log in 
 About   Download   Forum   Wiki   Development
Loot Patterns

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    DKP Log Parser Forum Index -> Patterns

Author

Message

SuprSurfr



Joined: 24 May 2007
Posts: 21

PostPosted: Tue Jun 05, 2007 4:05 am    Post subject: Loot Patterns

Reply with quote


I would like to know if the following would be possible.

I have my Loot pattern set to:
Code:
\((\d+)\)\[.*?\] (?:You loot|(\w+) loots) \\aITEM -?\d+ -?\d+:(.*?)\\/a (?:from|from the) (?:Exquisite|Ornate) Chest.*


Loot Format:
Code:
0|0|0|0|0|$1|$2!CharacterName|$3|0


The parser picks up whoever loots the item and enters it as a 0 dkp value when i upload the day.

What I would like to do if possible is have the parser check who looted the item and then deduct the amount of dkp based on the command that follows the looted item in the log.

Example:
After all bidding is done and it is decided that Bubba has won the bid.
In the log the item is looted by Bubba.

(
Code:
1180916626)[Sun Jun 03 20:23:46 2007] Bubba loots \aITEM 1949175607 818550813:Relic Chain Boots\/a from Exquisite Chest.


After Bubba Loots the item I would like to be able to type the following command in the raid window.

Code:
*Loot Bubba 100


is there a way that I can make the log parser deduct 100 points from what Bubba looted last?
What I am trying to do is not have to type in the the long and most of the time rediculouse spelling for loot names EQ2 assigns.

Maybe a pre-processor of some kind?
and if so where would i find such a beast Wink

Thanks in Advance!

Back to top

Lokorin
Site Admin


Joined: 03 Apr 2006
Posts: 697

PostPosted: Thu Jun 07, 2007 8:02 am    Post subject: Re: Loot Patterns

Reply with quote


SuprSurfr wrote:
I would like to know if the following would be possible.
...
Maybe a pre-processor of some kind?
and if so where would i find such a beast Wink


Aye, I'm afraid that a preprocessor is the only way to do that (either using the interface integrated into the parser, or running the log through a custom one before sending it to the parser).

I have attached an example preprocessor to give something to start with if you want to use the built in interface. The readme contains information about how to use it and the file "preprocessor.groovy" contains the actual code (written in groovy, which is similar to Java). What you want to do is replace the code in the preprocess method. The code currently opens the log, opens a temporary log file (to dump the result in) and then runs through the log (the while loop) looking for certain lines and writing the important data to the temporary log (resultStream.println(...)). In the end the temporary log is returned, in essence replacing the log that was sent in.

What you basically want to do is to read each line and then do the following checks:

  • Does it match your current loot pattern? In that case save the item name and looter in some variable.
  • Does it match the pattern for the loot command you posted? In that case modify the line so that the item name is inserted.

After that has been checked you write the line to the result stream. After that has been done the temporary file (saved as "tmp.txt" in the work directory) should be the same as the log you sent in, except that lines such as
Code:
*Loot Bubba 100

have been replaced with something like the following.
Code:
*Loot Bubba - Silver Katana of Power - 100

You then change the loot pattern to match the latter (it's the default if I recall correctly). After that's done you just have to parse logs as normal and the preprocessing will be done automatically in the background.

Anyone used with Java should probably be able to do that. If you're not, and can't find anyone who is, then you can always ask the forum (but don't expect a speedy response).



ventrilo-preprocessor.zip
 Description:

Download
 Filename:  ventrilo-preprocessor.zip
 Filesize:  8.81 KB
 Downloaded:  144 Time(s)

Back to top

Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    DKP Log Parser Forum Index -> Patterns All times are GMT
Page 1 of 1

 


Powered by phpBB © 2001, 2005 phpBB Group
SoftGreen 1.1 phpBB theme © DaTutorials.com 2005