I'm going to have to take another look at that code thez because my knowledge isn't that great and I'm having problems completely understanding your code (I think I understand it, but bear with me as I break it down). A lot of times it just helps me to write out what exactly is going on:
Code:
if (findItem[itemname].stackable
ok no problem -- this will scheck to see if you have the item and if it's stackable
Code:
&& (finditem[itemname].StackSize
this will return the max stack size, correct? In other words, usually 20 or 100
Code:
> ((finditemcount[itemname]
this will return how many of the stack we currently have (and the > will make sure it's less than max stack)
Code:
% finditem[itemname].StackSize) + number of that item coming in))
ok here's where I'm really stupid (at least I admit it). I have no idea what % does in this case. I feel like an idiot because normally I would research this and figure it out myself to save some face, but I don't have my links on the new computer and I have about a billion other things to do first. I don't get what the difference is between finditemcount[itemname] and finditem[itemname].StackSize ... does that handle multiple stacks? In other words, if the item count is 39 (for an item that's only stackable to 20), does that reutrn 19 or 1?
EDIT: ok so I looked it up and I found that % will return remainder, correct? In other words, in my expample it will return 1 correct? [/EDIT]
Here's what I have so far (in quasi-code). Once the plugin makes it through the trade checks and decides it's time to do the trade, it then:
Code:
for tradeslotloop = 9 to 18
{read each slot
if item received place in itemsreceived array
totalitems received++
}
At which point, I know how many items are coming in (I'll have to change this in the future to read the number of the stacked items). Then:
Code:
Check Inventory (find out how much inv space I have)
If Inventory < itemsreceived then do stackable items check (this is the part I'm working on atm)
else do trade (since we have the inventory room
What I'm thinking for the stackable items check is:
Code:
for loop = 1 to items received {
check to see which items are stackable
compare stackable items to FreeStack
if stackableitems received <= FreeStack then totalitemsreceived - 1}
At whcih point, I should be able to run Inventory check again and if Inventory => items reveiced then we can do the trade. Of course somewhere in there I'd have to spit out the report (if I could) to say how many of which items I can receive. The only problem I have with that is the fact that since this plugin refreshes every time MQ2 pulses that the report would come back multiple times. I think I'll figure it out though.
Sorry for the long post, but like i said sometimes it helps me to just psuedocode it like this to figure out what the hell I'm thinking.