This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
item_storage_slot [2020/12/02 11:54] – justin | item_storage_slot [2023/05/23 17:54] – external edit 127.0.0.1 | ||
---|---|---|---|
Line 9: | Line 9: | ||
=====Scripting===== | =====Scripting===== | ||
- | You can access | + | You can access certain properties of an item storage slot from a [[script]] by simply referencing the parent [[widget]] and the element by their unique IDs. See below for examples of retrieving |
- | **Changing a button' | + | **Retrieving the item data for an item storage slot:** |
<code bauxite> | <code bauxite> | ||
- | widget[" | + | $item_id = widget[" |
+ | $item_count | ||
</ | </ | ||
- | **Changing | + | **Changing |
<code bauxite> | <code bauxite> | ||
- | widget[" | + | widget[" |
</ | </ | ||
- | **Changing | + | **Changing |
<code bauxite> | <code bauxite> | ||
- | widget[" | + | widget[" |
+ | </ | ||
+ | |||
+ | **Checking if an item exists in an item storage slot:** | ||
+ | <code bauxite> | ||
+ | if widget["test"].element[" | ||
+ | | ||
+ | end | ||
</ | </ | ||
~~NOTOC~~ | ~~NOTOC~~ |