Help - Search - Members - Calendar
Full Version: OnApproachVendor missing items
AC Tools Everything Macro > Other Scripting Tools > Skunkworks
DragonSpike
I have been having trouble with OnApproachVendor. When it fires, the handler tries to look at both acoMerchant.citemContents or the coaco but they turn up empty. More specifically, acoMerchant.citemContents and coaco.Count are both zero.

To make sure I didn't miss something, just copied the t.js and modified the OnApproachVendor handler to print out the contents of the items and the above collections kept coming back empty. I also tried acoMerchant.coacoContents to see if I could get anything but to no avail.

Am I missing something?

Thanks,
D
GKusnick
acoMerchant.coacoContents and .citemContents will not tell you anything useful. Those ACO properties apply only to yourself (with your main pack inventory as the contents) or to container items like chests or backpacks. A merchant is not a container; instead its item catalog is delivered via the coaco parameter to OnApproachVendor. For me, that appears to be working correctly, i.e. the collection is non-empty and contains the expected items.
DragonSpike
Ok, this is strange. Below is the handler for OnApproachVendor:
CODE
function MyHandlers_OnApproachVendor(acoMerchant, mcmBuy, cpyMaxBuy, fractBuy, fractSell, coaco) {
skapi.OutputLine("Item count: " + coaco.Count);
}


I get "Item count: 0" as the output. Everything else in the file is a copy of the t.js file except for this handler. I just don't know why every vendor I have tried in Shoushi is coming back with the zero count.

What's strange is that everything else seems to be working fine in my original script except the vendor thing. Greg, thanks for your response and I will continue to look into this but I thought isolating everything except the above handler from the t.js file would rule out everything but the handler. I wonder if I missed something in the installation but...

D
GKusnick
Is this a new installation of SkunkWorks? Have you applied the latest patch from the sticky thread?
DragonSpike
QUOTE(GKusnick @ May 3 2009, 03:29 PM) *
Is this a new installation of SkunkWorks? Have you applied the latest patch from the sticky thread?




That was it Greg! For some reason I thought the latest installation already had the skapi.dll updated. It was a wrong assumption. Things are working like a charm now. Thanks a ton!

D
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.