Using the CASE command is a much quicker alternative to lots of “nested” IF scripts. This example shows you how to set up a phone where you can dial different numbers and get different responses
I have made an object called telephone and added a Verb called Start Dialling:
I then add a ‘Print Message Script to the Verb to give a message with clear instructions:
Next Add the verb to the Display verbs:
Next I add a Command to the Room. The reason I do this is because I can “Dial” the number any time at all.
I click on Room and then press Add and Command:
In the empty box below I type in Dial #text#
This means Dial followed by whatever number you want to add in (the variable) eg Dial 999
Move down to Script and choose the Switch… command and type in the variable name “text” in the line:
In the Cases box I click Add and enter the first number you want to dial eg:
Click OK and select Print a message:
Type in the message you want to have when you type in “999”
Close the message to save it:
Repeat this for lots of different numbers eg
When you are finished, click Default and choose Print a message and write something like:
This means that any number not on the list will get this message.
Here is the final list:
Here is how it looks with different options in action: