This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| crafting_input_slot [2020/11/30 18:51] – created justin | crafting_input_slot [2020/12/02 18:33] (current) – justin | ||
|---|---|---|---|
| Line 6: | Line 6: | ||
| =====Element Properties===== | =====Element Properties===== | ||
| ^Icon^Property^Description^ | ^Icon^Property^Description^ | ||
| + | |{{: | ||
| =====Scripting===== | =====Scripting===== | ||
| + | You can access certain properties of a crafting input slot from a [[script]] by simply referencing the parent [[widget]] and the element by their unique IDs. See below for examples of retrieving the slot's [[item]]. In this case, we are assuming that the slot currently contains an [[item]], the [[widget]] has an ID of " | ||
| - | (Accessing/ | + | **Retrieving |
| + | <code bauxite> | ||
| + | $item_id = widget[" | ||
| + | $item_count = widget[" | ||
| + | </ | ||
| + | |||
| + | **Checking if an item exists in a crafting input slot:** | ||
| + | <code bauxite> | ||
| + | if widget[" | ||
| + | | ||
| + | end | ||
| + | </ | ||
| ~~NOTOC~~ | ~~NOTOC~~ | ||