Sharpen Your Saw & Become a New You

coandco

Member
I've got a patch for the Olfaction thing, and it works. In SharpenSaw(), replace this:
Code:
		if (page_text.contains_text("Combat") && (last_monster() == mon || mon == $monster[none])) {
			combatText = use_skill(sk);
		}

with this:

Code:
		if (page_text.contains_text("Combat") && (last_monster() == mon || mon == $monster[none])) {
			if (have_skill($skill[Transcendent Olfaction]) && $effect[On the Trail].have_effect() <= 0) {
				use_skill($skill[Transcendent Olfaction]);
			}
			combatText = use_skill(sk);
		}
 

fronobulax

Developer
Staff member
Any chance it could detect that some idiot failed to set their healing options or "abort on Beaten Up" and just stop when there are zero HP instead of continuing?
 

fronobulax

Developer
Staff member
Mortar Shell on rattling duck. Post war. Script failed to stop when duck supply was exhausted and then when Stop Now button was mashed.

Sending me after an unavailable monster is a KoL problem but it would have been OK if the script stopped when
You wander around the farm for a while, but can't find any additional ducks to fight. Maybe some more will come out of hiding by tomorrow.

Thanks.
 

zarqon

Well-known member
You might consider parsing the quest information from the quest log instead of your kmail.

Pros:
- You don't have to verify that it is today's quest.
- You don't have to check for quest completion.
- You can start mid-quest since the number already completed is there.

Cons:
- No adventuring location is provided there. Easy enough to figure out though by foreaching locations[], which also solves the previously encountered problem of location names that don't work with to_location().

This code:

PHP:
   matcher m = create_matcher("Looks like you've cast (.+?) during (\\d+) of the required (\\d+) encounters with (?:a|an|some) (.+?)!", visit_url("questlog.php?which=1"));
   if (m.find()) {
      for i from 0 to m.group_count() print(i+": "+m.group(i));
      monster target = to_monster(m.group(4));
      foreach l in $locations[]
         if (!l.nocombats) foreach mon,rate in appearance_rates(l)
            if (mon == target) print("Found in "+l+" with an appearance rate of "+rate);
   }

outputs this for me today:

0: Looks like you've cast Dissonant Riff during 0 of the required 7 encounters with a spooky vampire!
1: Dissonant Riff
2: 0
3: 7
4: spooky vampire
Found in The Spooky Forest with an appearance rate of 7.5
 

Sytras

Member
Another patch: I recently had the cabinet of Dr. Limpieza as my monster and the regex failed, because it was looking for (a|an|some), and "the" tripped it up. As such, here's the new regex that worked:

Code:
matcher m = create_matcher("Cast ([^,]+), once per fight, against (a|an|some|the)? (.+) ([0-9]+) times \\(look in (.+?)\\)", mtext);

I had a similar issue with a different monster starting with "the" and this patch worked for me too.
 

coandco

Member
Okay, since the original author of this script seems to be AWOL, I've cloned it on GitHub, and will be making my patches there. You can check my version out with this command:
Code:
svn checkout https://github.com/coandco/mafia-NewYou/trunk/

For now it's identical to digitrev's script, but I'll be integrating the questlog checking and BatBrain variables shortly.
 

coandco

Member
My fork of the script has now been updated to parse the quest log and use/set BatBrain variables to handle olfaction and skills. For those who are using it, this means that the script now has an explicit dependency on using a BatBrain-based CCS -- I recommend WHAM. I haven't fully tested this update yet, as I managed to run through today's quest before finishing the code, but everything looks reasonable so far. I should have the code fully tested next rollover.

Also, since the original author appears to be MIA, what's the procedure for taking over maintenance of a codebase? Would it be possible to have a mod edit the original post to point it at my new repository?
 

lostcalpolydude

Developer
Staff member
Also, since the original author appears to be MIA, what's the procedure for taking over maintenance of a codebase? Would it be possible to have a mod edit the original post to point it at my new repository?

I think the best thing is for you to make a new thread, linking to this thread as the starting point for your version.
 
Top