• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Our weekly protagonist poll is now up! Vote for your favorite Trading Card Game 2 protagonist in the poll by clicking here.
  • 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
    5
    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...
     
    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