You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
759 B
30 lines
759 B
#!/bin/sh |
|
|
|
# This spell displays the ao-mud main menu. |
|
|
|
. colors |
|
|
|
display_menu() { |
|
look="Look Around%ls" |
|
cast="Spellbook%spellbook" |
|
home="Teleport Home%cd" |
|
jump="Teleport to Marker%jump" |
|
portal="Teleport to Portal Chamber%cd /mnt" |
|
install="Install MUD%mud-install-menu" |
|
admin="Admin MUD Hosting%mud-admin" |
|
settings="MUD Settings%mud-settings" |
|
exit="Exit%kill -2 $$" # Commands are run with 'eval' by the menu script, so we can't simply say 'exit'. The keyword $$ gets this scripts PID and the -2 code is SIGINT aka Ctrl-C |
|
|
|
menu "MUD main menu:" "$look" "$cast" "$home" "$jump" "$portal" "$settings" "$exit" |
|
} |
|
|
|
# Catch Ctrl-C and exit |
|
handle_ctrl_c() { |
|
trap 'echo exiting; exit' INT |
|
} |
|
|
|
handle_ctrl_c |
|
|
|
while true; do |
|
display_menu |
|
done
|
|
|