Jump to content
  • 0

How to filter getinventorylist


jawbreaker

Question


  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  68
  • Reputation:   1
  • Joined:  06/21/14
  • Last Seen:  

	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?

 

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  91
  • Reputation:   22
  • Joined:  10/24/14
  • Last Seen:  

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
Link to comment
Share on other sites

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.

×
×
  • Create New...