Interesting. Though you'd probably want to check to see if the skill's effect runs out or else you'd just cast the skill every time the script is called until you run out of meat. Fortunately there's an easy way to check that.
In addition to checking for the effect being active I made a lot of changes to your script in hopes you see something you'd like to learn.
PHP Code:
void ICS(int cost) {
if (! have_skill($skill[internal soda machine]) )
abort("You don't have Internal Soda Machine... kinda important for this.");
if (my_meat() >= 60) {
use_skill( 3, $skill[internal soda machine] );
} else {
abort("You're too poor to proceed");
}
}
void cast(skill sk) {
if(my_mp() < mp_cost(sk) && my_maxmp() >= mp_cost(sk))
ICS(mp_cost(sk));
print("MP over 30, proceeding...", "#0000ff");
if(my_mp() >= mp_cost(sk))
use_skill(1, sk);
}
foreach sk in $skills[flappy ears, magic sweat, steroid bladder, intracranial eye, self-combing hair]
if(have_skill(sk) && !have_effect(to_effect(sk)))
cast(sk);
You should also refine ICS to check for my_mp() - mp_cost(sk) and only restore the mp needed, but I've done enough.