<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://wiki.spherecommunity.net/index.php?action=history&amp;feed=atom&amp;title=SKILLMENU</id>
		<title>SKILLMENU - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://wiki.spherecommunity.net/index.php?action=history&amp;feed=atom&amp;title=SKILLMENU"/>
		<link rel="alternate" type="text/html" href="https://wiki.spherecommunity.net/index.php?title=SKILLMENU&amp;action=history"/>
		<updated>2026-07-17T11:17:34Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.28.0</generator>

	<entry>
		<id>https://wiki.spherecommunity.net/index.php?title=SKILLMENU&amp;diff=252&amp;oldid=prev</id>
		<title>MrSugarCube: Created page with '__FORCETOC__ Skill menus are a more advanced form of MENU where options can be hidden from the client based on criteria.  ==Syntax== The syntax for a skill menu is identical ...'</title>
		<link rel="alternate" type="text/html" href="https://wiki.spherecommunity.net/index.php?title=SKILLMENU&amp;diff=252&amp;oldid=prev"/>
				<updated>2009-06-09T23:08:40Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;#039;__FORCETOC__ Skill menus are a more advanced form of &lt;a href=&quot;/index.php?title=MENU&quot; title=&quot;MENU&quot;&gt;MENU&lt;/a&gt; where options can be hidden from the client based on criteria.  ==Syntax== The syntax for a skill menu is identical ...&amp;#039;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;__FORCETOC__&lt;br /&gt;
