Jump to content
  • 0
Sign in to follow this  
astralprojection

Menu Pagination (Is it possible?)

Question

prontera,125,93,5	script	test_girl	1_F_MARIA,{
	mes "[List Card]";
	mes "Please select from "+getarraysize(.cards)+" cards";
	.@s = select(.menu$) -1;
	mes "You selected: "+getitemname(.cards[.@s]);
	close;
OnInit:
	setarray .cards, 4244,4253,4252,4245,4032,4062,4248,4249,4043,4013,4018,4234,4344,4160,4243,4138,4242,4094,4240,4114,4075,4347,4246,4247,4233,4129,4119,4356,4074,4215,4327,4320,4214,4212,4213,4229,4063,4288,4290,4289,4284,4285,4009,4202,4299,4041,4015,4293,4235,4061,4153,4296,4040,4298,4297,4272,4170,4171,4133,4279,4173,4023,4082,4125,4122,4182,4181,4098,4178,4069,4180,4004,4177,4176,4056,4070,4251,4052,4360,4349,4262,4141,4267,4002,4316,4020,4080,4158,4319,4088,4312,4151,4152,4149,4323,4280,4110,4271,4270,4278,4087,4165,4150,4157,4060,4155,4072,4161,4283,4355,4162,4164,4325,4362,4331,4322,4345,4081,4045,4019,4103,4115,4035,4328,4321,4231,4269,4268,4239,4116,4109,4139,4065,4287,4286,4366,4351,4136,4301,4307,4140,4292,4091,4291,4295,4027,4184,4195,4188,4265,4217,4191,4193,4006,4364,4076,4201,4030,4079,4105,4112,4196,4055,4084,4113,4095,4046,4097,4124,4200,4067,4199,4341,4057,4205,4339,4204,4126,4208,4317,4343,4036,4106,4090,4108,4206,4167,4127,4166,4159,4334,4093,4338,4256,4255,4085,4066,4071,4237,4310,4309,4099,4031,4007,4314,4311,4315,4120,4118,4077,4329,4011,4008,4073,4335,4024,4048,4175,4033,4337,4005,4001,4313,4003,4294,4083,4186,4350,4187,4353,4104,4154,4185,4021,4014,4192,4194,4219,4101,4216,4017,4078,4068,4326,4358,4368,4273,4230,4117,4222,4092,4025,4221,4228,4044,4037,4100,4059,4086,4220,4022,4227,4039,4223,4156,4042,4224,4226,4225,4111,4218,4089,4304,4028,4340,4282,4058,4172,4016,4012,4026,4050,4308,4336,4049,4333,4107,4209,4053,4211,4210,4332,4348,4303,4102,4258,4232,4257,4010,4264,4029,4259,4261,4260,4034,4190,4189,4346,4051,4096,4064,4277,4281,4038,4274,4275;
	for (.@i = 0; .@i < getarraysize(.cards); ++.@i)
		.menu$ += "^FF0000[ "+( .@i+1 )+". ]^0000FF "+getitemname(.cards[.@i]) +":";
	end;
}

Is it possible to make pagination on these menu? as you can see I have more than 300 entries and wanted to add those to menu.
 

Share this post


Link to post
Share on other sites

5 answers to this question

Recommended Posts

  • 0

Hey, this is one way to do it.

 

Spoiler

