Difference between revisions of "Item check"
From Unofficial QEdit Wiki Guide
LunarFuror (Talk | contribs) (Created page with "==Syntax== ''Syntax:'' <span style='font-size:12px;font-family:courier'><span style='color:green'>item_check</span> register output</span> * register = Starting register in a...") |
LunarFuror (Talk | contribs) (→Use) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 6: | Line 6: | ||
==Use== | ==Use== | ||
− | + | Use to check for an item in inventory. This checks the inventory of the player who triggers/encounters this script. IE: If player 1 presses a button that fires the function, it checks their inventory. | |
==Example== | ==Example== | ||
Line 21: | Line 21: | ||
* [[leti]] | * [[leti]] | ||
* [[jmpiuexe|jmpi_!=]] | * [[jmpiuexe|jmpi_!=]] | ||
+ | * [[ret]] |
Latest revision as of 16:55, 18 January 2022
Contents
Syntax
Syntax: item_check register output
- register = Starting register in a set of 3, this denotes the weapon you are checking for.
- output = The register the output of the check is stored in. Returns FFFFFFFF if no item was found, otherwise returns the slot number.
Use
Use to check for an item in inventory. This checks the inventory of the player who triggers/encounters this script. IE: If player 1 presses a button that fires the function, it checks their inventory.
Example
100: leti R40 00000000 options //Sets these registers to 3 bytes of 00 45 01 this denotes the Snow Queen
leti R41 00000045
leti R42 00000001
item_check R40 R200 //Check for the Snow Queen as denoted by register R40 (through 42) and store the result in R200
jmpi_!= R200, FFFFFFFF, 101 //If R200 is NOT equal to -1 go to function 101
ret