Перейти к содержанию

SignsBot: различия между версиями

Материал из Luanti НашиТут
Нет описания правки
Нет описания правки
 
(не показаны 4 промежуточные версии этого же участника)
Строка 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>               
|go one or more steps forward
|один или <steps> шагов вперёд
|-
|-
|cond_move
|cond_move
Строка 16: Строка 16:
|-
|-
|turn_left
|turn_left
|turn left
|повернуться влево
|-
|-
|turn_right               - turn right
|turn_right
|повернуться вправо
|-
|-
|turn_around               - turn around
|turn_around
|развернуться
|-
|-
|backward                 - take a step back
|backward
|шаг назад
|-
|-
|turn_off                 - turn off the robot / back to the box
|turn_off
|выключение и возврат робота в бокс
|-
|-
|pause <sec>               - wait one or more seconds
|pause <sec>
|ожидать одну или <sec> секунд
|-
|-
|move_up                   - move up (maximum 2 times)
|move_up
|подняться вверх (максимум 2 раза)
|-
|-
|move_down                 - move down
|move_down
|опустится вниз
|-
|-
|fall_down                 - fall into a hole/chasm (up to 10 blocks)
|fall_down
|fall into a hole/chasm (up to 10 blocks)
|-
|-
|take_item <num> <slot>   - take one or more items from a box
|take_item <num> <slot>
|взять <num> объектов из слота номер <slot> из ящика
|-
|-
|add_item <num> <slot>     - put one or more items in a box
|add_item <num> <slot>
|put one or more items in a box
|-
|-
|add_fuel <num> <slot>     - put fuel in a furnace
|add_fuel <num> <slot>
|put fuel in a furnace
|-
|-
|place_front <slot> <lvl> - place the block in front of the bot
|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_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_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_below <slot>
|lift the robot and put the block under the robot
|-
|-
|place_above <slot>       - set block above the robot
|place_above <slot>
|set block above the robot
|-
|-
|dig_front <slot> <lvl>   - remove block in front of the robot
|dig_front <slot> <lvl>
|remove block in front of the robot
|-
|-
|dig_left <slot> <lvl>     - remove block on the left
|dig_left <slot> <lvl>
|remove block on the left
|-
|-
|dig_right <slot> <lvl>   - remove block on the right
|dig_right <slot> <lvl>
|remove block on the right
|-
|-
|dig_below <slot>         - remove block under the robot
|dig_below <slot>
|remove block under the robot
|-
|-
|dig_above <slot>         - remove block above the robot
|dig_above <slot>
|remove block above the robot
|-
|-
|rotate_item <lvl> <steps> - rotate a block in front of 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
|set_param2 <lvl> <param2>
|set param2 of the block in front of the robot
|-
|-
|place_sign <slot>         - set sign
|place_sign <slot>
|set sign
|-
|-
|place_sign_behind <slot> - put a sign behind the bot
|place_sign_behind <slot>
|put a sign behind the bot
|-
|-
|dig_sign <slot>           - remove the sign
|dig_sign <slot>
|remove the sign
|-
|-
|trash_sign <slot>         - Remove the sign, clear data and add to the item Inventory
|trash_sign <slot>
|Remove the sign, clear data and add to the item Inventory
|-
|-
|stop                     - Bot stops until the shield is removed
|stop
|Bot stops until the shield is removed
|-
|-
|pickup_items <slot>       - pickup items (in a 3x3 field)
|pickup_items <slot>
|pickup items (in a 3x3 field)
|-
|-
|drop_items <num> <slot>   - drop items
|drop_items <num> <slot>
|drop items
|-
|-
|harvest                   - harvest a 3x3 field (farming)
|harvest
|harvest a 3x3 field (farming)
|-
|-
|cutting                   - cut flowers in a 3x3 field
|cutting
|cut flowers in a 3x3 field
|-
|-
|sow_seed <slot>           - see/plant a 3x3 field
|sow_seed <slot>
|see/plant a 3x3 field
|-
|-
|plant_sapling <slot>     - plant a sapling in front of the robot
|plant_sapling <slot>
pattern                  - save the block properties behind the sign (3x3x3 cube) as a template
|plant a sapling in front of the robot
|-
|-
|copy <size>              - make a 3x3x3 copy of the stored template
|pattern
|save the block properties behind the sign (3x3x3 cube) as a template
|-
|-
|punch_cart                - bump a mine cart
|copy <size>
|make a 3x3x3 copy of the stored template
|-
|-
|add_compost <slot>        - Put 2 leaves into the compost barrel
|punch_cart
|bump a mine cart
|-
|-
|take_compost <slot>       - Take a compost item from the barrel
|add_compost <slot>
|Put 2 leaves into the compost barrel
|-
|-
|print <text>             - Output chat message for debug purposes
|take_compost <slot>
|Take a compost item from the barrel
|-
|-
|take_water <slot>         - Take water with empty bucket
|print <text>
|Output chat message for debug purposes
|-
|-
|fill_cauldron <slot>     - Fill the xdecor cauldron for a soup
|take_water <slot>
|Take water with empty bucket
|-
|-
|take_soup <slot>         - Take boiling soup into empty bowl from cauldron
|fill_cauldron <slot>
|Fill the xdecor cauldron for a soup
|-
|-
|flame_on                  - Make fire
|take_soup <slot>
|Take boiling soup into empty bowl from cauldron
|-
|-
|flame_off                 - Put out the fire
|flame_on
|Make fire
|-
|flame_off
|Put out the fire
|-
|-
|}
|}
Строка 112: Строка 158:
|{{Nowrap|Взаимодействие с Techage:&nbsp;&nbsp;&nbsp;}}
|{{Nowrap|Взаимодействие с Techage:&nbsp;&nbsp;&nbsp;}}
|-
|-
|ignite                           - Ignite the techage charcoal lighter
|ignite
|Ignite the techage charcoal lighter
|-
|-
|low_batt <percent>               - Turn the bot off if the battery power is below the  
|low_batt <percent>
                                    given value in percent (1..99)
