MotionSensor v0.1 My first attempt at a script for Roll20. Just a little something I made for a friend of mine's campaign but I figured I'd toss it in here in case anyone else could get some use out of it. The script is meant to emulate the the motion sensor from d20 future but can probably be adapted for use in other systems. Since this is the first script I wrote I borrowed heavily in some areas from The Aaron , namely the character encoding function, the basic format of the handleInput routine and the showHelp html. Link : Raw GIT What does it do? The script generates pulsating markers beneath any token on the object layer within a specified distance of the sensor source. These markers will display through fog of war and sight limitations in order to simulate the information the character would be getting from the sensor. View from the players perspective: View from the GM's perspective Important Note Due to the current limitations of the roll20 API the setup for this script is a bit more involved than I would like. In order to create the sensor beacons you will need to provide the script with an image URL from your roll20 library before you can start using the sensor. Ideally you could provide any URL on the web but there are currently no API methods for importing an image programmatically so this part must be done by hand. You can find the URL for a library image by viewing source on the image in the browser of your choice. The image URL should start with <a href="https://s3.amazonaws.com/files.d20.io/images/" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/</a> if you are playing on the production servers and <a href="https://s3.amazonaws.com/files.staging.d20.io/imag" rel="nofollow">https://s3.amazonaws.com/files.staging.d20.io/imag</a>... if you are playing on the development servers. For reference the image I am using is: <a href="http://i.imgur.com/B8v2sls.png" rel="nofollow">http://i.imgur.com/B8v2sls.png</a> Disclaimer I've done a fair bit of testing but I'm sure there are still bugs to be found. Send me a message with steps to reproduce any issues you find and I'll try and take care of them as fast as I can! Future Plans I don't know really, if people use it and have feature requests I'm sure I'll end up adding some of those in. I'd like to support actual animations for the sensors but right now that seems like a pain with the limited drawing tools in the API and I don't really have any practical experience with creating animations. If someone has a cool animation they would like to share I'm sure I can find a way to work it in to the script. Changelog 2/29/2015 14:15 - Fixed unhandled exception when reloading campaign Fixed leaking of ignored targets Added !ignored command for debug purposes 2/29/2015 19:45 - Fixed an issue with debug throwing errors on a new install Commands ([ ] denotes optional parameter) !motion-sensor-start [ range ] Activates a motion sensor for the selected token. You may optionally supply a range (in units) for the sensor. Default 20 Units range - integer - The range of the sensor in units - Default 20 Units !motion-sensor-stop Deactivates the motion sensor for the selected token. !motion-sensor-show [ show ] Sets a token's visibility to any active motion sensors. A value of false will cause the selected token to appear invisible to active motion sensors. show - boolean - The visibility of the token to sensors - Default true !motion-sensor-src < url > Sets the URL of the image the sensors beacons will use for their tokens. The image URL should start with <a href="https://s3.amazonaws.com/files.d20.io/images/" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/</a> if you are playing on the production servers and <a href="https://s3.amazonaws.com/files.staging.d20.io/imag" rel="nofollow">https://s3.amazonaws.com/files.staging.d20.io/imag</a>... if you are playing on the development servers. url - string - The URL of the image !motion-sensor-pulse-cfg < param > < value > Configures the parameters controlling the pulse animation for sensor beacons. param - string - Should be one of the following values: cyclic - determines if the pulse returns to the starting dimensions or ends at its maximum extent minSizeRatio - sets the minimum size of the pulse compared to the size of the generating token maxSizeRatio - sets the maximum size of the pulse compared to the size of the generating token rate - sets the period of time (in ms) it takes for the pulse to complete its animation easingFunction - sets the easing function used to interpolate the animation value - string - The value for the selected parameter. Accepted values are as follows: cyclic - Either true or false. Default false minSizeRatio - A float greater than or equal to 0. (A value of 1 is equal to 100%) Default 1.0 maxSizeRatio - A float greater than 0. (A value of 1 is equal to 100%) Default 0.125 rate - Integer with a value greater than 0. Default 1500 easingFunction - One of the following. Default easeOutCubic linear easeInQuad easeOutQuad easeInOutQuad easeInCubic easeOutCubic easeInOutCubic easeInQuart easeInQuart easeInOutQuart easeInQuint easeOutQuint easeInOutQuint !motion-sensor-debug <enable> Enables or disables the sending of debug logging messages to the roll20 console. enable - boolean - True to enable debug logging. !motion-sensor-reset Hard resets the MotionSensor script, deleting all active sensors.