viewing paste Learning to script! | Athena

Posted on the
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
<header> {
    while(1) {  // Keep looping through until user hits "Leave" or the cancel button
        mes "[Information]";
        mes "Welcome to GraffitiRO!";
        next;   // Puts up a 'next' button, clears text from window
        
        // switch(<number>) {}
        // Based on the number you give (always a variable), go to the "case" number.
        
        // select(<options>)
        // Returns the number of the option you chose.
        // A colon, :, will separate choices.
        
        switch(select("What do I do now?:What are the rules?:Tell me about the server.:Leave")) {
            case 1:
                mes "[Information]";
                mes "Kill some Porings, then warp to Prontera using '@go 0'!";
                next;
                break// Break from the "switch" statement... and since you have while(1) written up top, loop back to the beginning.
            case 2:
                mes "[Information]";
                mes "Nope, nothing here!";
                next;
                break;
            case 3:
                mes "[Information]";
                mes "Too lazy to type here, go visit our website instead";
                next;
                break;
            case 4:
                close// Closes the window
        }
    }
}
Viewed 732 times, submitted by Guest.