Get
From AGI Wiki
Revision as of 19:58, 1 April 2019 by Andrew Korson (talk | contribs) (Created page with "The '''get''' command adds an inventory item to the player's inventory. == Syntax == get(itm iA);<br /> get("item"); == Remarks == The '''get''' com...")
The get command adds an inventory item to the player's inventory.
Syntax
get(itm iA);
get("item");
Remarks
The get command sets the room number for item iA to 255. This is basically a shortcut equivalent to the put command with a new room number value of 255. Items with a room number value of 255 are considered to be in the player's 'inventory'.
Possible Errors
If the inventory item is not valid (the number exceeds the total number of inventory items in the OBJECT file), AGI will raise trappable error #23.
Example
Code:
<syntaxhighlight lang="agi"> get(i201); [ now item 201's room number is 255
[ equivalent command: put(i201, 255); </syntaxhighlight>
Technical Information
Required Interpreter Version: | Available in all AGI versions. |
Byte-Code Value: | 92 (0x5C hex) |