aboutsummaryrefslogtreecommitdiff
path: root/examples/example-script.rsb
diff options
context:
space:
mode:
authorMarco Capitani <m.capitani@nextworks.it>2018-02-22 10:18:10 +0100
committerMarco Capitani <m.capitani@nextworks.it>2018-03-16 14:07:24 +0100
commite174aaf3650c23331c757921b1af9b152f53c6e5 (patch)
tree281a859419b20e34605e310c9572668d6f545734 /examples/example-script.rsb
parentade6bd4cda44c88b555f521641c6e01326ab0060 (diff)
downloadrumba-e174aaf3650c23331c757921b1af9b152f53c6e5.tar.gz
rumba-e174aaf3650c23331c757921b1af9b152f53c6e5.zip
storyboard: add replayability
implements #27
Diffstat (limited to 'examples/example-script.rsb')
-rw-r--r--examples/example-script.rsb40
1 files changed, 40 insertions, 0 deletions
diff --git a/examples/example-script.rsb b/examples/example-script.rsb
new file mode 100644
index 0000000..8b5c714
--- /dev/null
+++ b/examples/example-script.rsb
@@ -0,0 +1,40 @@
+# This is a comment (no in-line comments)
+
+5.0 &ev1| $sb run_client_of 'server_a'
+# 5.0 is the time trigger (after 5 seconds). Its a float
+# $sb is the storyboard object
+# run_client_of is the method to invoke
+
+10.3 &echo_cmd|$sb run_command 'node_a' 'echo "test"'
+# methods can have multiple space-delimited arguments.
+# single-quoted strings are used to enclose a single (string) argument
+# which must be preceded and followed by a space.
+# &echo_cmd is a label, it can be used to reference this
+# event from other events
+
+10.5 &ev2|$sb run_client_of 'server_b' 12 'node_a'
+# And optional arguments (same syntax as the method)
+# also, whitespace tolerant around the | token
+
+# NOTE: in the absence of optional arguments, they will be randomly
+# generated, so you might not get the exact same experiment every time
+
+13 &ev3| $Node.node_a execute_command 'echo "test"'
+# $Node.<node_id> is a Node object.
+# This command is actually equivalent to echo_cmd
+
+echo_cmd &echo2 | $sb run_command $Node.node_b 'echo "test2"'
+# events can be triggered by the completion of other events
+
+echo2, 18 &ev4| $sb run_client_of $Server.server_b
+# or both time AND other events
+# Moreover, one can use entity syntax in arguments too
+
+1.2 &ev5| run_client_of $Server.server_c
+# Events need _not_ be in temporal order
+# if no object ($ handle) is provided, the storyboard
+# is assumed as the object/
+
+
+
+