Can't seem to use my Libram properly?

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

Member
use_skill requires an int telling how many times to cast the skill. Remenber to use ashref.
Code:
> 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:
Code:
while( my_mp() >= mp_cost($skill[Summon Candy Hearts]) )
{
	use_skill( 1, $skill[Summon Candy Hearts] ) ;
}
 
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.
 
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.
 

Attachments

  • cast_bookshelf.ash
    7.5 KB · Views: 45
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...
 
Top