ROOM ID 169 NAME "Drink Ordering Bar" PICT "bar3d.gif" ARTIST "lisa, Script by Tandika" PICTURE ID 1 NAME "arrowrr.gif" TRANSCOLOR 56 ENDPICTURE PICTURE ID 2 NAME "arrowll.gif" TRANSCOLOR 56 ENDPICTURE SPOT ID 1 NAME "Basic Scripts" OUTLINE 7,7 30,7 30,27 7,27 LOC 128,96 SCRIPT ; This script was written by Tandika Star. ON ENTER { "If you are using a routine which positions your speech bubble automatically," LOCALMSG "you will need to turn it off to get help, the menu, or order." LOCALMSG "For instructions on how to order say: helpme" LOCALMSG "All instructions will appear in your log!" LOCALMSG } ON OUTCHAT { ; This posts instructions on how to order items. { "@" POSX ITOA + "," + POSY ITOA + "Instructions are in your log." + LOCALMSG "\x0a--- MENU HELP ---" LOGMSG "To see a list of what is available to order, say: menu" LOGMSG "To order an item from the list, say: order " LOGMSG "To order an item for someone else, click on them, as for whispering," LOGMSG "Then say: order \x0a" LOGMSG "" CHATSTR = } CHATSTR LOWERCASE "^helpme$" GREPSTR IF ; This lists the items that can be ordered. The \x0a makes each item appear on a different line. { "@" POSX ITOA + "," + POSY ITOA + "The items you can order are in your log." + LOCALMSG "\x0a---- You can order the following items ----" LOGMSG "coffee\x0aicedtea\x0alemonade\x0apepsi\x0awine\x0abeer\x0achampagne\x0a" LOGMSG "" CHATSTR = } CHATSTR LOWERCASE "^menu$" GREPSTR IF } ENDSCRIPT ENDSPOT SPOT ID 2 NAME "Order Handler" OUTLINE 44,7 67,7 67,27 44,27 LOC 135,96 SCRIPT ON OUTCHAT { ; Get the name of the item the user ordered ; and 0 the variable that checks to make sure it's valid. { "$1" GREPSUB mnitem = 0 didit = ; Check if the item is ordered for another person ; and get the position of where the item is to be delivered. { WHOTARGET WHOPOS y = x = } { WHOME WHOPOS y = x = } WHOTARGET IFELSE ; Set the delivery position so that it is next to the person. { x 67 + x = } { x 67 - x = } x 256 < IFELSE ; This section checks to see if the item ordered is in the list, ; and if it is, it places it next to the person who ordered it, ; OR the person it was ordered for. { bzy = { bzy 1 GET x y ADDLOOSEPROP 1 didit = { "@" x ITOA + "," + y ITOA + WHOME WHONAME + " bought you a " + mnitem + "!" + WHOTARGET PRIVATEMSG } { "@" x ITOA + "," + y ITOA + "Here's your " + mnitem + ", " + USERNAME + "!" + LOCALMSG } WHOTARGET IFELSE } mnitem bzy 0 GET == IF ; This is the array of items that can be ordered. If you add to the array, ; don't forget to add the item to the menu above! } [ [ "coffee" 977574956 ] [ "icedtea" 852600797 ] [ "lemonade" 877036951 ] [ "pepsi" 873862120 ] [ "wine" 977525893 ] [ "beer" 869671359 ] [ "champagne" 977525848 ] ] FOREACH ; If it turned out that the item ordered was NOT on the list, ; this message is displayed to the user. { "@" POSX itoa + "," + POSY itoa + systr = systr "We don't have any -> " + "$1" GREPSUB + " <- here!\x0a" + systr = systr "Say: menu\x0a" + " to get a list of items you can order!" + systr = systr LOCALMSG } 0 didit == IF "" CHATSTR = } CHATSTR "^order (.*)$" GREPSTR IF } ENDSCRIPT ENDSPOT DOOR ID 5 DONTMOVEHERE DEST 149 OUTLINE 446,354 507,354 507,380 446,380 LOC 476,367 PICTS 1,0,0 ENDPICTS SCRIPT ON INCHAT { nDoIt GLOBAL nDoIt EXEC } ON ENTER { { CLEARLOOSEPROPS PAINTCLEAR } NBRROOMUSERS 2 < IF } ENDSCRIPT ENDDOOR DOOR ID 6 DONTMOVEHERE DEST 96 OUTLINE 3,354 54,354 54,382 3,382 LOC 28,368 PICTS 2,0,0 ENDPICTS ENDDOOR ENDROOM