Scripts are a sequence of commands, that are executed one after each other. GeoGebra supports two scripting languages - GeoGebraScript (GGBScript) and JavaScript. The execution can be triggered by:[br][br][list][*]JavaScript listeners (see [url=https://wiki.geogebra.org/en/Reference:GeoGebra_Apps_API]Reference: JavaScript[/url])[br][/*][*]clicking a particular object[br][/*][*]updating a particular object (when value or properties of the object are changed)[br][/*][*]loading the file (in case of JavaScript)[/*][/list][br]In this book we will use only GGBScript as it uses the GeoGebra command syntax and is thus much easier to understand and learn for GeoGebra users. There are some differences between the scripting languages feature-wise, but GGBScript is powerful enough for most situations.
Scripting is a topic intended for experienced users of GeoGebra, I recommend you to take a look at the [url=https://www.geogebra.org/a/14]other tutorials[/url] before you dive into this topic if you're not that familiar with GeoGebra at the moment. The basics about how scripting works and how you can add scripts to your constructions are explained here of course.
GGBScripts are a sequence of GeoGebra commands executed in the following two situations:[list][*][i]Click:[/i] A script is executed after the user clicked on the object.[/*][*][i]Update:[/i] A script is executed when the value or properties of the object changed. This may happen if the user moves elements of the construction around, changes sliders, etc.[/*][/list]Scripting in GeoGebra is object-centered, which means that you can define scripts for each object –one script for clicks, one for updates–, but no script can exist without an object (there is one exception for scripting using JavaScript).
If you don't know anything about [b]Scripting[/b] in GeoGebra I recommend you to check the following tutorials:[br][list][*][url=https://wiki.geogebra.org/en/Scripting]Scripting[/url][/*][*][url=https://www.geogebra.org/m/uh6yfevw]Introduction to GGBScripting[/url][/*][/list]A complete list of the GeoGebra commands can be consulted [url=https://wiki.geogebra.org/en/Scripting_Commands]here[/url].