Quote:
Originally Posted by adam
Oh, I see a little better now. Your making an auction house dealy?
I follow the recommendation, use .'s instead of _'s
I don't like how you have the string stored, but if I were forced to, I might search the categories like this. Untested, but i've done things like this in the past.
PHP Code:
public function getCategoryListing(temp.category){
clearemptyvars();
temp.list = {};
for (temp.acnt: this.item.(@temp.category).getdynamicvarnames() ){
for (temp.item: this.item.(@temp.category).(@temp.acnt).getdynamicvarnames() ){
temp.v = this.item.(@temp.category).(@temp.acnt).(@temp.item);
temp.list.add({ temp.item, temp.v[0], temp.acnt, temp.v[3] });
}
}
return temp.list;
}
|
could you explain this? I'd rather learn, so I dont have to post so many threads for help. Im really not sure what too many of this does, just by looking at it, and not too sure on how to use it. Im guessing its a function that goes in the dbnpc script, and I call it to show up the items for the category selected, but if an explanation line by line is possible with comments or something, that would be great.
