Jump to content
  • 0

Is a choice/switch select + multiple variables + adding them together possible


Naruto

Question


  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.01
  • Content Count:  416
  • Reputation:   73
  • Joined:  05/16/19
  • Last Seen:  

Ill pay whoever writes it... I mean i can see something working but maybe someone can write it up in 2 minutes for ez money for me

I wanna be able to do this 

 

				warp "hu_fild05",184,204;

but split the word hu_fild05 into 3 parts like so

				warp "[A][B][C]",184,204;

 

in order to get A B and C you must use this Or..... 

D = A + B + C

				warp "[D]",184,204;

 

        switch( select( "Part A","Part B", "Part C") ) {
                        Case 1:
                                  Switch select again....

                               return A = hu_

                       Case 2:

                                 switch select again

                            Return B = fild

                       case 3:

                                    switch select again...

                            Return C=05

}

 

so after you pick all 3 in all the menus... 

D should equal ABC so thats "hu_""fild""05" hufild_05

and then they would send D to warp

				warp "[D]",184,204;

 

 

 

can someone write this up for me or should i just keep playing with it ?  ty /lv 

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 1

  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

? maybe :

alberta,97,53,0	script	Fabian2	84,{
	setarray .@sub_string_1$[0], "pay_", "moc_", "cmd_";
	setarray .@sub_string_2$[0], "fild", "dun";
	setarray .@sub_string_3$[0], "00", "01", "02";

	setarray .@menu_list_1$[0], "Apple", "Banana", "Orange";
	setarray .@menu_list_2$[0], "Cat", "Dog";
	setarray .@menu_list_3$[0], "Eat the", "Steal the", "Dream of";

	.@s[1] = select( implode(.@menu_list_1$, ":") ) -1;
	.@s[2] = select( implode(.@menu_list_2$, ":") ) -1;
	.@s[3] = select( implode(.@menu_list_3$, ":") ) -1;

	mes "Do you really want to go where the " + .@menu_list_2$[ .@s[2] ] + " " + .@menu_list_3$[ .@s[3] ] + " " + .@menu_list_1$[ .@s[1] ] + "?";
	next;
	if (select("No", "Yes") == 1)
		close;
	.@map_name$ = .@sub_string_1$[ .@s[1] ] + .@sub_string_2$[ .@s[2] ] + .@sub_string_3$[ .@s[3] ];

	// a list of available map should be created to prevent console message about unknown map
	warp .@map_name$,0,0;
	end;
}

 

  • Like 1
Link to comment
Share on other sites

  • 0

  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

Maybe you mean that?

alberta,97,51,0	script	Fabian	84,{
	.@map$ = "hu_fild05";		// word to split
	.@step = 3;					// how many words

	.@len = getstrlen(.@map$);
	
	for ( .@start = 0; .@start < .@len; .@start += .@step ) {
		if ((.@start + .@step) < .@len)
			.@end = .@start + .@step - 1;
		else
			.@end = .@len - 1;
		.@word$[.@size] = substr( .@map$, .@start, .@end );
		.@size++;
	}

	// simple shuffle
	.@tmp_size = .@size;
	for ( .@i = 0; .@i < .@size; .@i++ ) {
		.@r = rand(.@tmp_size);
		.@tmp_word$ = .@word$[.@r];
		.@word$[.@r] = .@word$[ .@tmp_size-1 ];
		.@word$[ .@tmp_size-1 ] = .@tmp_word$;
		.@tmp_size--;
	}

	.@menu$ = implode( .@word$, ":" );
	for ( .@i = 0; .@i < .@step; .@i++ ) {
		.@s = select(.@menu$) - 1;
		.@current_word$ += .@word$[.@s];
		mes "Word: " + .@current_word$;
	}
	if (.@current_word$ == .@map$) {
		mes "Grat!";
		warp .@map$,0,0;
	}
	close;
}

 

  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.01
  • Content Count:  416
  • Reputation:   73
  • Joined:  05/16/19
  • Last Seen:  

2 hours ago, Capuche said:

Maybe you mean that?


alberta,97,51,0	script	Fabian	84,{
	.@map$ = "hu_fild05";		// word to split
	.@step = 3;					// how many words

	.@len = getstrlen(.@map$);
	
	for ( .@start = 0; .@start < .@len; .@start += .@step ) {
		if ((.@start + .@step) < .@len)
			.@end = .@start + .@step - 1;
		else
			.@end = .@len - 1;
		.@word$[.@size] = substr( .@map$, .@start, .@end );
		.@size++;
	}

	// simple shuffle
	.@tmp_size = .@size;
	for ( .@i = 0; .@i < .@size; .@i++ ) {
		.@r = rand(.@tmp_size);
		.@tmp_word$ = .@word$[.@r];
		.@word$[.@r] = .@word$[ .@tmp_size-1 ];
		.@word$[ .@tmp_size-1 ] = .@tmp_word$;
		.@tmp_size--;
	}

	.@menu$ = implode( .@word$, ":" );
	for ( .@i = 0; .@i < .@step; .@i++ ) {
		.@s = select(.@menu$) - 1;
		.@current_word$ += .@word$[.@s];
		mes "Word: " + .@current_word$;
	}
	if (.@current_word$ == .@map$) {
		mes "Grat!";
		warp .@map$,0,0;
	}
	close;
}

 

Thats getting really close but

Spoiler

also thats a good way to kick those asuras in the butt

Lets say the dialog had 3 selections...

 

selection A would be

Apple = pay_

Banana = moc_

Cat = cmd_

 

Selection B would be

Apple = _fild

Banana = _dun

 

Selection C would b

Apple = 00

Banana = 01

Cat = 02

 

 

So if you go through the dialog you pick 1 of each section

ABC Pay _fild 01

then that gets sent to the warp command at the end

 

doesnt matter if the map doesnt exist 

 

If you dont really understand its okay... youve given me enough script to work with and believe it is possible 

Edited by Naruto
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.01
  • Content Count:  416
  • Reputation:   73
  • Joined:  05/16/19
  • Last Seen:  

17 minutes ago, Capuche said:

? maybe :


alberta,97,53,0	script	Fabian2	84,{
	setarray .@sub_string_1$[0], "pay_", "moc_", "cmd_";
	setarray .@sub_string_2$[0], "fild", "dun";
	setarray .@sub_string_3$[0], "00", "01", "02";

	setarray .@menu_list_1$[0], "Apple", "Banana", "Orange";
	setarray .@menu_list_2$[0], "Cat", "Dog";
	setarray .@menu_list_3$[0], "Eat the", "Steal the", "Dream of";

	.@s[1] = select( implode(.@menu_list_1$, ":") ) -1;
	.@s[2] = select( implode(.@menu_list_2$, ":") ) -1;
	.@s[3] = select( implode(.@menu_list_3$, ":") ) -1;

	mes "Do you really want to go where the " + .@menu_list_2$[ .@s[2] ] + " " + .@menu_list_3$[ .@s[3] ] + " " + .@menu_list_1$[ .@s[1] ] + "?";
	next;
	if (select("No", "Yes") == 1)
		close;
	.@map_name$ = .@sub_string_1$[ .@s[1] ] + .@sub_string_2$[ .@s[2] ] + .@sub_string_3$[ .@s[3] ];

	// a list of available map should be created to prevent console message about unknown map
	warp .@map_name$,0,0;
	end;
}

 

yes this is what i wanted thank you .. do you have like a paypal email or something 

Link to comment
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.   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.

×
×
  • Create New...