parent nodes: YSokoban
Macros
Sometimes you need to play some repeating actions several times. In such a case most of the text editors provide so called macros. In general you record some actions and then you can play them several times. With YSokoban you can do that with simple text editor and just use copy/paste functionality in YSokoban.
Since version 1.500 you can do that with a help of a Macro Dialog. Activate it by pressing button. In macro dialog you can create new macro by simply typing it using lurd notation or you can press button. Then YSokoban will record all your actions. When you finish - press button ("Macro" changes name to "stop rec") and you will have all of your moves recorded in New Macro. Now you can play it many times and/or you can save it under some name, by giving name in "Name" edit box and pressing button. Left part of a Macro Dialog will show all saved macros. You can select them and play selected one.
Play macro
One can use M and Shift-M keys in YSokoban to play New or Selected Macro.
Repeat counter
If '*' is used as a repeat counter (instead of number) then following command (or macro or group) will be repeated until failure, for example: or *(lddr) or *{macro} or just *l. Using *(lr) or *(ldru) will move man infinitely (if there is space for it to move).
Strict checking
If using '&' instead of '*' as repeat counter then YSokoban will make a strict check for move/push. This means that when strict check is active it will not make a push if move is specified. So for strict check 'r' means move right, not push right and 'R' means push right not just move.
Undo in macro
It is possible to specify undo in macro, use '~' for undo.
Preserve man position (and go back to there)
Sometime there is a need to preserve current man position and later on go to that place.
'+' will push current position
'@' will pop position and man will try to go there.
'#' will pop position and man will not move.
It is possible to specify relative offset to pushed position (or popped one) by using [x,y]. For example +[3,4] will push man position +3 columns and 4 rows (positive numbers means right or up, negative means left or down). Later on @ will move man there. @[3,5] will not pop position from stack, simply man will move relatively to offset 3,5 (position current_x+3 and current_y+5).@(3,5) (note parenthesis instead of brackets) will move man to absolute position 3, 5.