SignsBot: различия между версиями
Внешний вид
Va (обсуждение | вклад) Нет описания правки |
Va (обсуждение | вклад) Нет описания правки |
||
(не показаны 3 промежуточные версии этого же участника) | |||
Строка 2: | Строка 2: | ||
* Документация [https://github.com/joe7575/signs_bot/blob/master/manual_EN.md на английском] и [https://github.com/joe7575/signs_bot/blob/master/manual_DE.md немецком] | * Документация [https://github.com/joe7575/signs_bot/blob/master/manual_EN.md на английском] и [https://github.com/joe7575/signs_bot/blob/master/manual_DE.md немецком] | ||
Из инструментов есть робот, управляемый программой, записанной на знаках. Робот требует электропитания, и поэтому работает в комплексе с модом [[Techage]]. Также есть датчики и таймер. | Из инструментов есть робот {{Obj|signs_bot|box|4=id}}, управляемый программой, записанной на знаках {{Obj|signs_bot|sign_cmnd|4=id}}. Робот требует электропитания, и поэтому работает в комплексе с модом [[Techage]]. Также есть датчики и таймер. | ||
Программа управления роботом пишется на своём несложном языке управления, чем-то похожем на язык [https://www.yaklass.ru/p/informatika/5-klass/algoritmizatciia-i-osnovy-programmirovaniia-7279286/rabota-v-srede-programmirovaniia-7363813/re-2176d80d-af73-424b-8fe8-3c5bd103b93f?utm_referrer=https%3a%2f%2fyandex.ru%2f Turtle/Черепашка] | Программа управления роботом пишется на своём несложном языке управления, чем-то похожем на язык [https://www.yaklass.ru/p/informatika/5-klass/algoritmizatciia-i-osnovy-programmirovaniia-7279286/rabota-v-srede-programmirovaniia-7363813/re-2176d80d-af73-424b-8fe8-3c5bd103b93f?utm_referrer=https%3a%2f%2fyandex.ru%2f Turtle/Черепашка] | ||
Строка 10: | Строка 10: | ||
|- | |- | ||
|move <steps> | |move <steps> | ||
| | |один или <steps> шагов вперёд | ||
|- | |- | ||
|cond_move | |cond_move | ||
Строка 16: | Строка 16: | ||
|- | |- | ||
|turn_left | |turn_left | ||
| | |повернуться влево | ||
|- | |- | ||
|turn_right | |turn_right | ||
| | |повернуться вправо | ||
|- | |- | ||
|turn_around | |turn_around | ||
| | |развернуться | ||
|- | |- | ||
|backward | |backward | ||
| | |шаг назад | ||
|- | |- | ||
|turn_off | |turn_off | ||
| | |выключение и возврат робота в бокс | ||
|- | |- | ||
|pause <sec> | |pause <sec> | ||
| | |ожидать одну или <sec> секунд | ||
|- | |- | ||
|move_up | |move_up | ||
| | |подняться вверх (максимум 2 раза) | ||
|- | |- | ||
|move_down | |move_down | ||
| | |опустится вниз | ||
|- | |- | ||
|fall_down | |fall_down | ||
Строка 43: | Строка 43: | ||
|- | |- | ||
|take_item <num> <slot> | |take_item <num> <slot> | ||
| | |взять <num> объектов из слота номер <slot> из ящика | ||
|- | |- | ||
|add_item <num> <slot> | |add_item <num> <slot> | ||
|put one or more items in a box | |||
|- | |- | ||
|add_fuel <num> <slot> | |add_fuel <num> <slot> | ||
|put fuel in a furnace | |||
|- | |- | ||
|place_front <slot> <lvl> | |place_front <slot> <lvl> | ||
|place the block in front of the bot | |||
|- | |- | ||
|place_left <slot> <lvl> | |place_left <slot> <lvl> | ||
|place the block to the left of the bot | |||
|- | |- | ||
|place_right <slot> <lvl> | |place_right <slot> <lvl> | ||
|place the block to the right of the bot | |||
|- | |- | ||
|place_below <slot> | |place_below <slot> | ||
|lift the robot and put the block under the robot | |||
|- | |- | ||
|place_above <slot> | |place_above <slot> | ||
|set block above the robot | |||
|- | |- | ||
|dig_front <slot> <lvl> | |dig_front <slot> <lvl> | ||
|remove block in front of the robot | |||
|- | |- | ||
|dig_left <slot> <lvl> | |dig_left <slot> <lvl> | ||
|remove block on the left | |||
|- | |- | ||
|dig_right <slot> <lvl> | |dig_right <slot> <lvl> | ||
|remove block on the right | |||
|- | |- | ||
|dig_below <slot> | |dig_below <slot> | ||
|remove block under the robot | |||
|- | |- | ||
|dig_above <slot> | |dig_above <slot> | ||
|remove block above the robot | |||
|- | |- | ||
|rotate_item <lvl> <steps> | |rotate_item <lvl> <steps> | ||
|rotate a block in front of the robot | |||
|- | |- | ||
|set_param2 <lvl> <param2> | |set_param2 <lvl> <param2> | ||
|set param2 of the block in front of the robot | |||
|- | |- | ||
|place_sign <slot> | |place_sign <slot> | ||
|set sign | |||
|- | |- | ||
|place_sign_behind <slot> | |place_sign_behind <slot> | ||
|put a sign behind the bot | |||
|- | |- | ||
|dig_sign <slot> | |dig_sign <slot> | ||
|remove the sign | |||
|- | |- | ||
|trash_sign <slot> | |trash_sign <slot> | ||
|Remove the sign, clear data and add to the item Inventory | |||
|- | |- | ||
|stop | |stop | ||
|Bot stops until the shield is removed | |||
|- | |- | ||
|pickup_items <slot> | |pickup_items <slot> | ||
|pickup items (in a 3x3 field) | |||
|- | |- | ||
|drop_items <num> <slot> | |drop_items <num> <slot> | ||
|drop items | |||
|- | |- | ||
|harvest | |harvest | ||
|harvest a 3x3 field (farming) | |||
|- | |- | ||
|cutting | |cutting | ||
|cut flowers in a 3x3 field | |||
|- | |- | ||
|sow_seed <slot> | |sow_seed <slot> | ||
|see/plant a 3x3 field | |||
|- | |- | ||
|plant_sapling <slot> | |plant_sapling <slot> | ||
|plant a sapling in front of the robot | |||
|- | |- | ||
| | |pattern | ||
|save the block properties behind the sign (3x3x3 cube) as a template | |||
|- | |- | ||
| | |copy <size> | ||
|make a 3x3x3 copy of the stored template | |||
|- | |- | ||
| | |punch_cart | ||
|bump a mine cart | |||
|- | |- | ||
| | |add_compost <slot> | ||
|Put 2 leaves into the compost barrel | |||
|- | |- | ||
| | |take_compost <slot> | ||
|Take a compost item from the barrel | |||
|- | |- | ||
| | |print <text> | ||
|Output chat message for debug purposes | |||
|- | |- | ||
| | |take_water <slot> | ||
|Take water with empty bucket | |||
|- | |- | ||
|take_soup <slot> | |fill_cauldron <slot> | ||
|Fill the xdecor cauldron for a soup | |||
|- | |||
|take_soup <slot> | |||
|Take boiling soup into empty bowl from cauldron | |||
|- | |- | ||
|flame_on | |flame_on | ||
Строка 134: | Строка 169: | ||
|send_cmnd <receiver> <command> | |send_cmnd <receiver> <command> | ||
|Send a techage command to a given node. Receiver is addressed by the techage node number. For commands with two or more words, use the '*' character instead of spaces, e.g.: | |Send a techage command to a given node. Receiver is addressed by the techage node number. For commands with two or more words, use the '*' character instead of spaces, e.g.: | ||
send_cmnd 3465 | send_cmnd 3465 pull*default:dirt*2 | ||
|- | |- | ||
|} | |} |
Текущая версия от 06:31, 25 марта 2025
- Код
- Документация на английском и немецком
Из инструментов есть робот signs_bot:box, управляемый программой, записанной на знаках
signs_bot:sign_cmnd. Робот требует электропитания, и поэтому работает в комплексе с модом Techage. Также есть датчики и таймер.
Программа управления роботом пишется на своём несложном языке управления, чем-то похожем на язык Turtle/Черепашка
Основные команды: | |
move <steps> | один или <steps> шагов вперёд |
cond_move | go to the nearest obstacle or sign |
turn_left | повернуться влево |
turn_right | повернуться вправо |
turn_around | развернуться |
backward | шаг назад |
turn_off | выключение и возврат робота в бокс |
pause <sec> | ожидать одну или <sec> секунд |
move_up | подняться вверх (максимум 2 раза) |
move_down | опустится вниз |
fall_down | fall into a hole/chasm (up to 10 blocks) |
take_item <num> <slot> | взять <num> объектов из слота номер <slot> из ящика |
add_item <num> <slot> | put one or more items in a box |
add_fuel <num> <slot> | put fuel in a furnace |
place_front <slot> <lvl> | place the block in front of the bot |
place_left <slot> <lvl> | place the block to the left of the bot |
place_right <slot> <lvl> | place the block to the right of the bot |
place_below <slot> | lift the robot and put the block under the robot |
place_above <slot> | set block above the robot |
dig_front <slot> <lvl> | remove block in front of the robot |
dig_left <slot> <lvl> | remove block on the left |
dig_right <slot> <lvl> | remove block on the right |
dig_below <slot> | remove block under the robot |
dig_above <slot> | remove block above the robot |
rotate_item <lvl> <steps> | rotate a block in front of the robot |
set_param2 <lvl> <param2> | set param2 of the block in front of the robot |
place_sign <slot> | set sign |
place_sign_behind <slot> | put a sign behind the bot |
dig_sign <slot> | remove the sign |
trash_sign <slot> | Remove the sign, clear data and add to the item Inventory |
stop | Bot stops until the shield is removed |
pickup_items <slot> | pickup items (in a 3x3 field) |
drop_items <num> <slot> | drop items |
harvest | harvest a 3x3 field (farming) |
cutting | cut flowers in a 3x3 field |
sow_seed <slot> | see/plant a 3x3 field |
plant_sapling <slot> | plant a sapling in front of the robot |
pattern | save the block properties behind the sign (3x3x3 cube) as a template |
copy <size> | make a 3x3x3 copy of the stored template |
punch_cart | bump a mine cart |
add_compost <slot> | Put 2 leaves into the compost barrel |
take_compost <slot> | Take a compost item from the barrel |
print <text> | Output chat message for debug purposes |
take_water <slot> | Take water with empty bucket |
fill_cauldron <slot> | Fill the xdecor cauldron for a soup |
take_soup <slot> | Take boiling soup into empty bowl from cauldron |
flame_on | Make fire |
flame_off | Put out the fire |
Взаимодействие с Techage: | |
ignite | Ignite the techage charcoal lighter |
low_batt <percent> | Turn the bot off if the battery power is below the given value in percent (1..99) |
jump_low_batt <percent> <label> | Jump to <label> if the battery power is below the given value in percent (1..99) (see "Flow control commands") |
send_cmnd <receiver> <command> | Send a techage command to a given node. Receiver is addressed by the techage node number. For commands with two or more words, use the '*' character instead of spaces, e.g.:
send_cmnd 3465 pull*default:dirt*2 |
Управление порядком исполнения: | |
jump <label> | jump command, <label> is a word from the characters a-z or A-Z |
<label>: | jump label / start of a function |
return | return from a function |
repeat <num> | start of a loop block, <num> is a number 1..999 |
end | end of a loop block |
call <label> | call of a function (with return via the command 'return') |
jump_check_item <num> <slot> <label> | Check if there are <num> items in the chest like node.
-- If not, jump to <label>. -- <slot> is the bot inventory slot (1..8) to -- specify the item, or 0 for any item. |
jump_low_batt <percent> <label> | See "Techage specific commands" |