Custom Combat Integration

Status
Not open for further replies.

hippybasher

New member
I've been using a script to accomplish my eating, drinking and buffing for a while now and it has been great for saving time. I recently decided to try and integrate the adventuring into my script, but I'm at a loss when it comes to completing this. I know the syntax to perform this inside of KoLMafia, but would appreciate any assistance that anyone could provide. Here is the snippet of the code that I could use help with:

[size=8pt]//adventures
void adventures()
{
while( my_adventures() > 0)
{
adventure( 1, $location[castle in the clouds in the sky]);
}
}
[/size]

What I would like to do is effectively this:
[size=8pt][ default ]
1: item facsimile dictionary
30: attack with weapon
[/size]

Can anyone help me with this or point me in the right direction?
 

macman104

Member
I assume you're probably using an NPZR, however, I believe that if you are out of ronin, or not in hardcore, mafia will detect that you are trying to NPZR-farm, and will hop out of the custom-combat and attack like normal. However, to use custom-combat, you just choose to set your attack option to custom-combat script in the main adventure frame, and then run the script.
 

hippybasher

New member
That's what I've been doing. I use the script to farm meat after each run, and you are correct about the NPZR. I was just wondering if there was a way to code it into the script. If there is a way that anyone knows of "hardcode" this then please let me know and if not I'll just carry on letting Mafia do the "work" for me.
 

holatuwol

Developer
I'm locking this thread on principle (I absolutely despise NPZR stasis). However, since you used proper spelling and you've otherwise followed forum guidelines, what you're looking for is set_property() on the battleAction field, which accepts a semi-colon delimited list of commands and transforms them into a custom combat script.



PHP:
// To be honest, I find it rather sad that people would
// use NPZR stasis after breaking Ronin.

string old_action = get_property( "battleAction" );
string new_action = "";

for i from 1 upto 29
    new_action = new_action + "item dictionary;";

new_action = new_action + "attack;";

set_property( "battleAction", new_action );
adventure( my_adventures(), $location[castle in the clouds] );
set_property( "battleAction", old_action );
 
Status
Not open for further replies.
Top