### Setup Show Example Source: https://github.com/mcparks/showscript/blob/main/docs/region-shows.md An example of a setup show that runs when the first player enters a region, typically used for spawning entities or initializing effects. ```yaml time0: - item: 'cmd' cmd: assave recall myProject/wavyboi ``` -------------------------------- ### Region Show Schema Example Source: https://github.com/mcparks/showscript/blob/main/docs/region-shows.md Defines the configuration for a Region Show, specifying the WorldGuard region, setup, loop, and cleanup shows, along with an optional delay for the loop. ```yaml region: "myRegion" setup: 'myProject/queue/waving_animatronic/setup' loop: name: 'myProject/queue/waving_animatronic/loop' delay: 20 cleanup: 'myProject/queue/waving_animatronic/cleanup' ``` -------------------------------- ### ShowScript 3 Actions: Show Source: https://github.com/mcparks/showscript/blob/main/docs/showscript3.md Illustrates how to start another ShowScript (version 2 or 3) from within the current script, optionally passing arguments. ```groovy show { name = "showName" = // arguments are only required if the show requires arguments. } ``` -------------------------------- ### Loop Show Example Source: https://github.com/mcparks/showscript/blob/main/docs/region-shows.md An example of a loop show that plays continuously as long as players are in the region, demonstrating an animation command. ```yaml time0: - item: 'cmd' cmd: 'asa animatecycle wavyboi -166 53 1103 10 larm 0 0 20 10' ``` -------------------------------- ### ShowScript 2 (YAML) Example Source: https://github.com/mcparks/showscript/blob/main/README.md Illustrates scheduling commands and text displays at specific timecodes using ShowScript's YAML format. Supports macros for reusable text. ```yaml time0: - item: 'cmd' cmd: "broadcast Hello World!" time40: - item: 'cmd' cmd: "broadcast This will run 2 seconds after the show starts" - item: 'cmd' cmd: "broadcast you can run as many commands as you want in a timecode" macros: blueFairyPrefix: "&1[&9Blue Fairy&1] &9" time967: - item: 'text' text: '^blueFairyPrefix^When stars are born,' x: -247.0 y: 53.0 z: 759.0 range: 300.0 world: world time1010: - item: 'text' text: '^blueFairyPrefix^they possess a gift or two.' x: -247.0 y: 53.0 z: 759.0 range: 300.0 world: world time1163: - item: 'cmd' cmd: summon fireworks_rocket -221 70 689 {Motion:[-1.0,10.0,0.0],FireworksItem:{id:fireworks,Count:1,tag:{Fireworks:{Explosions:[{Type:4,Trail:1,Colors:[16776688],FadeColors:[16775387]}]}}}} ``` -------------------------------- ### ShowScript 3 (Groovy DSL) Example Source: https://github.com/mcparks/showscript/blob/main/README.md Demonstrates scheduling commands and text displays at specific tick intervals using ShowScript's Groovy DSL. Supports variables and complex actions. ```groovy ticks(0) { cmd { "broadcast Hello World!" } } seconds(2) { cmd { "broadcast This will run 2 seconds after the show starts" } cmd { "broadcast you can run as many commands as you want in a timecode" } } def blueFairyPrefix = "&1[&9Blue Fairy&1] &9" ticks(967) { text { world = "world" x = -247 y = 53 z = 759 range = 300 text = "${blueFairyPrefix}When stars are born," } } ticks(1010) { text { world = "world" x = -247 y = 53 z = 759 range = 300 text = "${blueFairyPrefix}they possess a gift or two." } } ticks(1163) { cmd { "summon fireworks_rocket -221 70 689 {Motion:[-1.0,10.0,0.0],FireworksItem:{id:fireworks,Count:1,tag:{Fireworks:{Explosions:[{Type:4,Trail:1,Colors:[16776688],FadeColors:[16775387]}]}}}" } } ``` -------------------------------- ### Region Show Schema with Setup Delay Source: https://github.com/mcparks/showscript/blob/main/docs/region-shows.md Configures a region show schema to include a delay between the completion of the setup show and the start of the loop show. The delay is specified in ticks. ```yaml region: 'testregion' setup: name: 'path/to/setup' delay: 20 loop: 'path/to/loop' cleanup: 'path/to/cleanup' ``` -------------------------------- ### ShowScript 3 Show Arguments: Single Argument Source: https://github.com/mcparks/showscript/blob/main/docs/showscript3.md Example of creating a reusable ShowScript with a single argument, demonstrating how to define and pass arguments. ```groovy // setTime.groovy show { timeOfDay -> ticks(0) { cmd { "time set ${timeOfDay}" } } } ``` -------------------------------- ### ShowScript Commands Source: https://github.com/mcparks/showscript/blob/main/README.md Provides commands for managing ShowScript shows, including starting, stopping, debugging, and listing shows. Commands require 'castmember' permission and can be run in console with full permissions. ```APIDOC /show start [--log] [--async] [--startAt ] [--args ] Starts a specific show. Optional flags include --log for action logging, --async for asynchronous execution, --startAt for a specific start time, and --args for passing arguments to the show. /show stop Stops all instances of a specific show. /show toggledebug Toggles the debug mode for ShowScript. /show stopall Stops all currently running shows. /show list Lists all currently running shows. ``` -------------------------------- ### ShowScript 3 Comments: Single Line Source: https://github.com/mcparks/showscript/blob/main/docs/showscript3.md Demonstrates single-line comments in ShowScript 3, which start with '//'. ```groovy // this is a comment ``` -------------------------------- ### Region Show Schema Example (No Loop Delay) Source: https://github.com/mcparks/showscript/blob/main/docs/region-shows.md An alternative Region Show Schema configuration where the loop show does not require a delay between executions. ```yaml region: "myRegion" setup: 'myProject/queue/waving_animatronic/setup' loop: 'path/to/loopShow/that/doesnt/need/a/delay' cleanup: 'myProject/queue/waving_animatronic/cleanup' ``` -------------------------------- ### Cleanup Show Example Source: https://github.com/mcparks/showscript/blob/main/docs/region-shows.md Demonstrates a basic cleanup show that kills an armor stand. Cleanup shows are used to remove effects and reset the environment for subsequent shows. ```yaml time0: - item: 'cmd' cmd: 'askill wavyboi -166 53 1102 10' ``` -------------------------------- ### Groovy Programming Integration Source: https://github.com/mcparks/showscript/blob/main/docs/showscript3.md ShowScript 3 integrates Groovy, allowing the use of programming constructs like loops and conditionals. This example demonstrates a `for` loop to generate commands for a sequence of images. ```groovy def imagemapAnimate = "imagemap animate 163 55 703 https://mcparks.us/images/WDW/MK/Tomorrowland/Space/Preshow1" // preamble for an imagemap animate command in the Space Mountain preshow monitor for (int i=1; i<=42; i++) { // there are 42 frames in this video, named `001.png` to `042.png` def formattedNumber = String.format("%03d", i) // use Java's String formatting (which Groovy inherits) to format the number to 3 digits ticks(i*10) { // create a timecode block for every 10 ticks cmd { "${imagemapAnimate}/${formattedNumber}.png" // the commmand is the preamble we defined on line 1, followed by a '/', followed by the number of the frame, followed by .png } } } ``` -------------------------------- ### Global Variables: Set and Get Source: https://github.com/mcparks/showscript/blob/main/docs/showscript3.md Demonstrates how to use global variables in ShowScript 3 to share data across different shows. `setGlobalVariable` stores a value, and `getGlobalVariable` retrieves it, with an optional default value. ```groovy // testShow.groovy ticks(0) { setGlobalVariable("x", 5) } ``` ```groovy // test2.groovy ticks(0) { def x = getGlobalVariable("x") // this will be 5 def y = getGlobalVariable("y") // this will be `null` def yWithDefaultValue = getGlobalVariable("y", 10) // this will default to 10 } ``` -------------------------------- ### Build ShowScript Plugin Source: https://github.com/mcparks/showscript/blob/main/README.md Instructions to build the ShowScript plugin using Gradle. ```bash ./gradlew shadowJar ``` -------------------------------- ### ShowScript 3 Actions: Command Source: https://github.com/mcparks/showscript/blob/main/docs/showscript3.md Demonstrates the 'cmd' action, which allows executing any command that can be run in the server console. ```groovy cmd { "any command you can run in console" } ``` -------------------------------- ### ShowScript 3 Show Arguments: Multiple Arguments Source: https://github.com/mcparks/showscript/blob/main/docs/showscript3.md Demonstrates creating a ShowScript that accepts multiple arguments, showing how to define and pass them. ```groovy // adder.groovy show { num1, num2 -> ticks(0) { cmd { "broadcast ${num1 + num2}" } } } ``` -------------------------------- ### ShowScript 3 Basic Structure Source: https://github.com/mcparks/showscript/blob/main/docs/showscript3.md Demonstrates the fundamental structure of a ShowScript 3 file, including timecode blocks and command actions. ```groovy ticks(0) { cmd { "broadcast Hello World!" } } seconds(2) { cmd { "broadcast This will run 2 seconds after the show starts" } } ``` -------------------------------- ### Exporting Data and Functions in ShowScript Source: https://github.com/mcparks/showscript/blob/main/docs/showscript3.md Illustrates combining data (like locations) and functions for export and import between ShowScript files. This enables the creation of more complex and reusable components. ```groovy // dataAndFunctions.groovy def mainLocation = [world: "world", x: 100, y: 64, z: 100] def sayHello = { name -> return "hello ${name}" } export("mainLocation", mainLocation) export("sayHello", sayHello) ticks(0) { cmd { sayHello("world") } } ``` ```groovy // useDataAndFunctions.groovy def imported = load("dataAndFunctions") ticks(0) { def loc = imported.mainLocation cmd { "teleport @a ${loc.x} ${loc.y} ${loc.z}" } cmd { imported.sayHello("everyone") } } ``` -------------------------------- ### ShowScript Server Information API Source: https://github.com/mcparks/showscript/blob/main/docs/showscript3.md Provides access to various server information and utility methods within ShowScript. These methods allow interaction with the Minecraft server environment, including world, player, and location data. ```APIDOC world(String worldName) - Returns the specified World object. - Example: ticks(0) { def time = world("world").getTime() if (time > 12000) { cmd { "broadcast it is night time" } } else { cmd { "broadcast it is day time" } } } player(String playerName) - Returns the specified Player object. - Example: ticks(0) { def ryanLocation = player("RyanHecht_").getLocation() cmd { "broadcast Ryan is at ${ryanLocation.getX()}, ${ryanLocation.getY()}, ${ryanLocation.getZ()}" } } location(String worldName, double x, double y, double z) - Creates a Location object in the specified world. location(World world, double x, double y, double z) - Creates a Location object in the specified World object. location(double x, double y, double z) - Creates a Location object in the default world ('world'). onlinePlayers() - Returns a List of all currently online Player objects. runningShows() - Returns a List of all running ShowScheduler objects. - ShowScheduler methods: - getName(): String - getSyntaxVersion(): int - getShowTaskId(): Integer - stopShow(): void - getTimecode(): int isShowRunning(String showName) - Returns true if a show with the given name is running, false otherwise. playersInRegion(String regionName) - Returns a Collection of Player objects within the specified WorldGuard region. - Requires WorldGuard plugin. playerRegions(Player player) or playerRegions(String playerName) - Returns a Collection of region names (Strings) that the given player is currently in. - Requires WorldGuard plugin. sin(double angle) - Returns the sine of the given angle (in radians). cos(double angle) - Returns the cosine of the given angle (in radians). tan(double angle) - Returns the tangent of the given angle (in radians). ``` -------------------------------- ### Exporting and Loading Functions in ShowScript Source: https://github.com/mcparks/showscript/blob/main/docs/showscript3.md Demonstrates how to export a Groovy function from one ShowScript file and load it into another for reusability. This allows for modular development of ShowScript components. ```groovy // greetingFunctions.groovy def sayHello = { name -> return "hello ${name}" } export("sayHello", sayHello) ticks(0) { cmd { sayHello("world") } } ``` ```groovy // useGreetingFunction.groovy def importedFunctions = load("greetingFunctions") ticks(0) { cmd { importedFunctions.sayHello("tyler") } } ``` -------------------------------- ### Sharing Data Between Shows: Export and Load Source: https://github.com/mcparks/showscript/blob/main/docs/showscript3.md Illustrates how to share data between ShowScript 3 shows using `export` and `load`. Data exported from one show can be loaded and used in another, promoting code reusability. ```groovy // locationData.groovy def mainLocation = [world: "world", x: 100, y: 64, z: 100] export("mainLocation", mainLocation) ticks(0) { cmd { ... } } ``` ```groovy // useLocationData.groovy def importedData = load("locationData") ticks(0) { cmd { def loc = importedData.mainLocation "teleport @a ${loc.x} ${loc.y} ${loc.z}" } } ``` -------------------------------- ### Loading Region Shows Command Source: https://github.com/mcparks/showscript/blob/main/docs/region-shows.md Registers region shows by recursively scanning for `_regionshowschema.yml` files within a specified folder path. This command is essential for the system to recognize and manage region shows. ```minecraft-commands /loadregionshows ``` -------------------------------- ### ShowScript 3 Actions: Text Source: https://github.com/mcparks/showscript/blob/main/docs/showscript3.md Shows the 'text' action for displaying text to players within a specified range and location. ```groovy text { world = "world" x = 0 y = 0 z = 0 text = "your text here" range = 10 } ``` -------------------------------- ### ShowScript 3 Timecodes: Seconds Source: https://github.com/mcparks/showscript/blob/main/docs/showscript3.md Illustrates using the 'seconds' unit for timecode blocks, including support for fractional seconds. Fractional seconds are rounded down to the nearest tick. ```groovy seconds(1) { ... } seconds(1.5) { ... } ``` -------------------------------- ### ShowScript 3 Comments: Multi-line Source: https://github.com/mcparks/showscript/blob/main/docs/showscript3.md Shows how to use multi-line comments in ShowScript 3, enclosed by '/*' and '*/'. ```groovy /* this is a comment that spans multiple lines! */ ``` -------------------------------- ### Variable Definition and Assignment Source: https://github.com/mcparks/showscript/blob/main/docs/showscript3.md Demonstrates how to define and assign variables in ShowScript 3 using the `def` keyword. Variables can be defined and assigned in a single step or separately, and their scope can be global or local to a timecode block. ```groovy def myCoolVariable ``` ```groovy myCoolVariable = 5 ``` ```groovy def myCoolVariable = 5 def approximatelyPi = 3.1415 def isRyanCool = true ``` ```groovy def imagemapAnimate = "imagemap animate 163 55 703 https://mcparks.us/images/WDW/MK/Tomorrowland/Space/Preshow1" ticks(0) { cmd { "${imagemapAnimate}/001.png" } } ticks(10) { cmd { "${imagemapAnimate}/002.png" } } ``` ```groovy ticks(0) { def location = "105 65 222" cmd { "asa animate ${location} ..." } cmd { "imagemap animate ${location} ..." } } ticks(10) { // this will produce an error cmd { "broadcast location is ${location}" } } ``` ```groovy def theNumber = 0 ticks(1) { theNumber = theNumber + 1 } ticks(2) { theNumber = theNumber + 1 } ticks(3) { cmd { "broadcast theNumber is ${theNumber}" // will broadcast "theNumber is 2" } } ``` -------------------------------- ### ShowScript 3 Timecodes: Ticks Source: https://github.com/mcparks/showscript/blob/main/docs/showscript3.md Shows how to define a timecode block using the 'ticks' unit, which is the fundamental time unit in Minecraft servers (20 ticks = 1 second). ```groovy ticks(20) { ... } ``` -------------------------------- ### Region Show Schema with Multiple Loop Shows Source: https://github.com/mcparks/showscript/blob/main/docs/region-shows.md Configures a region show schema to use multiple loop shows, each with a different delay. This is useful for animations that complete at varying rates. ```yaml region: 'testregion' setup: 'path/to/setup' loop: - name: 'path/to/loop1' delay: 10 - name: 'path/to/loop2' delay: 20 cleanup: 'path/to/cleanup' ``` -------------------------------- ### Access TrainCarts Information with Groovy Source: https://github.com/mcparks/showscript/blob/main/docs/showscript3.md This snippet demonstrates how to import TrainCarts classes in Groovy to retrieve information about a specific train, such as its first member's location. It handles cases where the train might not be found. ```groovy import com.bergerkiller.bukkit.tc.controller.MinecartGroup import com.bergerkiller.bukkit.tc.controller.MinecartMember import com.bergerkiller.bukkit.tc.properties.TrainPropertiesStore ticks(0) { // Get the train by its name def trainName = "MyTrain" def train = TrainPropertiesStore.get(trainName).getHolder() if (train != null) { // Get the first member of the train and its location def firstMember = train.get(0) def location = firstMember.getEntity().getLocation() cmd { "broadcast The first member of train ${trainName} is at ${location.getX()}, ${location.getY()}, ${location.getZ()}" } } else { cmd { "broadcast Train ${trainName} not found!" } } } ``` -------------------------------- ### Ignoring Region Shows Source: https://github.com/mcparks/showscript/blob/main/docs/region-shows.md Demonstrates how to ignore a Region Show Schema by setting the `ignore: true` flag in the schema file. This prevents the loader from processing the specified region show. ```yaml ignore: true region: "myRegion" setup: 'myProject/queue/waving_animatronic/setup' loop: 'path/to/loopShow/that/doesnt/need/a/delay' cleanup: 'myProject/queue/waving_animatronic/cleanup' ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.