23 lines
1.2 KiB
Plaintext
23 lines
1.2 KiB
Plaintext
\b;Instruction \c;move\n;
|
|
The instruction \c;move();\n; instructs the bot to move forward or backward while keeping the same orientation. In brackets you must specify the length of the move in meters.
|
|
|
|
\b;Basic use
|
|
If you want the bot to move forward 30 meters, write \c;move(30);\n;. In order to move the bot backward after it dropped a chunk of \l;titanium ore\u object\titanore; on the \l;converter\u object\convert;, write \c;move(-2.5);\n;.
|
|
|
|
\b;For specialists
|
|
Syntax:
|
|
\s;\c;move ( length );\n;
|
|
|
|
Moves forward or backward of a given distance, always keeping the current orientation of the bot.
|
|
|
|
\t;length: \c;\l;float\u cbot\float;\n;
|
|
Length of the move, in meters. A negative value makes the bot move backward.
|
|
|
|
\t;Return value: \c;\l;int\u cbot\int;\n;
|
|
Normally an error stops the program. You can prevent the program from stopping on errors by using the \c;\l;errmode\u cbot\errmode;(0)\n; instruction. A value different from zero if an error occurred is then returned by \c;move()\n;.
|
|
\c;== 0 \n;Move executed
|
|
\c;!= 0 \n;error, the instruction was not performed correctly
|
|
|
|
\t;See also
|
|
\l;Programming\u cbot;, \l;types\u cbot\type; and \l;categories\u cbot\category;.
|