Jump to content
  • 0

How to filter getinventorylist


Question

Posted
	getinventorylist;
	.@i = 0;
	while ( .@i < @inventorylist_count ) {
	
		/* Filter only items that is not bound */
		if (!@inventorylist_bound[.@i]){
			.@itemname$ = callfunc( "getitemname2", @inventorylist_id[.@i], @inventorylist_identify[.@i], @inventorylist_refine[.@i], @inventorylist_attribute[.@i], @inventorylist_card1[.@i], @inventorylist_card2[.@i], @inventorylist_card3[.@i], @inventorylist_card4[.@i], @inventorylist_bound[.@i]);
			.@menu$ = .@menu$ + @itemname2_info$ + .@itemname$ +":";
		}
		.@i++;
	}
	.@s = select(.@menu$) -1;
	
	/* Now display ItemID of selected inventory */
	mes "You have selected "+@inventorylist_id[.@s];  // this did not return correct info because it reads [.@s] index from getinventorylist but not the filtered menu.
	

im trying to make menu of items in my inventory excluding the bound items.  When select the menu, how to point it to my inventorylist?

 

1 answer to this question

Recommended Posts

  • 0
Posted (edited)
On 12.3.2018 at 10:14 AM, jawbreaker said:

if (!@inventorylist_bound[.@i]){

.@itemname$ = callfunc( "getitemname2", @inventorylist_id[.@i], @inventorylist_identify[.@i], @inventorylist_refine[.@i], @inventorylist_attribute[.@i], @inventorylist_card1[.@i], @inventorylist_card2[.@i], @inventorylist_card3[.@i], @inventorylist_card4[.@i], @inventorylist_bound[.@i]);

.@menu$ = .@menu$ + @itemname2_info$ + .@itemname$ +":";

}

Hmm, add also the empty in the menu so it will be properly skipped and keep the index number:

.@i = 0;
while ( .@i < @inventorylist_count ) {

	/* Filter only items that is not bound */
	if (!@inventorylist_bound[.@i]){
		.@itemname$ = callfunc( "getitemname2", @inventorylist_id[.@i], @inventorylist_identify[.@i], @inventorylist_refine[.@i], @inventorylist_attribute[.@i], @inventorylist_card1[.@i], @inventorylist_card2[.@i], @inventorylist_card3[.@i], @inventorylist_card4[.@i], @inventorylist_bound[.@i]);
		.@menu$ = .@menu$ + @itemname2_info$ + .@itemname$;
	}
	.@menu$ = .@menu$ + ":";
	.@i++;
}
.@s = select(.@menu$) -1;

 

Edited by Sehrentos

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...