One-Click Level: Automatically gain 1 level.

dj_d

Member
I had to look at the script to refresh my memory here, but it will consider a level safe if it's below your safemox OR if the damage done is less than acceptabledmgpercent. This is because you may be able to one-hit kill things, so you may only care that you don't die if they get the jump.

So the short answer is change acceptabledmgpercent to 0. Then it will only consider moxie.
 

NastyPeasant

New member
downloaded .ash file that says "ver 1.01" in the script (although it's supposed to be 2.0 according to the post?)

put the LevelUp.ash file into scripts, put the .txt files into data

When I run it I get
Expected ), found = (LevelUp.ash, line 264)

I'm at level 10 at the moment, just starting to use KoLMafia.
 

Manxome

New member
I was getting exactly the same error, so I looked inside the script. Turns out on line 264 and several of the following lines, "=" is used instead of "==" during an attempted comparison.

If you're comfortable editing the file, it's easy to fix. Search for "if (locs.loc = " and change it to "if (locs.loc == ". That should do it. There should only be 4, all in the same vicinity.
 

NastyPeasant

New member
I was getting exactly the same error, so I looked inside the script. Turns out on line 264 and several of the following lines, "=" is used instead of "==" during an attempted comparison.

If you're comfortable editing the file, it's easy to fix. Search for "if (locs.loc = " and change it to "if (locs.loc == ". That should do it. There should only be 4, all in the same vicinity.


edited. will test after rollover. Really should learn this language and start scripting...
 

Spiny

Member
The deal with this script is that there are 2 versions. The updated version is included in a password protected file called Ascend.zip. I'm not sure if dj_d has updated the non-packaged version as I've never used this particular script. In general though, you may encounter "=" that should be "==" in older scripts that were written before mafia expected "=="
 
I read somewhere, I believe, that you were a little unhappy with the state of this script. So, as a sort of introduction-to-ash project, I rewrote it a bit.

It's not really smarter than before , but the code is a little cleaner and takes advantage of some ash features that seem to have been created after the script was written.

In brief:
- Code prepared to use zlib-style version checking on this thread, although you could certainly switch it back to the older style.
- Code prepared to use Map Manager (code actually still relies on local files, as it seemed a bit cheeky to upload things that don't belong to me, for a script that's not mine).
- Uses locdata [int] maps rather than locdata arrays. This enables much nicer looping, and gets rid of the need to track array size.
- Uses sort! This means that map files no longer have to be maintained in a particular order. Which implies that only one map file is actually necessary.
- Abstracted the process of choosing a location into its own function, choose_loc(). It just made achieve() easier to read.
- Likewise abstracted the "do you have an mcd?" functionality out of adjust_mcd() into has_mcd(). The moxie-sign code is Deeply Suspect here as it will hit the server until the beach is open. Maybe it's best to replace it with the meatcar check (which has its own problems, but at least doesn't hit the server). EDIT: Bale has just posted a feature request for beach_available(). I love this forum.
- Changed Bonerdagon and Boss Bat mcd checks to check if the var is >= 0, not > 0. After all, 0 ought to be a legal preference for these.
- The logic of achieve is now (slightly) smarter: it will re-evaluate locations when your buffed moxie or max hp change, as these may allow you into a better zone.
- update_damage() is now called. The change from arrays to maps fixed the wonky looping problem.
- A few unused variables removed. (You could remove okmonster() too, unless you're using it in some other script; it's never called.)
- Removed the part of update_xp() which was setting South of the Beach to 0 xp. If it's so bad, I would argue that it just shouldn't be in the map.
- I also may have gone a little crazy with whitespace and comments as I was working out which bits did what.

I was also curious as to why there was no mcd override setting for the Goblin King, but I left him alone. And the integer division you're doing in okloc() and update_misc() makes me worried, but works out just fine, so I left it.

Testing has been fairly minimal, alas, as my characters are all currently pretty high-level and don't represent all moon signs. What I've tested, however, works fine.

I don't expect, of course, that you'll adopt this whole-cloth. But it was a fun exercise for me, and I hope bits of it may be helpful if you do ever rewrite this script. (Of course, if you did want to snag the whole thing, it would be terribly flattering.)
 

Attachments

  • LevelUpRewrite.ash
    15.4 KB · Views: 137
Last edited:

dj_d

Member
Aqua - that's awesome! I'm PMing you a small thank you. I haven't tried it yet (not ascending at the moment) but I will as soon as I have a chance.
 

Nagol

New member
this is the first script i've used ever, so this may be a dumb question, but why does it send you a kmail?
 

Bale

Minion
Not a dumb question at all!

Some scripts use a command called "notify". This command has to be at the top of the script (before anything except comments and the "script" command) so that it cannot be hidden. That way you can find it easily if you want to delete it.

Some script writers... a lot of script writers actually, think it is pretty cool to get a k-mail that says...

From SomeGuy (#1234567) [reply] [quoted]
Date: Monday, December 14, 2009, 04:34PM

I have opted to let you know that I have chosen to run < Universal_recovery.a sh>. Thanks for writing this script!
It doesn't give out any personal information except for your name, but it lets us feel good to know that someone is using our script. Mafia tries to send out this information only once per script, but if you move the script to a new location mafia thinks it hasn't sent the kmail yet and does it again.

We don't get paid for this, so we accept these kmails as our recompense and we're really happy to see them so that we know our efforts are being enjoyed. In case you're curious, some of us use this web site to keep track of our notifies.
 
Last edited:

Nightmaster

New member
Ok, i know that this thread hasn't seen some action in a while, but in conjunction with the Ascend.ash, this keeps coming up:

> call scripts\Ascend.ash

Function 'get_safemox( location )' defined multiple times (LevelUp.ash, line 85)

What should I do here?? I've been unable to use ascend.ash for weeks because of this error.
 

dj_d

Member
You should use the version of each script that comes bundled with ascend.ash, and not update them piecemeal. There's a beta version in the second-to-last post in the ascend.ash thread that includes the most recent versions of all the subscripts, including this one.
 

Nightmaster

New member
You should use the version of each script that comes bundled with ascend.ash, and not update them piecemeal. There's a beta version in the second-to-last post in the ascend.ash thread that includes the most recent versions of all the subscripts, including this one.

For the record, I am using the latest versions of all of the files (As procured from the Ascend thread), and KolMafia. This does not remedy my error. So now what?
 

peter50216

New member
in the function "update_misc()"

Should those "+combat_rate_modifier()" be "-combat_rate_modifier()"? It should be more xp when I have more -combat, and combat_rate_modifier() return a negative value when I have -combat.
 

CKtheFat

Member
I hate to necro a thread so old, but does anyone have a newer version of this script that works post-Giant's Castle? Is there a newer script that does the same?

I've been trying to make some changes to get it to run myself but am not sure which file is causing it to halt upon reaching the "Multiple matches against Giant's Castle" error. Zlib is update to date and I don't see any references to Giant's Castle in the locs_by_meat.txt or locs_by_xp.txt files.
 

Theraze

Active member
Unless yours is quite different from mine, the top line in locs_by_meat is Giant's Castle, and the fifth line down in locs_by_xp is Giant's Castle. Easiest 'fix' is to delete both lines. Or figure out working data for the 3 new locations... but easiest is to just delete.
 
Top