Looking for birdform MP conserving script

Bale

Minion
Nice to know. The reason why I have my things set to Roc, Hot, Cold etc, was because Mafia has the counters preset and I didn't want the script to filter out the feather type every battle.
Reasonable, but I figure it will be really quick if I use a switch statement. Besides it is just so much more elegant and easy to remember to set the goal by the name of the feather.

I'd also love to know how to get the combat percentage from mafia. I have a very clumsy way of processing the data right now, but location names with numbers in them tend to trip up the script.

I'm just starting to test out my script now. As soon as I have it in a working form you can download it to see my extremely simple solution to the problem. :D

What do you mean about location names with numbers in them? I have no idea what you are doing! Could you tell me?

I'm bringing in the entire wishlist to this script. It counts how much your mp will regenerate at the end of a fight and how many moths you have in inventory to recover from the skill use in this battle. Even if your mp are boosted due to the actions of a starfish or coacoabo, those mp are considered as a reason to use another skill.
 
Last edited:

Bale

Minion
Got a little question for you StormCrow. If you aren't in birdform, would you prefer that the script abort and halt the combat, or would you want it to just do whatever is on the next line of your CCS?

The later has the advantage that you won't have to change your CCS just because you're out of gongs.
 

StormCrow42

Member
Got a little question for you StormCrow. If you aren't in birdform, would you prefer that the script abort and halt the combat, or would you want it to just do whatever is on the next line of your CCS?

The later has the advantage that you won't have to change your CCS just because you're out of gongs.

I was going to say continue to the CCS, but upon reflection I think that aborting is a better option. My birdform and non-birdform CCSs are often dramatically different.
 

Bale

Minion
AW! Well, I can do that. And I was doing this...

Code:
// This will use bird skills as much as it thinks it should, trying to space them out based on local combat rate,
// how much MP you regenerate after a battle and how many delicious shimmering moths you have in inventory, then
// it will attack him until he dies. If his defense is too high to hit with a beak attack, then it will use Talon
// Slash instead. If you are not in Bird Form it will turn over control to line 2 in your CCS:
//    [ default ]
//    1: consult BirdformExpress.ash
//    2: skill noodles
//    3: skill shieldbutt

// That will use noodles/shieldbutt if you are not in Bird Form, otherwise it will use bird skills and attacks.
You certain you wouldn't like the script to figure out how to kill your opponent while in birdform? I guess you probably want control to figure out when to use Get a You-Eye View?

Another quick question. I'm trying to cope with some obvious user mistakes. Do you think I should cover any other possibilities for birdGoal?

Code:
	switch(feather. to_lower_case()) {
	case "":        // If there is no birdGoal set in preferences, then assume the feather is a Roc Feather.
	case "roc":
	case "r":
	case "feather": // Give a Roc Feather, since that's probably intended.
	case "fether":
		progress = "birdformRoc";
		return talon;
	case "buzzard":
	case "buzard":
	case "b":
		progress = "birdformStench";
		insect = "delicious stinkbug";
		return statue;
	case "tit":
	case "t":
		progress = "birdformSleaze";
		insect = "tasty louse";
		return flip_off;
	case "penguin":
	case "pengin":
	case "pen":
	case "pe":
		progress = "birdformCold";
		insect = "scrumptious ice ant";
		return antarctic;
	case "phoenix":
	case "pheonix":
	case "ph":
		progress = "birdformHot";
		insect = "delectable fire ant";
		return rise;
	case "raven":
	case "r":
		progress = "birdformSpooky";
		insect = "yummy death watch beetle";
		return carrion;
	default:
		print(feather+ " is not a known feather. Typo? Use command: set birdGoal = Feather", "red");
		abort("Feather must be one of: Roc, Buzzard, Tit, Penguin, Phoenix, Raven.");
	}
 

StormCrow42

Member
AW! Well, I can do that. And I was doing this...

Code:
// This will use bird skills as much as it thinks it should, trying to space them out based on local combat rate,
// how much MP you regenerate after a battle and how many delicious shimmering moths you have in inventory, then
// it will attack him until he dies. If his defense is too high to hit with a beak attack, then it will use Talon
// Slash instead. If you are not in Bird Form it will turn over control to line 2 in your CCS:
//    [ default ]
//    1: consult BirdformExpress.ash
//    2: skill noodles
//    3: skill shieldbutt

