Have_skill() question

Asinine

New member
I get the error "Illegal parameter #1 for function have_skill. Got string, need skill" on the line that reads "if (have_skill ( "Pulverize" )) {"

I've tried tinkering with it, but nothing's working. What am I missing?

Code:
void smashstuff ( item name, int num ) {
  string title;
  title = to_string ( name );

  if (have_skill ( "Pulverize" )) {
    if ( num == 0 )
     cli_execute( "pulverize * "+title );
   else
     cli_execute( "pulverize -"+num+" "+title );
  }
  else
    print ( "You cannot pulverize", "red" );
}
 

Veracity

Developer
Staff member
It told you that you gave it a string when it wants a skill. That is correct.

Rather than "have_skill( "Pulverize" )", try "have_skill( $skill[ Pulverize ] )".
 

Asinine

New member
Ohhhh, thanks. I tried "have_skill(skill(pulverize))", but it didn't like that either. I was just going off of my guess from the wiki's example.

I'm not savvy with Java/ash yet. Thanks again.
 
Last edited:
Top