prontera,125,93,5	script	test_girl	1_F_MARIA,{

	setarray .@cards, 4244,4253,4252,4245,4032,4062,4248,4249,4043,4013,4018,4234,4344,4160,4243,4138,4242,4094,4240,4114,4075,4347,4246,4247,4233,4129,4119,4356,4074,4215,4327,4320,4214,4212,4213,4229,4063,4288,4290,4289,4284,4285,4009,4202,4299,4041,4015,4293,4235,4061,4153,4296,4040,4298,4297,4272,4170,4171,4133,4279,4173,4023,4082,4125,4122,4182,4181,4098,4178,4069,4180,4004,4177,4176,4056,4070,4251,4052,4360,4349,4262,4141,4267,4002,4316,4020,4080,4158,4319,4088,4312,4151,4152,4149,4323,4280,4110,4271,4270,4278,4087,4165,4150,4157,4060,4155,4072,4161,4283,4355,4162,4164,4325,4362,4331,4322,4345,4081,4045,4019,4103,4115,4035,4328,4321,4231,4269,4268,4239,4116,4109,4139,4065,4287,4286,4366,4351,4136,4301,4307,4140,4292,4091,4291,4295,4027,4184,4195,4188,4265,4217,4191,4193,4006,4364,4076,4201,4030,4079,4105,4112,4196,4055,4084,4113,4095,4046,4097,4124,4200,4067,4199,4341,4057,4205,4339,4204,4126,4208,4317,4343,4036,4106,4090,4108,4206,4167,4127,4166,4159,4334,4093,4338,4256,4255,4085,4066,4071,4237,4310,4309,4099,4031,4007,4314,4311,4315,4120,4118,4077,4329,4011,4008,4073,4335,4024,4048,4175,4033,4337,4005,4001,4313,4003,4294,4083,4186,4350,4187,4353,4104,4154,4185,4021,4014,4192,4194,4219,4101,4216,4017,4078,4068,4326,4358,4368,4273,4230,4117,4222,4092,4025,4221,4228,4044,4037,4100,4059,4086,4220,4022,4227,4039,4223,4156,4042,4224,4226,4225,4111,4218,4089,4304,4028,4340,4282,4058,4172,4016,4012,4026,4050,4308,4336,4049,4333,4107,4209,4053,4211,4210,4332,4348,4303,4102,4258,4232,4257,4010,4264,4029,4259,4261,4260,4034,4190,4189,4346,4051,4096,4064,4277,4281,4038,4274,4275;
	.@page_size = 30;
	.@array_size = getarraysize(.@cards);
	.@page_count = (.@array_size / .@page_size) + ((.@array_size % .@page_size) > 0 ? 1 : 0);
	.@my_page = 1;
	.@limit[0] = 0;
	.@limit[1] = .@limit[0] + .@page_size;
	.@npc_name$ = "[List Card]";
	.@diff = .@page_size;

	if (.@limit[1] > .@array_size)
	{
		.@diff = .@page_size - (.@limit[1] - .@array_size);
		.@limit[1] = .@array_size;
	}

	mes .@npc_name$;

	while(true)
	{
		mes "Please select from " + .@array_size + " cards.";
		mes "Page " + .@my_page + "/" + .@page_count + "";
		.@menu$ = "";

		for(.@i = .@limit[0]; .@i < .@limit[1]; .@i++)
		{
			.@menu$ += "^FF0000[ " + (.@i + 1) + ". ]^0000FF " + getitemname(.@cards[.@i]) + ":";
		}

		.@menu$ += ((.@limit[1] >= .@array_size) ? "" : "Next") + ":" + ((.@limit[0] == 0) ? "" : "Back") + ":Cancel";
		.@seleted = select(.@menu$);

		next;
		mes .@npc_name$;

		// 'Next' option
		if (.@seleted == .@diff + 1)
		{
			.@limit[0] = .@limit[1];
			.@limit[1] += .@page_size;
			.@my_page++;

			if (.@limit[1] > .@array_size)
			{
				.@diff = .@page_size - (.@limit[1] - .@array_size);
				.@limit[1] = .@array_size;
			}
			else
			{
				.@diff = .@page_size;
			}
		}
		// 'Back' option
		else if (.@seleted == .@diff + 2)
		{
			.@limit[0] -= .@diff + ((.@diff != .@page_size) ? (.@page_size - .@diff) : 0);
			.@limit[1] -= .@diff;
			.@my_page--;

			if (.@limit[0] < 0)
				.@limit[0] = 0;

			if (.@limit[1] < .@page_size)
				.@limit[1] = .@page_size;

			.@diff = .@page_size;
		}
		// 'Cancel' option
		else if (.@seleted == .@diff + 3)
		{
			mes "Ok, back when you need me.";
			break;
		}
		// Card selected
		else
		{
			.@i = .@limit[0] + .@seleted - 1;

			mes "You selected: " + getitemname(.@cards[.@i]) + "";
			break;
		}
	}

	close;
}

 

 

Share this post


Link to post
Share on other sites
  • 0
1 hour ago, astralprojection said:

its for my Armory script. you may visit classicro.net . you can create new account and .
1. free 99/70 trans class
2. free complete armor with cards

only 1 per account. 
 

i see the script still incomplete

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

  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...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.