// That will use noodles/shieldbutt if you are not in Bird Form, otherwise it will use bird skills and attacks.
You certain you wouldn't like the script to figure out how to kill your opponent while in birdform? I guess you probably want control to figure out when to use Get a You-Eye View?

Actually, your proposed solution looks good to me now. I never use You-Eye View, I've never seen where the MP cost is worth it.

My only once concern is that I'm not certain that a CCS is allowed to do nothing on the first round of combat.
 
Last edited:

Bale

Minion
It's not allowed to do nothing, but I can read the CCS and follow its instructions. I've already worked out how to do that.
 

Bale

Minion
Just had another thought. Since I can read the CCS, that might be a better place to put the preferences for the consult script. How about this:

[ default]
1: consult BirdformExpress.ash
2: skill Talon Slash
3: skill noodles
4: skill shieldbutt
Line 2 is used to define the primary skill for gaining a feather. (eg, Talon Slash, Rise from your ashes...) Then lines 3+ define the order of skills to be used against the monster if you aren't in birdform.

Is that better? Or do you prefer using a "set birdGoal =" command?
 

StormCrow42

Member
I think that the birdgoal is better. The other method just seems to be overloading the CCS in an odd way. It seems like a lot of headache to implement parsing the entire CCS besides.

What might be really interesting would be if CCSs could key off an effect name as well as zone and monster names.
 

jasonharper

Developer
It's not allowed to do nothing, but I can read the CCS and follow its instructions. I've already worked out how to do that.
Down this path lies madness - do you really want your script to break whenever a new command is added to the CCS language? It is allowable for a CCS to do nothing as of r7249 (although combat will still be aborted if it does nothing twice in the same combat, presumably due to it being the last or only line in the CCS section and therefore gets repeated - this is necessary to prevent combat from getting hung in an infinite loop).

As for passing parameters to a CCS, it would be fairly easy to add a "note" CCS command, that could be followed by arbitrary text that would be ignored - but could be accessed via get_ccs_action().
 

Bale

Minion
Oh. And after I'd already done the work you go and suddenly make it legal for a consult script to do nothing... well... thanks.

That's a better and simpler solution.

I didn't know that there was such a thing as a note command, or were you proposing to create it now. That's interesting. StormCrow42, would you like BirdformExpress to receive its parameter from a note command? Like "2: note Roc feather"? Or shall we just go with "set birdGoal = Roc"?
 

StormCrow42

Member
Down this path lies madness - do you really want your script to break whenever a new command is added to the CCS language? It is allowable for a CCS to do nothing as of r7249 (although combat will still be aborted if it does nothing twice in the same combat, presumably due to it being the last or only line in the CCS section and therefore gets repeated - this is necessary to prevent combat from getting hung in an infinite loop).

As for passing parameters to a CCS, it would be fairly easy to add a "note" CCS command, that could be followed by arbitrary text that would be ignored - but could be accessed via get_ccs_action().

A note would be nice. Then you could code goals for different zones or monsters in the CCS rather than trying to futz with passed parameters or mostly duplicate scripts.
 

StormCrow42

Member
I didn't know that there was such a thing as a note command, or were you proposing to create it now. That's interesting. StormCrow42, would you like BirdformExpress to receive its parameter from a note command? Like "2: note Roc feather"? Or shall we just go with "set birdGoal = Roc"?

If this note command exists, reading it would be ideal. Then I could just set my CCS to collect elemental feathers in specific zones rather than futz with the command line.
 

jasonharper

Developer
Ok, "note" CCS command added in r7254. It's not often that a program can be improved by adding a feature that explicitly does nothing!

I would suggest looking for a specific keyword in a note - "note birdGoal = Roc" perhaps. That would keep your script from being confused by a note intended for a different consult script (which are much more reasonable to chain now), or one that's merely a comment.
 

Bale

Minion
Ignore this post. Nearly lost my sanity, but regained it. Thank goodness for free un-deleting software.
 
Last edited:

Bale

Minion
I've prepared this consult script for your pleasure. Please let me know what you think after trying it out. As is my way, I've listed full instructions for its use in comments at the beginning of the script. I'll repeat it here:

This will use bird skills as much as it thinks it should, trying to space them out based on local combat rate, how much MP you regenerate after a battle and how many delicious shimmering moths you have in inventory, then it will attack him until he dies. If his defense is too high to hit with your Beak, then it will use Talon Slash instead. If you are not in Bird Form it will turn over control to the next line of your CCS. Here's an example of how it may be used:

