can i hide/show items in select list

banhelba2019

New member
Messages
200
Points
0
Emulator
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) 



Code:
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  

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

Code:
.@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;
}
 
oh wow that works? thanks 

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 :)  

 
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

Code:
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;
}
 
Back
Top