How to capture and store data (and view it via an alias)?
Re: How to capture and store data (and view it via an alias)?
I think if I could type @aucdata XXXX (date, item, buyer, price) that would be good enough. I think I could 'mess' with the code to maybe add more columns later if needed. I'm thinking that information would be plenty tho.
Re: How to capture and store data (and view it via an alias)?
Right, so see the post immediately before this one, and you will see what should let you add each of those as options.
Re: How to capture and store data (and view it via an alias)?
Thanks much.
I'm getting an error on the "if a.[order[1]] ~= b.[order[1]] then return a.[order[1]] < b.[order[1]] end" line.
Says expected a ')' near '['
I'm getting an error on the "if a.[order[1]] ~= b.[order[1]] then return a.[order[1]] < b.[order[1]] end" line.
Says expected a ')' near '['
Re: How to capture and store data (and view it via an alias)?
Oh. I’m an idiot. I forgot to remove the periods after the a and b when I put in the square brackets. Take out all those periods in each of the three lines, and it should work. Also, just to be safe, you might want to put some spaces between the double closing square brackets, so it can’t misinterpret them.
Re: How to capture and store data (and view it via an alias)?
Errors all gone, but when I '@aucdata price' it still lists everything by item.
I'm guessing this line isn't correct...
function show_auction_data()
I'm guessing this line isn't correct...
function show_auction_data()
Re: How to capture and store data (and view it via an alias)?
Yeah, you will notice in my post that it has function show_auction_data(sort_by)
Re: How to capture and store data (and view it via an alias)?
Hmmm. Still always prints the data the same way no matter if I use:
@aucdata date
@aucdata price
@aucdata item
@aucdata buyer
Sorry for being such a nub:P
@aucdata date
@aucdata price
@aucdata item
@aucdata buyer
Sorry for being such a nub:P
Re: How to capture and store data (and view it via an alias)?
Okay, show me what you have for both the alias and the script. Hopefully I'll be able to spot what is going wrong.
Re: How to capture and store data (and view it via an alias)?
Also, after testing out the script with the bit of data you provided earlier (and it does seem to work for me), I noticed that the prices were being sorted as strings rather than numbers (because they are stored as strings, not numbers). So, I put in something to convert prices to numbers when they are collected, as you can see here (also notice the assorted sorting options I added in just for testing purposes):
But, you would also need to run through the existing auction data and convert existing prices from strings into numbers. To do that, I used the following command: lua for k,v in ipairs(auction_data) do auction_data[k].price = tonumber(v.price) end
Re: How to capture and store data (and view it via an alias)?
Here is what I have...