Libram summon MP bug

barnaby36

New member
This isn't the first time this has happened to me:

I'm using a script with MP burning, and it can't seem to wrap its head around the MP costs for my Libram summon skills. I think it still thinks the cost is 1, when right now it's 169. So the script I'm using aborts whenever it tries to summon from the librams. Exasperating!

Any advice? At the very least, is there a way to cut libram summons from the burning routine?

Ben
 

barnaby36

New member
Hate to double post, but:

Bringing up the issue in the bug reports thread didn't seem to get anywhere. I'm surprised it's listed as a priority 10 bug - it wrecks an awful lot of scripts and reveals that mafia is not tracking skill casts correctly from the relay browser. Why isn't that a big deal?

Ben
 

Veracity

Developer
Staff member
By all means - if it's a "big deal" for you because it "wrecks an awful lot of scripts" (we know of exactly one, so far - the one you mentioned in your post), then show us some code to fix it and we'll be happy to look at it.

Until then, it will have to wait until we take a personal interest in looking into it.
 

barnaby36

New member
Also Bale's Auto-Recovery, or anything that wants to burn mana. I will look into it if you would direct me to where I can find code related to fetching mana prices for Libram summons - although I am rather inexperienced at coding anything that parses web information.

I'm sorry that I'm being insistent about this, but I don't understand your hostility. Is there a reason this long-standing bug hasn't been looked into? Or why it is so low-priority when (to pick a few out of a hat) window sizing and a warning to use clubs on infernal seals are rated as "5"s? I should think that an error in mafia which halts automation of anything that could summon from a libram is a pretty important deal.

If for some reason this task proves too difficult or remains uninteresting to you, is there a way to prevent the automation halting when mafia finds it doesn't have the mp to cast a non-combat skill? I suppose that's what's most annoying about this bug to me.

Ben
 

Veracity

Developer
Staff member
Clue 1: WE do not set the priorities. Whoever writes the bug report sets it to whatever they want. Therefore, your emphasis on the difference between how you perceive the priority and whatever random number the bug creator set it to is not helpful.

Clue 2: The longevity of a bug, similarly, has little to do with when - or whether - we look into it. In fact, once it scrolls off the first page, it's harder to see and we have to actively look through back pages of bugs. Speaking for myself, I only do that when I'm actively looking for a bug to fix. Which leads to:

Clue 3: Maintaining KoLmafia is not my JOB. I've been working 7 days a week on a contract - real money-generating work - for the last month and a half. I have continued doing this and that in KoLmafia during this time, but I'm certainly not scouring the bug list looking for things to do. Instead, I fix things that either are easy, personally interesting, or affect me directly.

Your pet issue is (probably) none of those.

I reacted the way I did because I didn't like your tone. It's one thing to lobby for us to take our precious time and fix such and such a thing. It's another to, as I saw it, criticize us for not doing so.

This is an Open Source software project. I think my suggestion was perfectly reasonable: if this issue is SO important for you, you are free to take the source and do whatever you want in it - including fixing this issue. And, having done so, feel free to submit the patch back to us for submission into the official source tree.
 

Grotfang

Developer
This isn't directly related to the thread, but is related to your last comment, Veracity. If we do want to submit a patch, can you outline how to go about doing that? There have been times before when I have changed stuff in my own version (fixing chat_clan() when it was first released being one of them) but haven't really known how to submit it to the tree, so I just left it, knowing that one of the devs would eventually get round to it.

On topic, you are entirely correct. Bug and feature requests are great, but ultimately this is a game, and getting angsty about a voluntarily maintained project simply isn't appropriate. You guys do an amazing job here and are appreciated for it.

Cheers
 

Veracity

Developer
Staff member
The only people who can directly submit to the tree are those with sourceforge accounts that we have given commit privileges there. At the moment, that is hola, me, jasonharper, DoctorRotelle and fronobulax. At least, those are the only ones I can think of who have submitted anythingin the last year or so.

I'm not sure what it would take to get added, at this point.

Hola simply added me, way back when, when I told him an idea I had and asked if I could put it in. He then looked at every single commit I made for the next year and made (increasingly minor) changes to every one of them. :)

Jason sent me patches to look at in e-mail and joined the dev forum and posted a note with a big list of projects he wanted to do. I liked his code, he seemed to "get" our style and make an effort to format things the same way, so I added him. I don't look at his submits anymore, unless I happen to be working the same area myself - or he submits a bug which bites me. He's worked out pretty well, I think. ;)

So, basically, send a patch to one of us for consideration and we will submit it for you. If you have bigger projects in mind, talk to me, and perhaps you can come discuss them on the dev forum.
 

barnaby36

New member
OK, I understand that the internet doesn't translate tone very well at all. But I ask that you reread my posts and try to see them without the entitlement and criticism that you accuse me of harboring. I do not intend to criticize you or your work in anything but a constructive manner.

I created this thread because I misunderstood the nature of the Bug Report forum, because I was looking for help in ways to avoid Mafia's undesirable halting in the middle of masterfully automating turns and other tasks, and because I did not know you were already aware of this issue.

