Jump to content
  • 0
banhelba2019

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

Recommended Posts

  • 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

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

×
×
  • Create New...

Important Information

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