Sea Scripts? Dolphin handling specifically.

Adventuring in the Sea isn't too difficult and can be done with creative usage of custom combat scripts.
Youd make sure you kill some of the dangerous monsters fast, and then use a round 29 uber-power in case you get Seriously Poisoned and can't hit them.

The problem is handling Dolphins. No matter how you slice it, there will be a chance equal to the normal item drop percentage that a Dolphin will come steal it.
Fortunately, you can use a Dolphin Whistle every 10 turns to retrieve the latest stolen item.

Here is the logic I use (manually).

Adventuring Normally:
1) Before adventuring, Is my Dolphin Whistle Cooled down?
a) If not, skip this step.
b) If so, check to see if Dolphin's Latest Steal == Valuable.
b1) If Valuable, then call Recover() method.

2) Do the Adventure. Check if Dolphin stole something after combat.
a) IF it is something crappy, note Dolphin's Latest Steal == Crap.
b) IF it is something valuable, note Dolphin's Latest Steal = Valuable.
AND attempt to Recover().

Recover()
1) If I have no cooldown, blow the Whistle and beat up the dolphin.
2) If I Do have cooldown, no action needed. (Item #1 under normal adventure will handle this case)


My obvious problem is that I have NO CLUE how to detect Dolphin Stealage, and then find out what it stole. From there, I'd compare what stolen to see if it is == Valuable (based on a table or Case statement/bunch of IFs). Otherwise, I'd mark it as Crap.

Anyone have any advice? :)
 

Bale

Minion
Check zarqon's Best Between Battle Script Ever. He's solved the problem there, so you've got a good example to study. The trick is not to worry about detecting stealing, just check after every battle to see your cooldown state and the current stolen item. mafia keeps track of the last stolen item as well as the cooldown state for you, so you just need to decide if you want to use a whistle.
 
Wow, thanks for the quick response man!

I totally missed that dolphin reference earlier. Maybe I can level up my scripting skillz by studying his work. :)
 
I run this as an unconditional mood (cuz I love all the work that's gone into best between battle script, but I don't need all that).

Code:
// dolphin.ash

void main(){
 
if (get_counters("Dolphin",1,11) == "" && to_item(get_property("dolphinItem")) != $item[sand dollar] && (is_goal(to_item(get_property("dolphinItem")))) 
{
      if (item_amount($item[dolphin whistle]) == 0 && mall_price($item[dolphin whistle]) > mall_price($item[sand dollar]))
      visit_url("monkeycastle.php?pwd&action=buyitem&whichitem=3997&quantity=1");
      if (retrieve_item(1,$item[dolphin whistle])) use(1,$item[dolphin whistle]);
}
}

The trick is having whatever you want to steal back as a Goal. i.e. +10 pressureglobe. Good luck.
 
What happens when you use the dolphin whistle?

Is there any way to make it beat down the dolphin automatically?

In other words, I'd like to add this snippet to my Sea.ash script which has me doing various adventures in the sea.

As such, Id want to call this inbetween adventures and then make it fight the dolphin and continue onwards.
 

Bale

Minion
When you use the dolphin whistle from a script, it will fight a dolphin automatically. Here's the dolphin routine that I use. Note that I don't need to use a run_combat() command to actually fight it.

Code:
void dolphin(item dolphinItem) {
	if(get_counters("Dolphin",1,11) == "" && dolphinItem != $item[none]) {
		boolean no_goals_here() {
			foreach num,mob in get_monsters(my_location())
				foreach it in item_drops(mob)
					if(is_goal(it)) return false;
			return true;
		}
		if(is_goal(dolphinItem) || (no_goals_here() && mall_price(dolphinItem) > 
		  2*(min(mall_price($item[sand dollar]),mall_price($item[dolphin whistle])) + get_property("valueOfAdventure").to_int()))) {
			if(item_amount($item[dolphin whistle]) == 0 && mall_price($item[dolphin whistle]) > mall_price($item[sand dollar])
			  && retrieve_item(1,$item[sand dollar]))
				visit_url("monkeycastle.php?pwd&action=buyitem&whichitem=3997&quantity=1");
			vprint("Whistling for a "+dolphinItem+"...","blue",2);
			if(retrieve_item(1,$item[dolphin whistle])) use(1,$item[dolphin whistle]);
		}
	}
}

void main() {
	dolphin(to_item(get_property("dolphinItem")));
}

I think it is a little weird to call it in the farming script though. It would make more sense to add that script to your mood (as an unconditional trigger: call dolphin.ash) and let mafia call it automatically between each and every adventure.
 
Last edited:
Thanks for the assistance.

I am using it in the actual script because I also check several other things inbetween combat in the same script, such as low MP/HP, cure Really Quite Poisoned, plus the Dolphin handling.

I realize that Mafia can deal with all that for me, but I don't like it to auto-cure conditions since very few are ever crippling. Ditto with low HP/MP recovery.



So one more quick question then:

How do you determine the 'magic url' of visit places?

For example, to buy sand dollar, visit_url("monkeycastle.php?pwd&action=buyitem&whichitem=3997&quantity=1");

Lets say I want to get the 3 Skate Park buffs (Busker Do, etc). How do I figure out their URL? I think the KolMafia minibrowser can do this, but a specific process for doing so would certainly be appreciated. Thanks a ton!
 

slyz

Developer
The KolMafia minibrowser indeed shows you the url of the page you just visited, including all those php thingamajigs. I don't know of any other way, but would like to know if there are. Maybe looking at the html code?
 

Bale

Minion
I don't like it to auto-cure conditions since very few are ever crippling.
Agreed. That's why I turn off auto-remove malignant status effects and use this in my mood:





Lets say I want to get the 3 Skate Park buffs (Busker Do, etc).
Code:
[COLOR="#808000"]> help skate[/COLOR]

skate lutz | comet | band shell | merry-go-round | eels - get daily Skate Park buff.
 
Top