;Alan's sliding picture script ;Makes a door picture slide across the room when selected. ;When selected again the picture slides back. ;This script will automatically set door picture positions for an owner/operator. ;Create a spot and put a picture in it N times. ;Add this script and customize the information between the lines of asterisks. ;Then say "setpictures " to set the picture locations. ;Say "reset " to set the door to the first picture. ON ENTER { nbrpics GLOBAL ;***Set the number of pictures*** 9 nbrpics = ;***end of data*** inout GLOBAL -1 inout = 0 ME SETSPOTSTATELOCAL } ON OUTCHAT { inout GLOBAL nbrpics GLOBAL { { ;************************************************* ;Set the picture parameters. ;Start and stop positions are relative to the door. ;You must be an Owner/Operator for the script to work. -200 start_x = -200 start_y = 0 stop_x = 0 stop_y = ;************************************************* nbrpics 1 - steps = stop_x start_x - range_x = stop_y start_y - range_y = ; ;Move the pictures. Multiply before divide to reduce error! ; 0 i = { i ME SETSPOTSTATE start_x range_x i * steps / + start_y range_y i * steps / + ME SETPICLOC i ++ } { i nbrpics 1 - <= } WHILE 0 ME SETSPOTSTATE 0 inout = "" CHATSTR = } "$1" GREPSUB ATOI ME == IF } CHATSTR "^setpictures ([0-9]+)" GREPSTR IF ; { { 0 ME SETSPOTSTATE 0 inout = "" CHATSTR = } "$1" GREPSUB ATOI ME == IF } CHATSTR "^reset ([0-9]+)" GREPSTR IF } ON SELECT { inout GLOBAL nbrpics GLOBAL ;change picture direction and start animation ME GETSPOTSTATE state = { 0 inout - inout = 0 ME SETALARM } state 0 == state nbrpics 1 - == OR IF } ON ALARM { inout GLOBAL nbrpics GLOBAL ME GETSPOTSTATE inout + newstate = newstate ME SETSPOTSTATELOCAL { 6 ME SETALARM } { { ;if you want to do something after the slide is completed put the script here } { ;if you want to do something after the slide returns put the script here } inout 1 == IFELSE } newstate newstate nbrpics 1 - < AND IFELSE }