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

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

Материал из Luanti НашиТут
Нет описания правки
Нет описания правки
 
(не показано 7 промежуточных версий 2 участников)
Строка 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/Черепашка]
{| class="wikitable mw-collapsible mw-collapsed"
|{{Nowrap|Основные команды:   }}
|-
|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
|-
|}
{| class="wikitable mw-collapsible mw-collapsed"
|{{Nowrap|Взаимодействие с Techage:&nbsp;&nbsp;&nbsp;}}
|-
|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
|-
|}
{| class="wikitable mw-collapsible mw-collapsed"
|{{Nowrap|Управление порядком исполнения:&nbsp;&nbsp;&nbsp;}}
|-
|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"
|-
|}


[[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"