Page 7 of 8

Re: How to capture and store data (and view it via an alias)?

Posted: Tue Aug 07, 2018 12:19 pm
by Vooku
^(.+) sold to ([A-Z][W'-]+) for (\d+) platinum!

Another thing I'm seeing is that newer entries won't sort on date. It looks like some of the entries are saving in a different order. Could that be causing that issue?

Re: How to capture and store data (and view it via an alias)?

Posted: Tue Aug 07, 2018 12:25 pm
by Vooku
Here is the auction_data file...

Re: How to capture and store data (and view it via an alias)?

Posted: Tue Aug 07, 2018 12:54 pm
by Jor'Mox
So, change your trigger pattern to this: (Auction: .+) sold to ([A-Z][\w'-]+) for (\d+) platinum!

OR, if you wanted the "Auction: " part to be excluded from the item names, use this pattern: Auction: (.+) sold to ([A-Z][\w'-]+) for (\d+) platinum!

Right now, date sorting will be a bit weird, as it is just sorted as a string. Meaning that since A is before J, August will be before July. We can fix that, but if there is some other issue we should address that first.

Edit: There, fixed the patterns.

Re: How to capture and store data (and view it via an alias)?

Posted: Tue Aug 07, 2018 1:37 pm
by Vooku
Thanks much. I'll make the changes to the trigger when I get home. At work now and hard to do much on my iphone.

Re: How to capture and store data (and view it via an alias)?

Posted: Thu Aug 09, 2018 2:29 am
by Vooku
I can't get either trigger to capture now. Using...
----------------------------------------------------------------------
Pattern: ^(.+) sold to ([A-Z][W'-]+) for (\d+) platinum!
Code: [show] | [select all] lua
add_auction_data(matches[2],matches[4],matches[3])

cecho("\n<red>[Capturing Auction Data...]\n")
----------------------------------------------------------------------

I'm not getting the cecho at all now so nothing is getting added to the table. No errors either.

Re: How to capture and store data (and view it via an alias)?

Posted: Thu Aug 09, 2018 2:35 am
by Vooku
Ok.. figured out why it wasn't capturing. The pattern... went back to the original one you posted and it works.

^(.+) sold to ([A-Z][\w'-]+) for (\d+) platinum!

Didn't like the [W'-]... [\w'-] is good.

Re: How to capture and store data (and view it via an alias)?

Posted: Thu Aug 09, 2018 2:45 am
by Jor'Mox
Yeah, \w is a stand in for all letters, numbers, and the underscore. W is just an upper case w. So you would have only matched names that consisted of any starting letter followed by any number of uppercase Ws, apostrophes, and hyphens, but nothing else.

Something must have happened when I typed it out...sorry for the typo.

Edit: oh, I see now. I just copied what you posted above, and changed the part I was looking at. Didn’t bother to double check the rest of it.

Re: How to capture and store data (and view it via an alias)?

Posted: Fri Aug 10, 2018 8:12 pm
by Vooku
Thanks. Is there a web site that describes what the different parts do? Like the '+' and '*' and [A-Z], etc.?

Re: How to capture and store data (and view it via an alias)?

Posted: Fri Aug 10, 2018 8:52 pm
by Jor'Mox
You can probably search for a Regex primer. But I can also give a very quick rundown of the basics.

. = any character
\d = any number
\w = any letter or number or underscore
\s = any whitespace character
+ = matches 1 or more of the preceeding character or group
* = matches 0 or more of the preceeding character or group
? = matches 0 or 1 of the preceeding character or group
^ = the beginning of a line
$ = the end of a line
[] = matches a combination of anything inside the brackets
() = captures whatever is inside the parentheses
- = when inside square brackets and between two characters, this represents all the characters between them (so a-z is all lower case letters, for example)

Re: How to capture and store data (and view it via an alias)?

Posted: Thu Aug 16, 2018 11:12 am
by Vooku
Thanks! That helps a lot. With everything working good how would I go about 'fixing' the sort by date?

Also, would it be difficult to not have it add duplicates with the same item name and price?