After carefully examining the code of SmartStasis, I have come up with an excellent solution for pickpocketing that does not routinely break automation. It is still a hack, but as far as everything else is concerned it is expected behavior.
I modified the function in BatBrain that actually performs actions to intercept any submitted pickpocket action, delete it from the macro, run the ASH steal() function (which bypasses the bug in combat macros by submitting the PHP requests manually), then run the macro. As far as BatBrain, SmartStasis, and WHAM are concerned, nothing has changed: the only difference is that the first action of the macro was interpreted separately.
Here is the rewritten function, in case anyone wants to use it themselves. Just search for “string macro(string mac)” in BatBrain.ash to find it in your copy, then replace it.
string macro(string mac) { // basic wrapper, adds action filter to final page
if (my_primestat() != $stat[moxie] && contains_text(mac, "pickpocket")) {
steal();
mac = replace_first(create_matcher(" pickpocket;", mac), "");
}
return mac == "" ? page : act(visit_url("fight.php?action=macro¯otext="+url_encode(mac),true,true));
}