PDA

View Full Version : CNCS (Custom Non-Combat Script)



Tpj_4000
12-17-2011, 07:46 PM
Is there any way to do this? I know you can set choice adventures via the drop-downs, however, I'd like something more robust. For instance, I'd like a way to choose the fudge wasps 3 times and then switch to super-heated fudge ONLY if my remaining turns of Stop and Smell the Fudge (fudge lily choice) are greater than my_adventures(), otherwise choose the fudge lily until I have enough. Now this case is Crimbo specific, but I have been thinking about this for a while now and Crimbo just gave me a good reason to investigate this further.

Where this all stems from, is, I recently wrote my own adventureX() wherein I completely handle the fight using visit_url() and go through the rounds with "fight.php". This was partly to see if I could do it, but more so to have complete control over what is going on. In any case, when I parse the results to detect whether I was given a combat or non-combat, I don't want to be responsible for handling all of the non-combats in the game; that's what mafia devs do (update and handle the list). Once I parse out that I was given a non-combat, if it is not one that I care about, I would like to dump control to mafia to hadle the non-combat choices based on the pre-sets. However, I would need control back once it is handled. I could just call adventure(1, loc) and let mafia handle the choices. But that really sucks because 95% of the time I won't care what the non-combats are and I'd be hitting the server twice for each unwanted non-combat.

So, back to my original question. Is there a way to have a 'Custom Non-Combat Script' to preempt the non-combat choice handling where I could check to see if it is a non-combat I cared about, set my choices how I want them, then dump control back to mafia?

Bale
12-17-2011, 08:21 PM
You can use a betweenBattleScript or a script in your mood to dynamically change the choiceAdventure### values depending on your character's circumstances or the number of times you've fought fudge wasps. Check zarqon's BestBetweenBattle (http://kolmafia.us/showthread.php?1240-Best-Between-Battle-Script-Ever-formerly-AutoMCD) to see how to do this.

StDoodle
12-17-2011, 09:56 PM
Just don't forget, a Between Battle Script will never fire during manual adventuring. For that, you'd have to call a script in your mood.

slyz
12-17-2011, 10:53 PM
Perhaps you could use your adventureX() function in combination with the choice CLI command JasonHarper added in r10025.

Theraze
12-17-2011, 11:08 PM
Doesn't having the "Show in Browser" message come up involve an abort, so if your script hits there, it will stop running? I seem to recall that behaviour when queuing up multiple items and having a manual choiceadv come up before the next item did...

Edit: Also, was just noticing... this thread is in the CCS section. Should probably be moved by a minion to Scripting Discussion?