Addon Dev Question

I asked some guy who graduated from harvard and currently works for amazon... I'll just copy & paste his replies. Hope it's any help to you. Perhaps you could answer his questions

is the AH window open when the query is fired?

does lua require return types

in function headers

I've never used it

I just don't know if this function returns a value or not

QueryAuctionItems

looks like it doesn't?

in someone else's code they do this:

Code:
QueryAuctionItems(name, nil, nil, 0, 0, 0, Scan.tryPage, 0, 0)
Scan.eventObject:RegisterEvent("AUCTION_ITEM_LIST_UPDATE", function()
                Scan.eventObject:UnregisterEvent("AUCTION_ITEM_LIST_UPDATE")
                Scan.eventObject.frame:Show()

is the auction item list update thing sep

is it a flag

that you mark as set

and the frame checks that when it redraws?

i've never worked with this stuff but that's what i'd guess

you'd need to manually register and unregister the event

and refresh the frame

the show() call is probably doing it there

it's like with file io where you are manipulating a buffer the whole time until you sync() or flush() the buffer
 
Are you able to make any arbitrary action happen during your event? Do you enter the statement?
Yes, If I understand you correctly. The function is called upon opening the AH, and by the slash command - both of which should print "AH update" subsequently. You mean other than printing stuff?

I think I found it, upon looking again. I noticed it only works once, so e.g. upon every login - a detail I somehow missed and failed to check. Two things obscured it. The query has a small loading time. Furthermore, the search results displayed are wiped after changing tabs (bids, or own auctions). So, switching tabs before the results were displayed made it seem like nothing had happened, although the messages were printed. And subsequent queries via the slash command didn't actually alter the already existing results, so 'update' didn't fire.

Well, solved =) Thanks for the support!
[doublepost=1611532833,1611532187][/doublepost]
I asked some guy who graduated from harvard and currently works for amazon... I'll just copy & paste his replies. Hope it's any help to you. Perhaps you could answer his questions

is the AH window open when the query is fired?

does lua require return types

in function headers

I've never used it

I just don't know if this function returns a value or not

QueryAuctionItems

looks like it doesn't?

in someone else's code they do this:

Code:
QueryAuctionItems(name, nil, nil, 0, 0, 0, Scan.tryPage, 0, 0)
Scan.eventObject:RegisterEvent("AUCTION_ITEM_LIST_UPDATE", function()
                Scan.eventObject:UnregisterEvent("AUCTION_ITEM_LIST_UPDATE")
                Scan.eventObject.frame:Show()

is the auction item list update thing sep

is it a flag

that you mark as set

and the frame checks that when it redraws?

i've never worked with this stuff but that's what i'd guess

you'd need to manually register and unregister the event

and refresh the frame

the show() call is probably doing it there

it's like with file io where you are manipulating a buffer the whole time until you sync() or flush() the buffer
You brought out SEAL Team Six?! Nice.
Those comments map onto my previous remarks probably, though the directions are fragmented they're very valuable, thank you both!
 
Last edited:
Yes, If I understand you correctly. The function is called upon opening the AH, and by the slash command - both of which should print "AH update" subsequently. You mean other than printing stuff?

I think I found it, upon looking again. I noticed it only works once, so e.g. upon every login - a detail I somehow missed and failed to check. Two things obscured it. The query has a small loading time. Furthermore, the search results displayed are wiped after changing tabs (bids, or own auctions). So, switching tabs before the results were displayed made it seem like nothing had happened, although the messages were printed. And subsequent queries via the slash command didn't actually alter the already existing results, so 'update' didn't fire.

Well, solved =) Thanks for the support!
[doublepost=1611532833,1611532187][/doublepost]
You brought out SEAL Team Six?! Nice.
Those comments map onto my previous remarks probably, though the directions are fragmented they're very valuable, thank you both!

A good way of debugging LUA (or in general really) is to take each different code block and simply try to make something happen, like printing text, to make sure you enter the statements you expect. Even if a printed text is not supposed to be there in the end product, simply place it there during development for testing, then remove it when everything works as expected.
 

Users who are viewing this thread

Top