• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[Custom Feature Question] Exit script? Default option? Help...

#Not Important

All hail the wishmaker
910
Posts
4
Years
  • Hi Everyone,
    Do any of you know how to end a script from inside the script?
    Spoiler:

    And how to give a default option when "X" is clicked?
    Spoiler:

    Pls help...
     

    Ego13

    hollow_ego
    311
    Posts
    6
    Years
  • What exactly is it that you are trying to do?
    And what do you mean by "ending a script from inside a script"?

    On this part with the loop, if you want to stop it from going back to the question after choosing "no", you need to put a break statement. To have a default value you put in a check for -1.

    Like this:
    Code:
    loop do
              command=Kernel.pbShowCommands(nil,[
              _INTL("No"),
              _INTL("Yes")
              ],command)
              case command
              when 0
                Kernel.pbMessage("Left it alone...")
                break
              when 1
                break
              when -1
               # your default code here
               break
              end
            end
     
    Back
    Top