Scripting "chat with Burly Bodyguard"

plus4

New member
Is there currently a way in to chat with the burly bodyguard programmatically? E.g. a CLI command like bodyguard (monstername)

If not, is there a way to do this from an ASH script? This is probably a dumb question, but when the "chat" link becomes available, the link appears to be "main.php?talktobg=1", but running string s = visit_url("main.php?talktobg=1"); doesn't seem to work.
 
Here is my ASH script for chatting with a BG:

Code:
//check if Avant Guard familiar [Burly Bodyguard] can 'chat'
boolean ChkAGCanChat() {
    return (to_int(get_property("bodyguardCharge"))>=50);
}

//Chatting with your Burly Bodyguard, select next Bodyguard monster
boolean SetAGChatMon(monster mon) {
    if (ChkAGCanChat()) {
        familiar fam = my_familiar();
        use_familiar($familiar[Burly Bodyguard]);
        int mid = to_int(mon);
        buffer page = visit_url("main.php?talktobg=1",false);
        if (contains_text(page,"<option value=\""+mid+"\">")) {
            page = visit_url("choice.php?whichchoice=1532&option=1&bgid="+mid,true);
            use_familiar(fam);
            return (to_monster(get_property("bodyguardChatMonster"))==mon);
        } else {
            use_familiar(fam);
            print("Burly Bodyguard Monster not available: "+mon,"orange");
        }
    } else {
        print("Burly Bodyguard Chat not available: "+mon,"red");
    }
    return false;
}
 
Since visiting main.php?talktobg=1 leaves you in choice 1532, instead of

visit_url("choice.php?whichchoice=1532&option=1&bgid="+mid,true);

you could probably do

run_choice(1, "bgid=" + mid)
 
Back
Top