[ default ]
1: pickpocket
2: consult FeatherExpress.ash
3: note Roc Feather
4: skill entangling noodles
5: skill shieldbutt

That will use noodles/shieldbutt if you are not in Bird Form, otherwise it will use Talon Slash, Wing Buffets and/or Attack with your Beak as it attempts to get a Roc Feather. A note in the consulting script will inform it of which feather to get. Obviously pickpocketing is optional. If you leave it out, the script will work just fine. If you're not in birdform, mafia will simply ignore the command.
It may be that it could use a tiny bit more testing, but I thought I'd see what you think of it before I call it done.

Valid parameters for the feather are: Roc, Buzzard, Tit, Penguin, Phoenix, Raven.
 

Attachments

  • FeatherExpress.ash
    7.2 KB · Views: 45
Last edited:

StormCrow42

Member
I tried this script briefly on my ascending character who was in the middle of the war. For the most part, it worked well, but I encountered a few issues. These are my very brief first impressions.

First 3 combats in battlefield after using gong said:
use 1 llama lama gong
Encounter: The Gong Has Been Bung
choice.php?whichchoice=276&option=3&pwd
You acquire an effect: Form of...Bird! (duration: 15 Adventures)

[1251] Battlefield (Hippy Uniform)
Encounter: Beer Bongadier
Round 0: stormcrow42 wins initiative!
Round 1: stormcrow42 casts ALL-YOU-CAN-BEAT WING BUFFET!
Round 2: stormcrow42 casts ALL-YOU-CAN-BEAT WING BUFFET!
Round 3: stormcrow42 casts VICIOUS TALON SLASH!
Round 3: beer bongadier takes 80 damage.
Round 4: stormcrow42 casts VICIOUS TALON SLASH!
Round 4: beer bongadier takes 80 damage.
Round 5: stormcrow42 casts VICIOUS TALON SLASH!
Round 5: Zen looks deep into your eyes. "I see you are too preoccupied with the woes of this world," he says. "This gong will enable you to see things from a different perspective."
Round 5: Zen regards you with a warm smile.
Round 5: beer bongadier takes 74 damage.
16 frat boys defeated; 208 down, 792 left.
You acquire an item: llama lama gong
You gain 12 Strongness
You gain 18 Mysteriousness
You gain 19 Roguishness

[1252] Battlefield (Hippy Uniform)
Encounter: War Frat Elite 500th Captain
Round 0: stormcrow42 wins initiative!
Round 1: stormcrow42 casts VICIOUS TALON SLASH!
Round 1: Zen spits on your opponent. Yech.
Round 1: war frat elite 500th captain takes 81 damage.
Round 2: stormcrow42 casts VICIOUS TALON SLASH!
Round 2: war frat elite 500th captain takes 78 damage.
You lose 11 hit points
Round 3: stormcrow42 casts VICIOUS TALON SLASH!
Round 3: Zen regards you with a warm smile.
Round 3: war frat elite 500th captain takes 80 damage.
16 frat boys defeated; 224 down, 776 left.
You gain 278 Meat
You acquire an item: red class ring
You acquire an item: perforated battle paddle
You acquire an item: tasty louse
You gain 13 Muscleboundness
You gain 12 Magicalness
You gain 24 Chutzpah

[1253] Battlefield (Hippy Uniform)
Encounter: Heavy Kegtank
Round 0: stormcrow42 wins initiative!
Round 1: stormcrow42 casts VICIOUS TALON SLASH!
Round 1: heavy kegtank takes 38 damage.
Round 2: stormcrow42 casts VICIOUS TALON SLASH!
Round 2: Zen spits on your opponent. Yech.
Round 2: heavy kegtank takes 38 damage.
Round 3: stormcrow42 casts VICIOUS TALON SLASH!
Round 3: Zen spits on your opponent. Yech.
Round 3: heavy kegtank takes 38 damage.
Round 4: stormcrow42 casts VICIOUS TALON SLASH!
Round 4: heavy kegtank takes 37 damage.
Round 5: stormcrow42 casts VICIOUS TALON SLASH!
Round 5: heavy kegtank takes 40 damage.
Round 6: stormcrow42 casts VICIOUS TALON SLASH!
Round 6: Zen spits on your opponent. Yech.
Round 6: heavy kegtank takes 39 damage.
Round 7: stormcrow42 casts VICIOUS TALON SLASH!
Round 7: heavy kegtank takes 41 damage.
Round 8: stormcrow42 attacks!
Round 8: heavy kegtank takes 28 damage.
Round 9: stormcrow42 attacks!
Round 9: A smile crosses Zen's serene countenance.
Round 9: heavy kegtank takes 26 damage.
16 frat boys defeated; 240 down, 760 left.
You gain 18 Fortitude
You gain 6 Enchantedness
You gain 24 Chutzpah