|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  
|jump_low_batt <percent> <label>
                                    given value in percent (1..99)
|Jump to <label> if the battery power is below the                                   given value in percent (1..99) (see "Flow control commands")
                                    (see "Flow control commands")
|-
|-
|send_cmnd <receiver> <command>   - Send a techage command to a given node.  
|send_cmnd <receiver> <command>
                                     Receiver is addressed by the techage node number.  
|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.:  
                                    For commands with two or more words,  
send_cmnd 3465 pull*default:dirt*2  
                                    use the '*' character instead of spaces, e.g.:  
                                    send_cmnd 3465 pull*default:dirt*2  
|-
|-
|}
|}
Строка 132: Строка 176:
|{{Nowrap|Управление порядком исполнения:&nbsp;&nbsp;&nbsp;}}
|{{Nowrap|Управление порядком исполнения:&nbsp;&nbsp;&nbsp;}}
|-
|-
|jump <label> -- jump command, <label> is a word from the characters a-z or A-Z
|jump <label>
|jump command, <label> is a word from the characters a-z or A-Z
|-
|-
|<label>: -- jump label / start of a function
|<label>:
|jump label / start of a function
|-
|-
|return -- return from a function
|return
|return from a function
|-
|-
|repeat <num> -- start of a loop block, <num> is a number 1..999
|repeat <num>
|start of a loop block, <num> is a number 1..999
|-
|-
|end -- end of a loop block
|end
|end of a loop block
|-
|-
|call <label> -- call of a function (with return via the command 'return')
|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.
|jump_check_item <num> <slot> <label>
|Check if there are <num> items in the chest like node.
-- If not, jump to <label>.
-- If not, jump to <label>.
-- <slot> is the bot inventory slot (1..8) to
-- <slot> is the bot inventory slot (1..8) to
-- specify the item, or 0 for any item.
-- specify the item, or 0 for any item.
|-
|-
|jump_low_batt <percent> <label> -- See "Techage specific commands"
|jump_low_batt <percent> <label>
|See "Techage specific commands"
|-
|-
|}
|}


[[Category:Всё]][[Category:Mods]]
[[Category:Всё]][[Category:Mods]]

Текущая версия от 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"