The Dink Network

Turnip Blues

February 27th 2005, 05:58 PM
sob_scorpb.gif
LadyValoveer
Peasant He/Him New Zealand
Mildly deranged. 
Can somebody tell me how to have a script check if you have an item in your inventory and then do something depending on whether the player has it or not? Or where I can see an example?
Thanks.
February 27th 2005, 06:15 PM
spike.gif
There are a few commands...

count_item("item-bah");

returns how many item-bahs you have.

compare_weapon("item-bah");

returns 1 if item-bah is currently armed, this was used in the original Dink at the goblin sanctuary.

I think there's at least one more command, but I forgot it. For magic simply change "weapon" or "item" to "magic".

To do something do something like

if (count_item("item-bah") > 0)
{
say("Bah", 1);
kill_game();
}

or

int &bah = compare_weapon("item-bah");
if (&bah == 1)
{
say("Bah", 1);
restart_game();
}
February 27th 2005, 06:23 PM
sob_scorpb.gif
LadyValoveer
Peasant He/Him New Zealand
Mildly deranged. 
Thank you! My turnip is saved and it's all your doing!