<?xml version="1.0" encoding="utf-8"?><!DOCTYPE article  PUBLIC '-//OASIS//DTD DocBook XML V4.4//EN'  'http://www.docbook.org/xml/4.4/docbookx.dtd'><article><articleinfo><title>Goto</title><revhistory><revision><revnumber>10</revnumber><date>2013-08-06 17:38:02</date><authorinitials>Inanna</authorinitials></revision><revision><revnumber>9</revnumber><date>2012-10-24 20:23:15</date><authorinitials>Romulus</authorinitials></revision><revision><revnumber>8</revnumber><date>2012-10-24 01:28:39</date><authorinitials>Romulus</authorinitials></revision><revision><revnumber>7</revnumber><date>2012-10-21 15:24:50</date><authorinitials>Inanna</authorinitials></revision><revision><revnumber>6</revnumber><date>2012-09-09 22:31:09</date><authorinitials>Inanna</authorinitials></revision><revision><revnumber>5</revnumber><date>2012-09-09 22:17:21</date><authorinitials>Inanna</authorinitials></revision><revision><revnumber>4</revnumber><date>2012-09-09 20:56:48</date><authorinitials>Inanna</authorinitials></revision><revision><revnumber>3</revnumber><date>2012-09-09 20:56:20</date><authorinitials>Inanna</authorinitials></revision><revision><revnumber>2</revnumber><date>2012-09-05 13:18:25</date><authorinitials>Inanna</authorinitials><revremark>Renamed from 'GoTo'.</revremark></revision><revision><revnumber>1</revnumber><date>2012-09-05 13:17:56</date><authorinitials>Inanna</authorinitials></revision></revhistory></articleinfo><informaltable><tgroup cols="2"><colspec colname="col_0"/><colspec colname="col_1"/><tbody><row rowsep="1"><entry colsep="1" rowsep="1"><para>Usage: </para></entry><entry colsep="1" rowsep="1"><para>goto label </para></entry></row><row rowsep="1"><entry colsep="1" rowsep="1"><para>Example: </para></entry><entry colsep="1" rowsep="1"><para>goto thirdLabel </para></entry></row></tbody></tgroup></informaltable><para>Allows you to jump to any label, anywhere in the script and then continue on down the script line by line as normal (or until it reaches another command to force it to jump elsewhere again). </para><para>In the following example, the bot will read the first line and echo the first message following it, then jump to the third label and echo that message, then jump to the second label and echo that message twice, and then for lack of another jump it will continue down the script to the third label again, echo that message, then jump back to the second label again... thus entering an endless loop of the second and third labels. </para><itemizedlist><listitem override="none"><screen><![CDATA[label firstLabel
1: echo "This is label 1's stuff"
2: goto thirdLabel
label secondLabel
3: echo "This is label 2's stuff"
4: repeat 2
label thirdLabel
5: echo "This is label 3's stuff"
6: goto secondLabel]]></screen></listitem></itemizedlist><para>This produces the following results in the bot: </para><itemizedlist><listitem override="none"><screen><![CDATA[16:53:21 This is label 1's stuff
16:53:25 This is label 3's stuff
16:53:29 This is label 2's stuff
16:53:33 This is label 2's stuff
16:53:39 This is label 3's stuff
16:53:41 This is label 2's stuff
16:53:43 This is label 2's stuff
16:53:46 This is label 3's stuff
16:53:48 This is label 2's stuff
16:53:50 This is label 2's stuff
16:53:53 This is label 3's stuff
16:53:55 This is label 2's stuff
16:53:57 This is label 2's stuff
16:54:00 This is label 3's stuff
(etc. etc. forever)]]></screen></listitem></itemizedlist><!--rule (<hr>) is not applicable to DocBook--><!--rule (<hr>) is not applicable to DocBook--><para> <ulink url="http://guide.neatportal.com/wiki/Goto/wiki/ScriptControlStructures#">ScriptControlStructures</ulink> </para></article>