Eval for checking if a skill is learned?

Is the a way or scriptcall to check if a skill is learned?
I tried looking the RMMV script call list, but couldn't find it. I found one for equipment, but wasn't sure how to translate that for skills.
@HintonR, try $gameActors.actor( actor_id ).isLearnedSkill( skill_id )
Is there a way for "user" to be used?
Is there a way for "user" to be used?

HintonR, I'm not sure what you mean by "user" here. Are you talking about finding out if the skill can be used? What are you attempting to do by finding out what skills an actor has learned?
I'm trying trying to figure an eval for plugins that accept evals
like a.hp =< 100 or $gameParty.inBattle();
but checks if a user of a given skill (not actor) has already learned a skill.

Also, thanks for the replies.
I'm still a little confused by what you're looking for. It is the actors (the characters that make up the party) that have skills. To use the default characters as an example, the character Harold learns the skills Heal and Spark at level 1 (because his class, Hero, gains those skills at that level). If you want to know if a character has learned a specific skill, the function I gave above should work. If the actor has the skill, then it will return true. Otherwise, it will be false. You just need to supply the id of the actor and the id of the skill.

If I'm not following you, can you go into some more detail explaining what you're trying to accomplish?
Are you trying to check for learned skills when you use another skill? Maybe these functions will be helpful:
  • Code:
    isActor()
    - returns true if the battler is an actor, false otherwise.
  • Code:
    actorId()
    - only defined for actors! Returns the actor's ID.
Example usage:
Code:
var userId = 0;
if (battler.isActor()) userId = battler.actorId();
If you're using Yanfly's plugins, I think the skill user is simply user.
If you're not using Yanfly Lunatic Mode then use this code:
a.isLearnedSkill( skill_id )
If you are using Yanfly Lunatic Mode then use this code:
user.isLearnedSkill( skill_id )

Also this code does not work for skills learn through equipment(weapons or armors) or through states.
Ahhhhh thank you guys so much 🙂

I was a bit frustrated originally, because I just wanted to test the eval...
But since using the Skill Learn System and Mog_X's Skill Equip... I wasn't able to originally verify it correctly.
After turning them off just to check if the eval is properly recognized - which it was... I'm happy to say
the problem is solved!

Thanks for all your help! 🙂

Original thread: https://forums.rpgmakerweb.com/threads/eval-for-checking-if-a-skill-is-learned.91638/