Jump to content
  • 0

Cancel Button with script


Question

Posted

I found this

 

mes "Hit 'Cancel' Buton";
if( prompt( "Continue","Close" ) == 2 ){
	mes "It's Closed now.";
}else{
	mes "Wew..it CONTINUED.";
}
close;

How to the Cancel button redirect to another case,  if you click the "Continue" will be direct to mes "Wew..it CONTINUED."; if you click "Close" it will be direct on mes "It's Closed now."; this is fine but when you click the "Cancel Button" it will be direct to mes "Wew..it CONTINUED."; i want to go this another case like mes "You click cancel button";

 

image.png.11b753e1a0493d43c73a63fd5946a8bb.pngimage.png.dc5f70665800a91d82aa3bf6734ef4de.png

2 answers to this question

Recommended Posts

  • 1
Posted
mes "Hit 'Cancel' Buton";

switch(prompt("Bla bla", "blu blu", "Cancel"))
{
	case 1:
		mes "Blabla";
		close;

	case 2:
		mes "BluBlu";
		close;

	case 255:
		mes "Cancel button clicked!";
	case 3:
		mes "Cancel";
		close;
}


 

*select("<option>"{,"<option>",...})
  *prompt("<option>"{,"<option>",...})
   
  This function is a handy replacement for 'menu' for some specific cases where
  you don't want a complex label structure - like, for example, asking simple yes-
  no questions. It will return the number of menu option picked, starting with 1.
  Like 'menu', it will also set the variable @menu to contain the option the user
  picked.
   
  if (select("Yes:No" ) == 1)
  mes "You said yes, I know.";
   
  And like 'menu', the selected option is consistent with grouped options
  and empty options.
   
  'prompt' works almost the same as select, except that when a character clicks
  the Cancel button, this function will return 255 instead.
  • 0
Posted
3 hours ago, Zell said:
mes "Hit 'Cancel' Buton";

switch(prompt("Bla bla", "blu blu", "Cancel"))
{
	case 1:
		mes "Blabla";
		close;

	case 2:
		mes "BluBlu";
		close;

	case 255:
		mes "Cancel button clicked!";
	case 3:
		mes "Cancel";
		close;
}


 

*select("<option>"{,"<option>",...})
  *prompt("<option>"{,"<option>",...})
   
  This function is a handy replacement for 'menu' for some specific cases where
  you don't want a complex label structure - like, for example, asking simple yes-
  no questions. It will return the number of menu option picked, starting with 1.
  Like 'menu', it will also set the variable @menu to contain the option the user
  picked.
   
  if (select("Yes:No" ) == 1)
  mes "You said yes, I know.";
   
  And like 'menu', the selected option is consistent with grouped options
  and empty options.
   
  'prompt' works almost the same as select, except that when a character clicks
  the Cancel button, this function will return 255 instead.

Thanks it work

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...