With respect to your points, I once again misunderstood the nature of the Bug Reports forum - I thought that it was a place where Mafia's devs such as yourself posted issues you considered to be of interest, and that the "Priority" number was set by you to communicate your thoughts on when it would be fixed, complexity permitting.

The fact that the Libram bug had scrolled off the front page is exactly why I posted in that topic once Spiny kindly provided me with the link to it. It seems to me that most people use Libram skills from the CLI or some other manner that Mafia tracks better than it does the Relay Browser, so you don't encounter the bug very often at all. So by lobbying about this one, as you put it, I'm keeping this bug in your attention. If you don't want it there at all, I suppose I'll shut up about it - but the fact that Mafia isn't watching what you do on the skills page leaves me a bit wary of how it is keeping track of my character state.

I absolutely and fully understand that maintaining Mafia is your hobby, and I am extremely grateful for your time and effort in helping us other players have a more streamlined and exciting experience playing KoL. I had thought that by highlighting a seemingly significant bug that appears to have passed under your notice, that I would be helpful in some manner. I was by no means seeking the answer to be provided to me on a silver platter, nor trying to be a thorn in your side - just another player, seeking help on an issue that's been making my use of your software a little less enjoyable.

Finally, I would very much like to be helpful in actively participating in the development of KoLmafia, but despite my so far three and a half years of CS study in university, I still find myself baffled with the less abstract aspects of the art of coding. Using Eclipse as an IDE, how do I go about reading the project source code?

So, once again, thank you for the work and time you put in to making KoL an even greater experience for me and the thousands of other players who use it. I am truly sorry for having miscommunicated my problem so as to insult you, and I hope that we can walk away from this thread with a bug resolved and no hard feelings.

Ben
 

holatuwol

Developer
Would you mind explaining what the MP consumption formula is supposed to be?

Edit: Never mind, Rinn indicated in the bug report that there is no problem with the formula being used to calculate the MP cost, just that invocation of the skill from the skill page might not be properly recognized. I'll poke at that later tonight.
 
Last edited:

starkid

New member
I made a bug fix for this issue. I already sent it to Veracity via forum private message, but I haven't heard anything back yet... So I just thought I'd post it here too in case someone else wanted to take a look at it for me. I'd really appreciate some feedback.

The txt file is a new data file.
 

Attachments

  • libramsummon.txt
    538 bytes · Views: 42
  • libram_bugfix.diff
    7.5 KB · Views: 34

Veracity

Developer
Staff member
Sorry for the non-response; I just noticed I had a forum PM.
I'll look at your submission.
Thanks!
 

Veracity

Developer
Staff member
I don't think you have the correct approach. Re-synching libram costs every time we do a processResult on something which is in the list of summonable items will also cause the cost to be recalculated when you open a gift package and pull out such an item, for example.

The real issue is that using a libram skill from the skill page does this:

skills.php?action=Skillz&whichskill=8100&quantity=1&pwd
redirected to
campground.php?quantity=1&preaction=summoncandyheart&pwd&skilluse=1
redirected to
skills.php?message=1

and by the time we get to the last one, we can't figure out what happened by looking at the URL. Using items from inventory does something very similar and we'll have to use the same technique we use for that to handle libram skills from the skill page, it seems.
 

Veracity

Developer
Staff member
Triple post! Revision 7969 should track MP cost for librams correctly, even when you use them from the Skills page.
 

starkid

New member
Re-synching libram costs every time we do a processResult on something which is in the list of summonable items will also cause the cost to be recalculated when you open a gift package and pull out such an item, for example.

That's why I included

Code:
		libramSummon = false;
		if( results.indexOf( "You read" ) != -1 && results.indexOf( "Libram" ) != -1 )
		{
			libramSummon = true;
		}

All libram summoning results start with a line like "You read the Libram of Candy Heart Summoning". It seemed like an easy way to differentiate between a skill summon and mall purchases... though, I didn't consider gift packages with that text as the message. Herm....

What if I change the if-statement to
if( results.indexOf( "You read" ) != -1 && results.indexOf( "Libram" ) != -1 && results.indexOf( "showplayer.php" ) == -1)

That should filter out gift packages.

What technique did you guys use for inventory items?

Anyway, thanks again for looking at my code, sorry I couldn't help.
 

Veracity

Developer
Staff member
When you issue a request to inv_use.php, save the item. When we parse the response - which can happen after multiple redirects ending in inventory.php?message=true, use the saved item.

So, for skills, when you use a skill from skills.php or campground.php, save skill id and count. When we parse the response - which can happen at skills.php?message=1 - use the saved skill id and count.

Looking at my session log, I see that using a libram skill from skills.php logs as

cast 1 Summon Candy Hearts

cast 1 Summon Candy Heart
You acquire an item: pink candy heart

The first one comes from the skill page, the second from the campground page, the result comes when we get redirected back to skills.php.

I'll see what I can do to suppress one of the duplicate messages...
 
Top