Jump to content
  • 0

Question

Posted
	set .@menu$, "";
	set .@a, .orbs[0];
	while((set(.@a,.@a+1)-1)<=.orbs[1])
		if(getiteminfo(.@a-1,2)>-1)
			if(set(.@c,countitem(.@a-1))) {
				set .@menu$, .@menu$+getitemname(.@a-1)+" x"+.@c+":";
				set .@b,.@b+1; set .@item[.@b], .@a-1;
			}
			
	if(.@menu$=="") {
		mes .npc$;
		mes "Hmm, you don't seem to have any enchantment orbs.";
		close;
	}

	mes .npc$;
	mes "Please, select an enchantment from the menu."; next;
	select(.@menu$);
	set .@itm, .@item[@menu];
    
    
    setarray .orbs,	4702,4712,4722,4732,4742,4752,4767,4834; 

 

7 answers to this question

Recommended Posts

  • 1
Posted

Hi

	set .@menu$, "";
	for (.@i = 0; .@i < getarraysize(.orbs); .@i++) {
		.@qty = countitem(.orbs[.@i]);
		if (.@qty)
			.@menu$ += getitemname(.orbs[.@i])+" x"+.@qty+":";
		else
			.@menu$ += ":";
	}

	if(.@menu$=="") {
		mes .npc$;
		mes "Hmm, you don't seem to have any enchantment orbs.";
		close;
	}

	mes .npc$;
	mes "Please, select an enchantment from the menu."; next;
	select(.@menu$);
	set .@itm, .orbs[@menu-1];
    
OnInit:
	setarray .orbs,	4702,4712,4722,4732,4742,4752,4767,4834;
	end;

 

  • Upvote 1
  • 1
Posted
On 4/11/2023 at 9:27 AM, Racaae said:

Hi

	set .@menu$, "";
	for (.@i = 0; .@i < getarraysize(.orbs); .@i++) {
		.@qty = countitem(.orbs[.@i]);
		if (.@qty)
			.@menu$ += getitemname(.orbs[.@i])+" x"+.@qty+":";
		else
			.@menu$ += ":";
	}

	if(.@menu$=="") {
		mes .npc$;
		mes "Hmm, you don't seem to have any enchantment orbs.";
		close;
	}

	mes .npc$;
	mes "Please, select an enchantment from the menu."; next;
	select(.@menu$);
	set .@itm, .orbs[@menu-1];
    
OnInit:
	setarray .orbs,	4702,4712,4722,4732,4742,4752,4767,4834;
	end;

 

 

well it would skip if(.@menu$=="") since the generated string in variable .@menu$ would be like "::::::::" depending of size of the orbs. 

	set .@menu$, "";
	for (.@i = 0; .@i < getarraysize(.orbs); .@i++) {
		.@qty = countitem(.orbs[.@i]);
		if (.@qty) {
			.@avail = 1;
			.@menu$ += getitemname(.orbs[.@i])+" x"+.@qty+":";
		}
		else
			.@menu$ += ":";
	}

	if(!.@avail) {
		mes .npc$;
		mes "Hmm, you don't seem to have any enchantment orbs.";
		close;
	}

 

  • Upvote 1
  • 0
Posted

i want exactly on the setarray .orbs to be exactly selected

as for now its taking a range for example these first two 4702,4712 (this covers 4702,03,04,05,06,07,08,09,10,11,12)

  • 0
Posted

you mean it should go like +1 step at a time?

4702 - 4711 ( then continue get .orbs[1] until .orbs[2] ) is that right??

setarray .orbs,	4702,4712,4722,4732,4742,4752,4767,4834; 

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...