Try replacing line 818
withPHP:maxme = "moxie -tie";
PHP:maxme = "moxie -tie -melee";
Done that change now. It was only during the orchard that it wanted to use a melee weapon though. I did that sidequest manually and then when starting the script it used a ranged weapon again for the battlefield.