As you can see here, the script crammed as many attacks as possible into the first few combats. The remaining 12 combats were all simple attacks.

Also, the script seems to have no logic to decide when it is safe to talon slash more than once rather than wasting the extra MP on a wing buffet. That might be something to add.

Third, although I haven't tested this case and am not certain under what circumstances it might happen (perhaps when playing as a myst class), if you're going for an alternate feather, it's possible for the talon slashes to supersede the other special attack such that you'll end up with a roc feather (if you do your last talon slash after the alternate attack).
 

Bale

Minion
The script does get eager to cast talon slash when you have more than 5 times the MP needed. It assumes that if you're Mp rich, then you'll want to get it out of the way. Bad idea? Easy to change.

The idea of checking if the monster can survive more than 1 talon slash is a good one. I'll work that in -- it shouldn't be hard.

Thanks for reminding me about the problem with excessive talon slashes. I'll have to make sure that it never does more than 14 if your target is a different feather. Though if you cannot hit with your beak, that could put you in a difficult situation. If it realizes that your beak won't work, I guess it should abort and let the user figure it out for himself? You won't have many options since you can't use skills or items, but at least the user will be able to curse his own lack of foresightedness.
 

StormCrow42

Member
The script does get eager to cast talon slash when you have more than 5 times the MP needed. It assumes that if you're Mp rich, then you'll want to get it out of the way. Bad idea? Easy to change.

No harm done there. I didn't notice that logic in the script, it seems like a decent enough idea. I'm not certain exactly where that threshold should be set. I might have a better idea after I ascend again.

My bigger concern is throwing out the wing buffets early in the cycle when it's by no means certain that they'll be needed. Perhaps don't start thinking about wing buffets until 10 or fewer turns of bird form. That will give you a chance to get ahead of the count with just talon slashes first.

The idea of checking if the monster can survive more than 1 talon slash is a good one. I'll work that in -- it shouldn't be hard.

It looks like Therealtahu's pluckfeathers script has some rudimentary logic to that effect you could look at.

Thanks for reminding me about the problem with excessive talon slashes. I'll have to make sure that it never does more than 14 if your target is a different feather. Though if you cannot hit with your beak, that could put you in a difficult situation. If it realizes that your beak won't work, I guess it should abort and let the user figure it out for himself? You won't have many options since you can't use skills or items, but at least the user will be able to curse his own lack of foresightedness.

Or perhaps the user will be able to change where they're adventuring for the time being. As I said, this seems to be something that would most likely come up as a myst class, or when really pumping ML.

Edit: On another multi farming the castle, the script wing buffeted 5 times on the first turn.
 
Last edited:

Bale

Minion
Modified the script based on your feedback.

No harm done there. I didn't notice that logic in the script, it seems like a decent enough idea. I'm not certain exactly where that threshold should be set. I might have a better idea after I ascend again.
Since you like the idea, I kept it, but bumped the threshold up a little. Let me know what you want done with it.

It looks like Therealtahu's pluckfeathers script has some rudimentary logic to that effect you could look at.
It was pretty easy so I just made up my own. Just took one line.

Edit: On another multi farming the castle, the script wing buffeted 5 times on the first turn.
Well, the non-combat rate would make the script a little panicky, but now it will throw on a few more talon slashes.

My bigger concern is throwing out the wing buffets early in the cycle when it's by no means certain that they'll be needed. Perhaps don't start thinking about wing buffets until 10 or fewer turns of bird form. That will give you a chance to get ahead of the count with just talon slashes first.
This is still a problem. I've got some ideas for fixing this, but I'll post it now anyway so you can see its current state.

Not done, but definitely getting closer.
 

Attachments

  • FeatherExpress.ash
    7.7 KB · Views: 144
Top