• 0
ShiroNaito

R> Item Exchanger

Question

Good day 😄 ..I would like to request an Item Exchanger that uses array script .. This is how it will work 

 

The NPC will only recognize 3 items (501 502 503)

when I click the NPC the recognize item will appear as menu ..

If I chose 501 the NPC will exchange it for item 601 , if I chose 502 the NPC will exchange it for item 602 ..so on 

 

thanks

Share this post


Link to post
Share on other sites

5 answers to this question

Recommended Posts

  • 0
2 hours ago, ShiroNaito said:

Good day 😄 ..I would like to request an Item Exchanger that uses array script .. This is how it will work 

 

The NPC will only recognize 3 items (501 502 503)

when I click the NPC the recognize item will appear as menu ..

If I chose 501 the NPC will exchange it for item 601 , if I chose 502 the NPC will exchange it for item 602 ..so on 

 

thanks

Please give this a try, i hope this is what you're looking for.
 

prontera.gat, 155, 185, 4	script	Exchanger Board	4_BOARD3,{
	.@menu = select( 
		(countitem(501)?"- Exchange with "+getitemname(501)+"":""),
		(countitem(502)?"- Exchange with "+getitemname(502)+"":""),
		(countitem(503)?"- Exchange with "+getitemname(503)+"":""),
		"- Nothing"
		);
	switch(.@menu) {
	case 1:
		getitem 607,1;
		break;
	case 2:
		getitem 608,1;
		break;
	case 3:
		getitem 616,1;
		break;
	default:
		mes "[ Exchanger ]";
		mes "There's nothing i can do for you.";
		mes " ";
		mes "Please come back to me later!";
		break;
	}
	end;
}

 

Share this post


Link to post
Share on other sites
  • 0
12 minutes ago, Royr said:

Please give this a try, i hope this is what you're looking for.
 

prontera.gat, 155, 185, 4	script	Exchanger Board	4_BOARD3,{
	.@menu = select( 
		(countitem(501)?"- Exchange with "+getitemname(501)+"":""),
		(countitem(502)?"- Exchange with "+getitemname(502)+"":""),
		(countitem(503)?"- Exchange with "+getitemname(503)+"":""),
		"- Nothing"
		);
	switch(.@menu) {
	case 1:
		getitem 607,1;
		break;
	case 2:
		getitem 608,1;
		break;
	case 3:
		getitem 616,1;
		break;
	default:
		mes "[ Exchanger ]";
		mes "There's nothing i can do for you.";
		mes " ";
		mes "Please come back to me later!";
		break;
	}
	end;
}

 

Hi thankyou for your fast response sir ...is it not possible to make it like this

 

setarray [email protected], 501,502,503;

setarray [email protected], 601,602,603;

 

If i pick item 501 it will automatically exchange to 601 so on so on ....

Share this post


Link to post
Share on other sites
  • 0
1 hour ago, dev LOOLP said:
Redone and functional!

:) Good use.

exchanger.txt 1.27 kB · 2 downloads

Hi sir thankyou for patiently helping me ..didnt tried it yet but I appreciate your effort ..can I ask if is it possible to check the refine of item 501 and transter it on item 601 ... Example I have Jur +10 and I want to transfer it on Spec Jur to make it +10 upon exchanging? Thankyou sir !!!!!! ❤️

Share this post


Link to post
Share on other sites
  • 0

Repute please 🙂

yes, but it's more complicated .. some tests are needed to avoid bug's .. and I don't have time to test all possible situations ..

I hope someone will use my code as a base and apply what you want, but it is not difficult .. if you want something more detailed, look for me in PM that we can see somehow.
 

Share this post


Link to post
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.

Loading...