When using an anvil, the cursor runs along firmly set coordinates, so I advise you to reconfigure them for yourself. The cobblestone generator should be 5 blocks long and 1 wide. During the process, the personage digs - goes to the side of a couple of blocks - opens the anvil and repairs the tool with the subsequent repetition of the cycle. I did it for myself and everything works fine, the problem can only occur when changing the position of the window and the resolution of the monitor (I have 1920 by 1080 and the window is in the lower left corner) (I didn't bother with the relative position of the cursor) I played on VimeWorld
Download the program (Download) and go to the macro editor
press the button «Open file»
and select the downloaded file
assign a macro to a key and run the program