Jump to content
  • 0
Sign in to follow this  
Alexandria

some questions about adding a new custom selection

Question

Hello there.

 

I would like to add another selection to this code:

 

http://pastebin.com/LMWcLWQ8

 

Something like this:

 

if (select("Yes~ Let's start now.:New custom here.:No, I'll be back later.") == 1) {

 

But where should my code go when the user choose "New Custom here"?

 

And also, what does == 1 mean?

 

Thank you.
 

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 0

prontera,150,150,5    script    asdf    100,{if (select("Yes~ Let's start now.:No, I'll be back later.") == 1) {    mes "This is ==1"; // Yes~ Let's start now.    close;}    mes "This is ==2"; //No, I'll be back later.    close;}

why not use something like this:

switch (select("Yes~ Let's start now.:New custom here.:No, I'll be back later.")) {    case 1:    if(checkquest(4000) == -1) setquest 4000;		  mes "[Hunter Sherin]";		  mes "Listen carefully to the scenarios I describe. When I ask a question, you choose an answer. Pretty simple, don't you think?";		  next;		  mes "[Hunter Sherin]";		  mes "I just want to know how you think about life, and why you want to become a Hunter, so there's no need to be nervous.";		 close;              case 2: //New custom here        case 3:        mes "[Hunter Sherin]";		  mes "Okay...";		  mes "Come back";		  mes "when you're ready~";		  close;}

I always use switch select if i have 3 or more items in one menu. if select if two.

Edited by quesoph

Share this post


Link to post
Share on other sites
  • 0

Use a variable

 

if (select("Yes~ Let's start now."+.@Var$+":No, I'll be back later.") == 1) {

 

As far as I know == means is equals to in C Language

Edited by ぽろり

Share this post


Link to post
Share on other sites
  • 0

you can view it like this way

select( 	"option 1",		//	select() return 1	"option 2",		//	select() return 2	"option 3",		//	select() return 3	"Cancel"		//	select() return 4);

the IF-ELSE in your case is just used to check which option is selected by the users.  the value is determined by the [wiki=select] which return 1,2,3,4......etc ...

 

 

and, it's easier to view if you using "," to separate each option for the menu.

Share this post


Link to post
Share on other sites
  • 0

you can view it like this way

select( 	"option 1",		//	select() return 1	"option 2",		//	select() return 2	"option 3",		//	select() return 3	"Cancel"		//	select() return 4);

the IF-ELSE in your case is just used to check which option is selected by the users.  the value is determined by the [wiki=select] which return 1,2,3,4......etc ...

 

 

and, it's easier to view if you using "," to separate each option for the menu.

 

Can you tell me where should my code go? Im talking in base on my script:

 

http://pastebin.com/LMWcLWQ8

 

Thank you.

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.