Jump to content
  • 0
Sign in to follow this  
astralprojection

Item Bound (All Items)

Question

i plan to make all items in inventory account bound with this code, my
problem now is that, If 2 same items found (example: 2 gloves_) only 1
gloves_ is bounded, the other is not.  Can somebody help me with this
routine?  Thanks

 

//account bound all items.@boundtype = 1;getinventorylist();for(.@i = 0; .@i < @inventorylist_count; .@i++) {   delitem2 @inventorylist_id[.@j],@inventorylist_amount[.@j],@inventorylist_identify[.@j],@inventorylist_refine[.@j],@inventorylist_attribute[.@j],@inventorylist_card1[.@j],@inventorylist_card2[.@j],@inventorylist_card3[.@j],@inventorylist_card4[.@j];   getitembound2 @inventorylist_id[.@j],@inventorylist_amount[.@j],@inventorylist_identify[.@j],@inventorylist_refine[.@j],@inventorylist_attribute[.@j],@inventorylist_card1[.@j],@inventorylist_card2[.@j],@inventorylist_card3[.@j],@inventorylist_card4[.@j],.@boundtype;   .@j++;}

 

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Well, for one your using ' .@i ' in your loop. But in the commands delitem2 and getitembound2 your using ' .@j '. I'm going to assume your only testing this with 2 items in your inventory. If this is the case then only 1 item is going to be bound, since .@j has a value of zero and never get's increased.

 

TL;DR: change all .@j  to .@i or vice-versa

Share this post


Link to post
Share on other sites
  • 0

If you'll look closer, he has .@j++ in the end of loop. That means both .@j and .@i bear the same value, and it goes through all items, even if I miss the reason for 2 variables in the first place. The thing is, I guess the problem lies within delitem2. When there are 2 of same item ( 1 and 2) it deletes 1, creates bound 1, but on next run it deletes the bound 1, and creates it bound again, thus not touching the 2 item at all. I'm a bit at loss on how you can delete a specific item. Maybe if first run all-delete, and then all add-in bound again? (Separate delete and getbound into 2 different loops). That'll take 2 loops, but without editing source of delitem I don't see a way to do it otherwise.

Edited by Garr

Share this post


Link to post
Share on other sites
  • 0

@Garr - Didn't see the .@j++ at the end. But yes, in order to fix this, he would need to run 2 separate loops, 1 to delete all items and the second to give them back bound. At least this is the simplest way to do it.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.