item_check
From DinkC.chm (in the \develop subfolder of where you have Dink installed)
count_item
Category: Inventory, Script
Version: 1.00+
Prototype: int count_item(string script[9]);
count_item counts the number of items with the script script in the weapon/item inventory. Interestingly, the specified script need not actually exist: it only has to be the same as the corresponding add_item command's script-name argument.
For example:
void main( void )
{
int &nuts = count_item("item-nut");
if (&nuts == 0)
{
say_stop("I don't have any nuts!",1);
return;
}
say_stop("I have &nuts nuts!",1);
}
count_item
Category: Inventory, Script
Version: 1.00+
Prototype: int count_item(string script[9]);
count_item counts the number of items with the script script in the weapon/item inventory. Interestingly, the specified script need not actually exist: it only has to be the same as the corresponding add_item command's script-name argument.
For example:
void main( void )
{
int &nuts = count_item("item-nut");
if (&nuts == 0)
{
say_stop("I don't have any nuts!",1);
return;
}
say_stop("I have &nuts nuts!",1);
}
Or if you want to check that if Dink has a specific item equiped, a sword for example, you can try this:
void main(void)
{
int &sword = compare_weapon("item-sw");
if (&sword == 1)
{
say_stop("I'm holding a sword in my hand!", 1);
return;
}
say_stop("I don't have my sword equiped.", 1);
}
void main(void)
{
int &sword = compare_weapon("item-sw");
if (&sword == 1)
{
say_stop("I'm holding a sword in my hand!", 1);
return;
}
say_stop("I don't have my sword equiped.", 1);
}









