;Alan's sliding picture script #3 ;Makes a door picture slide across the room when selected. ;The slide starts with large jumps and ends with small jumps. ;When selected again the picture slides back. ;This script will automatically set door picture positions if you are an owner/operator. ;Create a spot and enter a picture N times. ;Add this script and customize the information between the lines of asterisks. ;Then say "setpictures " to automatically set the picture locations. ;Say "reset " to set the door to the first picture. ON ENTER { inout GLOBAL -1 inout = nbrpics GLOBAL ;***Set the number of pictures*** 9 nbrpics = ;***end of data*** 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 = 100 stop_x = 100 stop_y = ;***end of parameters*** 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 i 90 * steps / SINE range_x * 1000 / + start_y i 90 * steps / SINE range_y * 1000 / + 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 }