• 0
lllaaazzz

can i hide/show items in select list

Question

using 

	switch(select("Lord Knight:Paladin")){

case 1:

case 2:

}

or any similar script

 

can i show / hide options completely?  Ive seen warper scripts grey out options when you havnt reached the 1st floor of the associated dungeon.

 

I wanna use

if (#tutorial_air2 == 0) 

 

set #tutorial_air2,1;

 

To activate warps, but i dont want them to show up on my switch(select list without me actually unlocking them with the "set #asdsd" script . . . but then i wanna be able to remove them from said list too by setting it back to 0

 

 

Hold on let me get my wallet...

 

Thank you :P 

Share this post


Link to post
Share on other sites

4 answers to this question

  • 0

If I understood correctly your question, you can left the menu entry empty and client will "count" it but not display it. Example:

.@menu$ = "Opt1:";
if (#myvar)
	.@menu$ = .@menu$ + "Opt2";
.@menu$ = .@menu$ + ":Opt3";

// So we will get one of these
// - Opt1:Opt2:Opt3
// 		In this case it shows Opt1 (case1), Opt2 (case2), Opt3(case3)
// - Opt1::Opt3 <- Note the ::
// 		In this case it shows Opt1 (case1), Opt3(case3)

switch (select(.@menu$)) {
  case 1: // Opt1
    break;
  case 2: // Opt2
    break;
  case 3: // Opt3
    break;
}

 

Share this post


Link to post
Share on other sites
  • 0
5 hours ago, AnnieRuru said:

oh wow that works? thanks 

 

On 3/8/2019 at 8:42 AM, KirieZ said:

If I understood correctly your question, you can left the menu entry empty and client will "count" it but not display it. Example:

.@menu$ = "Opt1:";
if (#myvar)
	.@menu$ = .@menu$ + "Opt2";
.@menu$ = .@menu$ + ":Opt3";

// So we will get one of these
// - Opt1:Opt2:Opt3
// 		In this case it shows Opt1 (case1), Opt2 (case2), Opt3(case3)
// - Opt1::Opt3 <- Note the ::
// 		In this case it shows Opt1 (case1), Opt3(case3)

switch (select(.@menu$)) {
  case 1: // Opt1
    break;
  case 2: // Opt2
    break;
  case 3: // Opt3
    break;
}

 

no i dont think this is it but thank you i will look at it anyways :) 

Share this post


Link to post
Share on other sites
  • 0

nonono ... KirieZ answer is almost similar to my answer on rathena forum,
sometimes we gave overly-complicated answer and members don't understand

but yeah, I suggest you should learn this trick sooner or later because one day you might wanna use it
can just test my script on the one on rathena board hercules don't have *inarray

 

function	script	F_MesItemInfo	{
	.@item = getarg(0);
	.@itemname$ = getitemname(.@item);
	if (.@itemname$ == "null")
		.@itemname$ = "Unknown Item";
	if (PACKETVER >= 20150729)
		return sprintf("<ITEM>%s<INFO>%d</INFO></ITEM>", .@itemname$, .@item);
	else if (PACKETVER >= 20130130)
		return sprintf("<ITEMLINK>%s<INFO>%d</INFO></ITEMLINK>", .@itemname$, .@item);
	else
		return .@itemname$;
}

prontera,158,185,5	script	jdshfjsdfh	1_F_MARIA,{
	getinventorylist;
	for ( .@i = 0; .@i < @inventorylist_count; ++.@i ) {
		if ( .itemidx[ @inventorylist_id[.@i] ] ) {
			.@itemid[.@c++] = @inventorylist_id[.@i];
			.@menu$ += getitemname( @inventorylist_id[.@i] ) +":";
		}
	}
	if ( !.@c ) {
		mes "You don't have any ticket on you";
		close;
	}
	.@s = select( .@menu$ ) -1;
	mes "You have selected "+ F_MesItemInfo(.@itemid[.@s]);
	close;
OnInit:
	setarray .@itemlist[1], 909,910,911,912, 34993,34994,34995,34996;
	.@size = getarraysize(.@itemlist);
	for ( .@i = 1; .@i < .@size; ++.@i )
		.itemidx[ .@itemlist[.@i] ] = .@i;
	end;
}

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now