It doesn't seem like it would be incredibly difficult to fix, do you have the source code
https://www.puzzlescript.net/editor.html?hack=d3e36523514fe4c3077e63d9ad4fdfa5
This is the source code I used for the patrol robot.
https://www.puzzlescript.net/editor.html?hack=d3e36523514fe4c3077e63d9ad4fdfa5
This is the source code I used for the patrol robot.