;Alan's Order script. ;Based on order script by . ;Put this script in a spot. ;Put a 'bartender' picture as the second picture in the spot. Leave the first one blank. ON ENTER { 0 ME SETSPOTSTATELOCAL "If you are using a routine which positions your speech bubble automatically you will need to turn it off to get help, the menu, or order." LOCALMSG "For instructions on how to order say 'helpme'. The instructions will appear in your log!" LOCALMSG } ON OUTCHAT { ;***Set bartender speech position*** "@285 140" speakat = [ ;***Define menu in form: [ "name" propid ] or [ "name" "propname" ]*** [ "bananas" 1014425716 ] [ "beer" 942800184 ] [ "candied apple" 977207224 ] [ "coke" 977207344 ] [ "corn dog" 977207214 ] [ "cotton candy" 977207201 ] [ "frog ice cream" -1354212302 ] [ "hot dog" 965338137 ] [ "m&m's" -1170486827 ] [ "milk bone" -1295597683 ] [ "peanuts" 976593054 ] [ "pizza" 960603296 ] [ "popcorn" 894703961 ] [ "prozac" 875141363 ] [ "viagra" 951797824 ] ;***end of data**** ] menu = ; { "Instructions are in your log." LOCALMSG "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 whisper 'order ' to them." LOGMSG "" CHATSTR = } CHATSTR "helpme" == IF ; { "The items you can order are in your log." LOCALMSG "You can order the following items: " txt = { item = txt item 0 GET & ", " & txt = } menu FOREACH txt LOGMSG "" CHATSTR = } CHATSTR "menu" == IF ; { 1 ME SETSPOTSTATE 60 DELAY ;delay speech while 'bartender' appears 0 validorder = ; Set the delivery position so that it is next to the person. { WHOTARGET } { WHOME } WHOTARGET IFELSE WHOPOS y = x = { 67 x += } { 67 x -= } x 256 < IFELSE ; Deliver the order if valid { temparray = { 1 validorder = temparray 1 GET x y ADDLOOSEPROP { speakat WHOTARGET WHONAME & ", " & USERNAME & " bought you a $1!" GREPSUB & ROOMMSG } { speakat USERNAME & ", here's your $1." GREPSUB & ROOMMSG } WHOTARGET IFELSE } "$1" GREPSUB temparray 0 GET == IF } menu FOREACH ;Tell the person his/her you do't have any if order wasn't valid { speakat USERNAME & ", we don't have any $1 here. Say 'menu' to get a list of items you can order." GREPSUB & LOCALMSG } 0 validorder == IF { 0 ME SETSPOTSTATE } 720 ALARMEXEC "" CHATSTR = } CHATSTR "^order (.*)$" GREPSTR IF }