To slot: Difference between revisions
Jump to navigation
Jump to search
imported>Heeheehee m Oh no, this page broke the wiki's formatting! (Fixed, hopefully) |
imported>Bale mNo edit summary |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 6: | Line 6: | ||
name={{#var:name}}| | name={{#var:name}}| | ||
function1={{Function| | function1={{Function| | ||
Line 17: | Line 16: | ||
}}| | }}| | ||
function_description=This function will return the slot | function2={{Function| | ||
name={{#var:name}}| | |||
aggregate={{#var:aggregate}}| | |||
return_type={{#var:return_type}}| | |||
return_also={{#var:return_also}}| | |||
parameter1={{Param|string|slot}}| | |||
p1desc={{pspan|slot}} is the name of a slot that you want converted to the slot datatype. | |||
}}| | |||
function_description=This function will return the slot to which any item would be equipped. Alternatively it will convert the name of a slot to the correct datatype.</p> | |||
<p>Note: | <p>Note: | ||
* Non-equipment items return $slot[none]. | * Non-equipment items return $slot[none]. | ||
* Ranged and melee weapons return $slot[weapon], even if you have double fisted skull-smashing. | * Ranged and melee weapons return $slot[weapon], even if you have double fisted skull-smashing. | ||
* All accessories return $slot[acc1]. | * All accessories return $slot[acc1]. | ||
| | | ||
code1={{CodeSample| | code1={{CodeSample| | ||
title=Code Samples| | title=Code Samples| | ||
Line 35: | Line 44: | ||
}} | }} | ||
[[Category:Datatype Conversions]] |
Latest revision as of 05:22, 22 May 2010
Function Syntax
- equip is any item where you want to know which slot it is equipped to.
- slot is the name of a slot that you want converted to the slot datatype.
This function will return the slot to which any item would be equipped. Alternatively it will convert the name of a slot to the correct datatype.
Note:
- Non-equipment items return $slot[none].
- Ranged and melee weapons return $slot[weapon], even if you have double fisted skull-smashing.
- All accessories return $slot[acc1].
Code Samples
This code will equip a star sword if the slot it goes in is empty.
if(have_equipped(to_slot($item[star sword]) == $item[none]) {
equip($item[star sword]);
}