OC_Scripts/libs/move_script/README.md

28 lines
805 B
Markdown
Raw Permalink Normal View History

2018-09-30 06:17:45 +00:00
# movescript.lua
A more convenient way to move a robot.
## Pastebin
[4c2AN8Jw](https://pastebin.com/4c2AN8Jw)
## Module Requirements
*None*
## Instructions
2018-11-04 06:55:10 +00:00
Simply run `pastebin get 4c2AN8Jw /lib/movescript.lua` to install movescript to the local computer. Then you can begin writing movescripts to tell your robots how to move. For example:
2018-09-30 06:17:45 +00:00
```
local ms = require("movescript")
local my_script = "FFURFFL"
ms.execute(my_script)
```
The above code will make the robot move forward twice, then up once, then turn right, then move forward twice, and finally turn left.
It is also possible to specify the amount of times to perform an action, by giving an integer value before the character for the movement you want. For example:
```
local my_long_script = "10D2R5B3U"
ms.execute(my_long_script)
2018-11-04 06:44:06 +00:00
```