Jump to content
  • 0

removing the duplicate result


Question

Posted

Hello guys. I am creating a selection scripts and I would like to know how to remove duplicate results from the list.

prontera,154,150,5	script	SampleTest	123,{
	
	.@bonus0 = 1;	// Reflect 10% Short-Range Damage
	.@bonus1 = 3;	// Reduce 10% Aftercast Delay
	.@bonus2 = 0;
	.@bonus3 = 0;

	setarray .@ItemBonus$[0],
		"Reflect 10% Short-Range Damage",1100000,7561,690,1063,730,
		"8 Mdef",1500000,7118,275,7162,700,
		"Reduce 10% Aftercast Delay",1700000,7567,500,1036,800,
		"Full HP/SP on Resurrection",2000000,951,730,7149,750,
		"10% Damage more with Shield Chain",2000000,7194,580,7215,890,
		"10% Increase Healing Power",1400000,6032,400,1096,790,
		"Uninterruptable Cast",1400000,7125,400,7263,480,
		"Increase Holy and Grand Cross Damage by 20%",2000000,7223,300,7215,900,
		"Indestructible",1400000,6023,380,7197,800;

	mes "Sample";

	for (.@i=0; .@i<getarraysize(.@ItemBonus$); .@i=.@i+6){
		for (.@k=0; .@k<4; .@k++){
			if (getd(".@bonus"+ .@k)){
				if (.@ItemBonus$[(getd(".@bonus"+ .@k)-1)*6] != .@ItemBonus$[.@i]){
					if (getd(".@dup"+ (.@i/6) +"$") != .@ItemBonus$[.@i]){
						mes "~ "+ .@ItemBonus$[.@i];
					}
				}
				setd(".@dup"+ (.@i/6) +"$", .@ItemBonus$[.@i]);
			}
		}
	}

	close;
}

If I run this script the bonus 1 will be remove from the list but when the selection continue the bonus 2 is still showing up from the list. Its like to bonus 2 onwards is not being recognize by this script. I want the bonus 1 and 2 not appear from the list.

Its like removing the duplicate result.

 

Thanks in advance.

1 answer to this question

Recommended Posts

  • 0
Posted

I think is it, you want to do:

Spoiler

prontera,154,150,5	script	SampleTest	123,{
	
	.@bonus0 = 1;	// Reflect 10% Short-Range Damage
	.@bonus1 = 3;	// Reduce 10% Aftercast Delay
	.@bonus2 = 2;	// 8 Mdef
	.@bonus3 = 8;	// 10% Damage more with Shield Chain
	.@bonus4 = 5;	// Increase Holy and Grand Cross Damage by 20%

	setarray .@ItemBonus$[0],
		"Reflect 10% Short-Range Damage",1100000,7561,690,1063,730,
		"8 Mdef",1500000,7118,275,7162,700,
		"Reduce 10% Aftercast Delay",1700000,7567,500,1036,800,
		"Full HP/SP on Resurrection",2000000,951,730,7149,750,
		"10% Damage more with Shield Chain",2000000,7194,580,7215,890,
		"10% Increase Healing Power",1400000,6032,400,1096,790,
		"Uninterruptable Cast",1400000,7125,400,7263,480,
		"Increase Holy and Grand Cross Damage by 20%",2000000,7223,300,7215,900,
		"Indestructible",1400000,6023,380,7197,800;

	mes "Sample";

	for(set .@i, 0; .@i < getarraysize(.@ItemBonus$); set .@i, .@i + 6)
	{
		for(set .@j, 0; getd(".@bonus" + .@j) > 0; set .@j, .@j + 1)
		{
			if (.@ItemBonus$[(getd(".@bonus" + .@j) - 1) * 6] == .@ItemBonus$[.@i])
			{
				setd ".@dup"+ (.@i / 6) +"$", .@ItemBonus$[.@i];
				break;
			}
		}

		if (getd(".@dup"+ (.@i / 6) +"$") != .@ItemBonus$[.@i])
			mes "~ "+ .@ItemBonus$[.@i];
	}

	close;
}

 

 

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