Is trendy: Difference between revisions
Jump to navigation
Jump to search
imported>Bale new in r10003 |
imported>Eliteofdelete No edit summary |
||
Line 43: | Line 43: | ||
<p>Fuzzy matching is not used for a string parameter so you need to spell it properly, including [http://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references character entities]. Otherwise it will not match against the item, familiar or skill in the database.| | <p>Fuzzy matching is not used for a string parameter so you need to spell it properly, including [http://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references character entities]. Otherwise it will not match against the item, familiar or skill in the database.| | ||
code1={{CodeSample| | |||
title=Code Samples| | |||
description=Ouputs which familiars can be used if you are on the Trendy Path.| | |||
code= | |||
<syntaxhighlight> | |||
if (my_path() == "Trendy") { | |||
foreach it in $familiars[] | |||
if (have_familiar(it) && is_trendy(it)) | |||
print("You can currently use familiar "+it+".", "blue"); | |||
} | |||
else print("You are not on the Trendy path.", "blue"); | |||
</syntaxhighlight>| | |||
}}| | |||
see_also={{SeeAlso|is_giftable|is_tradeable}}| | see_also={{SeeAlso|is_giftable|is_tradeable}}| |
Revision as of 14:19, 17 January 2015
Function Syntax
boolean is_trendy(item thing )
boolean is_trendy(familiar thing )
boolean is_trendy(skill thing )
boolean is_trendy(string thing )
- thing is checked for trendiness
This function checks to see if the thing is currently trendy. thing can be an item, familiar, skill. It can also be a string to check all categories. Using the string parameter is the only way to check a campground items. Bookshelf skills are checked by the skill parameter.
Fuzzy matching is not used for a string parameter so you need to spell it properly, including character entities. Otherwise it will not match against the item, familiar or skill in the database.
Code Samples
Ouputs which familiars can be used if you are on the Trendy Path.
if (my_path() == "Trendy") {
foreach it in $familiars[]
if (have_familiar(it) && is_trendy(it))
print("You can currently use familiar "+it+".", "blue");
}
else print("You are not on the Trendy path.", "blue");