Skill menus are a more advanced form of [[MENU]] where options can be hidden from the client based on criteria.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
The syntax for a skill menu is identical to a menu except for the definition starting with [SKILLMENU rather than [MENU. As with menus there are both text-based and item-based styles possible. Only the syntax for the item-based style of skill menu is shown below:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;&lt;br /&gt;
[SKILLMENU ''defname'']&amp;lt;br /&amp;gt;&lt;br /&gt;
''title''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
ON=''baseid'' ''text''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;''script''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
ON=''baseid'' @''hue'', ''text''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;''script''&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;4&amp;quot; cellpadding=&amp;quot;4&amp;quot;&lt;br /&gt;
| '''Name''' || '''Description'''&lt;br /&gt;
|-&lt;br /&gt;
| ''defname'' || The menu's defname.&lt;br /&gt;
|-&lt;br /&gt;
| ''title'' || The title of the menu. Properties and references of the object the menu was called on can be accessed.&lt;br /&gt;
|-&lt;br /&gt;
| ''baseid'' || The item [[BASEID]] to display for the button.&lt;br /&gt;
|-&lt;br /&gt;
| ''hue'' || If the @''hue'' syntax is used, the item will be displayed in the specified colour.&lt;br /&gt;
|-&lt;br /&gt;
| ''text'' || The text to display for the option. Properties of the ITEMDEF that ''baseid'' refers to can be accessed.&lt;br /&gt;
|-&lt;br /&gt;
| ''script'' || The script to run when the button is pressed.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Functions==&lt;br /&gt;
Whilst the syntax for a skill menu is identical to a menu, the difference is that before displaying an option to the client Sphere will search the ''script'' lines for the following functions (more than one can be present). These functions affect the visibility of the menu option.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;4&amp;quot; cellpadding=&amp;quot;4&amp;quot;&lt;br /&gt;
| '''Name''' || '''Description'''&lt;br /&gt;
|-&lt;br /&gt;
| [[MAKEITEM]] ''item_baseid'' || Checks if the client meets the criteria for crafting the item ([[SKILLREQ]] and [[RESOURCES]] properties on the item's [[ITEMDEF]]).&lt;br /&gt;
|-&lt;br /&gt;
| [[SKILLMENU]] ''skillmenu_id'' || Searches the skillmenu to see what options are available to the client. If there are no visible items in the submenu then the option will be hidden from the client.&lt;br /&gt;
|-&lt;br /&gt;
| [[TEST]] ''resource_or_skill_list'' || Checks if the client possesses all of the listed resources/skills. If they do not then the menu option will not be available to them.&lt;br /&gt;
|-&lt;br /&gt;
| [[TESTIF]] ''condition'' || Checks the condition. If it evaluates to false then the menu option will not be available to the client.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Triggers==&lt;br /&gt;
When the client selects an option from the skill menu, the &amp;quot;ON=''...''&amp;quot; section will be executed, in a similar fashion to how a trigger would fire.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the client cancels the menu (by right-clicking it, or for text-based menus by pressing &amp;quot;Cancel&amp;quot;), an @Cancel trigger will be fired.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In both cases, the following references and arguments are available:&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;4&amp;quot; cellpadding=&amp;quot;4&amp;quot;&lt;br /&gt;
| '''Name''' || '''Description'''&lt;br /&gt;
|-&lt;br /&gt;
| '''[[I]]''' || The [[Characters|character]] or [[Items|item]] that the MENU function was called from.&lt;br /&gt;
|-&lt;br /&gt;
| '''[[SRC]]''' || The client operating the menu.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
&amp;lt;spherescript&amp;gt;&lt;br /&gt;
//&lt;br /&gt;
// sm_cloth_misc skill menu from the default script pack.&lt;br /&gt;
//&lt;br /&gt;
[SKILLMENU sm_cloth_misc]&lt;br /&gt;
Misc.&lt;br /&gt;
&lt;br /&gt;
ON=i_SASH &amp;lt;NAME&amp;gt; (&amp;lt;RESMAKE&amp;gt;)&lt;br /&gt;
MAKEITEM=i_SASH&lt;br /&gt;
&lt;br /&gt;
ON=i_apron_half &amp;lt;NAME&amp;gt; (&amp;lt;RESMAKE&amp;gt;)&lt;br /&gt;
MAKEITEM=i_apron_half&lt;br /&gt;
&lt;br /&gt;
ON=i_apron_full &amp;lt;NAME&amp;gt; (&amp;lt;RESMAKE&amp;gt;)&lt;br /&gt;
MAKEITEM=i_apron_full&lt;br /&gt;
&amp;lt;/spherescript&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;spherescript&amp;gt;&lt;br /&gt;
//&lt;br /&gt;
// Similar to the MENU example, except adds conditions to the options.&lt;br /&gt;
//&lt;br /&gt;
[SKILLMENU sm_itemmenu]&lt;br /&gt;
Which item would you like?&lt;br /&gt;
&lt;br /&gt;
ON=i_sword_viking &amp;lt;NAME&amp;gt;&lt;br /&gt;
	TESTIF (&amp;lt;SRC.STR&amp;gt; &amp;gt; 100)             // client must have more than 100 strength to see this option&lt;br /&gt;
	SERV.NEWITEM i_sword_viking&lt;br /&gt;
	SRC.BOUNCE &amp;lt;NEW.UID&amp;gt;&lt;br /&gt;
	RETURN&lt;br /&gt;
&lt;br /&gt;
ON=i_gold 5000 &amp;lt;NAME&amp;gt;&lt;br /&gt;
	TESTIF (&amp;lt;SRC.BANKBALANCE&amp;gt; &amp;lt; 5000)    // client must have less than 5000gp in their bank to see this option&lt;br /&gt;
	SERV.NEWITEM i_gold, 5000&lt;br /&gt;
	SRC.BOUNCE &amp;lt;NEW.UID&amp;gt;&lt;br /&gt;
	RETURN&lt;br /&gt;
&lt;br /&gt;
ON=i_backpack @020, a red backpack&lt;br /&gt;
	TEST 1 i_backpack, 10.0 TAILORING    // client must have 1 backpack and 10% tailoring to see this option&lt;br /&gt;
	SERV.NEWITEM i_backpack&lt;br /&gt;
	NEW.COLOR = 020&lt;br /&gt;
	SRC.BOUNCE &amp;lt;NEW.UID&amp;gt;&lt;br /&gt;
	RETURN&lt;br /&gt;
&lt;br /&gt;
ON=0 Nothing&lt;br /&gt;
	SRC.SYSMESSAGE You get nothing!	     // no special function here, this option will always be visible&lt;br /&gt;
	RETURN&lt;br /&gt;
&amp;lt;/spherescript&amp;gt;&lt;br /&gt;
[[Category: Reference Compendium]]&lt;br /&gt;
[[Category: Definitions]]&lt;/div&gt;</summary>
		<author><name>MrSugarCube</name></author>	</entry>

	</feed>