Sharpen Your Saw & Become a New You

digitrev

Member
Want to become a better and Newer You? Want to do without any thought whatsoever? Then try NewYou.ash, and watch your saw sharpen itself. Just install the following package.
Code:
svn checkout https://svn.code.sf.net/p/digitrev/code/NewYou
Then, call it from the CLI with
Code:
NewYou
or pick it from the Script dropdown menu.
 

digitrev

Member
Self-help gibberish aside, this will:
  • check to see if you have the appropriate Eudora set
  • parse out your most recent correspondence into:
    • which skill to cast
    • against which monster
    • how many times
    • in which location
  • try to Olfact the monster of interest (uneffecting On the Trail if necessary)
  • fight an appropriate number of monsters, casting the appropriate skill before running your usual combat script

Please let me know if there are any problems.
 

digitrev

Member
As advised by bmaher & others, I will investigate what to do if the monster cannot be parsed out uniquely. I have added code to abort if a monster cannot be found, but until I get a good testing opportunity, there's not much I can do.
 

Crowther

Active member
Code:
        if (my_inebriety() >= inebriety_limit())
I believe that should just be greater than.

EDIT:

After than change it ran fairly well. There was a harmless error message at each non-combat. I see you tried to use adventure() and opted to directly hit the URL. Hopefully that can be fixed, because none of my between battle type stuff worked. Still, I was very happy not to have to do this manually.
 
Last edited:

digitrev

Member
Should try to fire between battle stuff and properly check inebriety. Can you send me the error you got after non-combats? I'll see what I can do about those.
 

Crowther

Active member
Can you send me the error you got after non-combats? I'll see what I can do about those.
Drat, that didn't get saved into my session log. It was something like "You don't have a skill called 1 clobber". Looking at your code, I think this is because you test for a choice adventure and this non-combat had no choice, so use_skill() was called outside of combat.
 

Crowther

Active member
I haven't seen it myself, but there is another corner case. If you cast a skill that doesn't advance the round, it doesn't sharpen your saw. Saucy salve for example. It looks like that could cause this script to spend all your turns without sharpening, so like any new script keep an eye on it.
 

ereinion

Member
Any chance you could add functionality to have it end combat by itself? I usually just set a combat macro to autoattack in kol, and have my ccs in mafia set to abort in case I have forgotten to do the previous, or if something fails at some point :p I could switch ccs for this script, but more automation is better >_>
 

digitrev

Member
  1. For skills that don't cost a round, I'll have to wait until I get an appropriate test case.
  2. Monsters that start with vowels should be properly handled.
 

Crowther

Active member
Any chance you could add functionality to have it end combat by itself? I usually just set a combat macro to autoattack in kol, and have my ccs in mafia set to abort in case I have forgotten to do the previous, or if something fails at some point :p I could switch ccs for this script, but more automation is better >_>
I'd recommend you set your CCS to use WHAM.
 

Crowther

Active member
  1. For skills that don't cost a round, I'll have to wait until I get an appropriate test case.
  2. Monsters that start with vowels should be properly handled.
  1. For sure. I tried to come up with a way to handle it and got worried about all sorts of potential problems.
  2. Another odd edge case.
 

digitrev

Member
Yeah, my original attempt was to use a combat action filter, which would actually keep firing the skill until the combat round advanced, but unless the bug I reported gets fixed, I can't think of a good way aside from just spamming it until we see the saw message.
 

heeheehee

Developer
Staff member
If you can submit a macro to handle the beginning of combat, that may be the simplest option ("while !pastround 1; skill saucy salve; endwhile"). No need to worry about Mafia not recognizing (round-)free actions.
 

digitrev

Member
Good idea, hee^3. I'll look into that.

Also, a few minor updates:
  1. The "Fun House" and other locations with wonky names should be handled now.
  2. I've put in some code to hopefully handle non-unique monsters. The solution is just to use the skill against every monster in the zone. Rather inelegant, I suppose, but it oughta work.
  3. I've also put in handling so that if it fails to parse the location, skill, or number of times it should be used, then the script stop.
 
The script worked fine for me yesterday, but today gives this error:
Cannot apply operator || to 0 (int) and sk = none (skill) (NewYou.ash, line 98)
For reference, my Eudora message for today follows:
Engaged Proactive Winners,

Our next mind snack is based on the win-win strategy of Zig Zigglar:

Vanquish Doubt

A good way to feel this life system is to do it from morning to night! Meditating on this will make you a incarnate engager. If you wait, you lose. A trick to embrace this dollop of wisdom is to visualize that you are a REINCARNATE EXECUTER!! Focusing on this will make you a real thinker. If you procrastinate, it's too late. Do you fret that you may grow old? If you live with this message you'll never lose your friends. A helpful trick to execute this dollop of wisdom is to imagine that you are a HUMBLE POSITIVIST.

Great job with yesterday's mind empowering!
Affirmation Cookie You acquire an item: Affirmation Cookie [eat]

You should focus on priority prioritizing today. Cast Cannelloni Cannon, once per fight, against a Chowder Golem 7 times (look in Tower Ruins).

You currently have 8 VIP membership points. You'll reach the next VIP level at 14 points!
EDIT: Changing "amount=0" to "amount==0", making a similar change to the next test, and adding a semicolon after the next abort statement made the script actually show that abort statement, so it seems it's a problem parsing the message. By separating out the tests on line 98 I determined that none of those variables are set. Your regular expression seems like it should match my message, so I'm not sure where the error lies.
 
Last edited:
With the updated script I got the "Parsing failed" message. I tried looking at the readCorrespondence function first but none of my debug stuff showed, so I checked where that function is actually called elsewhere, and I noticed that it's called after the "Parsing failed" check. I moved it before the check, and the script now works.
 
Top