PDA

View Full Version : Can't seem to use my Libram properly?



SinginSally
01-26-2010, 02:39 PM
As part of a logout script I have,

#### Try to use my Libram.
int loop = 0;

## If the skill use fails, who cares? It just spams a lot.
while (( loop < 20 ))
{
use_skill($skill[Summon Love Song]);
loop = loop +1;
}


Obviously not very pretty. However, I can't get it to EVER work at all! Even though I may have 400 MPs, and the cost of the libram is only up to like 20ish, it STILL fails... 20 times!

It complains that my Maximum MP is insufficient or something. I'd expect this during the end of the loop, or if I am out of mana, or the Libram is up to needing tons of mana per cast. But none of these is actually the case.

Anyone have any ideas? Thanks!

Camber
01-26-2010, 03:46 PM
use_skill requires an int telling how many times to cast the skill. Remenber to use ashref.


> ashref use_skill

boolean use_skill( int, skill )
boolean use_skill( int, skill, string )


And rather than trying to cast a fixed number of times, perhaps you should base it on your mp amount like this:


while( my_mp() >= mp_cost($skill[Summon Candy Hearts]) )
{
use_skill( 1, $skill[Summon Candy Hearts] ) ;
}

SinginSally
01-26-2010, 08:31 PM
Holy friggin crud!

Man, I never knew that ashref existed! That is super helpful.

Thanks a ton. Yeah that took care of it. I didn't think about Mafia being smart enough to calculate the progressive MP cost of the Libram either.

Bale
01-26-2010, 08:45 PM
Here's an even easier way to do it:


cli_execute("cast * Summon Candy Hearts");

slyz
01-26-2010, 08:45 PM
Mafia is even able to learn now ... It might start getting smarter then us!

aqualectrix
01-26-2010, 09:32 PM
I hope Veracity's remembered to code in a guard against Skynet...
http://xkcd.com/534/

Bale
01-26-2010, 09:42 PM
If KolMafia becomes Skynet, I just hope it donates for Mr. Accessories.

redwulf25_ci
01-26-2010, 10:54 PM
I don't remember where I found this, but what about the script cast_bookshelf.ash? (Programed according to the copy I have by Rotated8)

Since I don't know where I found it here's a download link. I'm sure if you want it to only do candy hearts and nothing else you can comment out or just delete the other functions.

SinginSally
01-28-2010, 01:26 PM
Ive looked at the cast_bookshelf. It looks great but is way overkill for me. I am new to the game and only cuz of Crimbo did I have the meat to buy the single Libram (the cheapest one). So I won't have a bookshelf filled anytime in the near future. :-)
Nor do I have any neverending soda or whatever the PYEC doodad is...

slyz
01-28-2010, 05:10 PM
the PYEC (http://kol.coldfront.net/thekolwiki/index.php/Platinum_Yendorian_Express_Card) is a sweet Ultra Rare.