### Registering

interactive_item.register_action(id, def)
  * Recommended to use your mod's prefix to avoid overlaps.
    Ex: "my_mod:action"
  * For definitions, check Action Definition.

interactive_item.register_item(id, def)
  * The resulting item is always a tool.
  * Works like registering a tool, just adds more to the on_use.

### Action Definition

    {
        forms = {
            main = function(item, player, data) -- The function that renders the form.
              'item' the item.
              'player' the player.
              'data' data of the item that is passed on every function, is auto-updated when changed.
            ...
        }
        logics = {
            main = function(item, fields, player, data) -- The functionality.
              * Special function, called after sanity sucesses.
                'fields' the formspec fields, useful for detecting button presses, etc.
            start = function(item, fields, player, data) -- Start function.
              * Special function, this is called to initialize items and assign starting values.
            sanity = function(item, player, data) -- Sanity function
              * Special function, called before the others, when returning false, stops all logic from executing.
              * This one doesn't have fields.
            anything = function(item, fields, player, data)
              * Any and all functions here are inactive and must be called.
            ...
        },
        inventories = {
            anything = { -- The size and funcs of inventories
                size = number,
                allow_put = function(item, player, stack, invi, data),
                    'item' the interactive item.
                    'player' the player.
                    'stack' the item to be put/taken into `item`.
                    'invi' the information, can contain.
                      'to_index' which index it goes to.
                      'from_index' which index it comes from.
                      'to_list' which list it goes to.
                      'from_list' which list it comes from.
                    'data' the action data, passed across all.
                allow_take = function(item, player, stack, invi, data),
                on_put = function(item, player, stack, invi, data),
                on_take = function(item, player, stack, invi, data)
            }
            ...
        },
        dynamic_logic = function(item, player, dtime), -- Dynamic logic for when dynamic viewing is enabled
          'dtime' dtime.
        options = {
            opt_1 = arg, -- Options, check the options list.
            ..
        }
    }
    
### Action Options

`storeable`
  * Can item be stored? default: false
  * You can make items non-storeable by giving their meta a 'storeable' string with "false" in it.
  * Non-initialized items can be stored.
  
### Main Inventory Funcs

`function interactive_item.open_inventory(item, player, inventory, data)`
  * Opens a specific inventory for interacting.
  'inventory' the inventory to be opened.

`function interactive_item.get_inventory_list(inventory, data)`
  * Get the inventory list.

`function interactive_item.set_inventory_list(inventory, list, data)`
  * Set inventory list to 'list'.
  'list' a list of itemstack strings.

`function interactive_item.get_inventory_item(inventory, index, data)`
  * Gets a item at the index in the specified inventory.
  * Returns a string.
    
`function interactive_item.set_inventory_item(inventory, index, stack, data)`
  * Set a item at the specified index in the specified inventory.
  'stack' must be a ItemStack.

`function interactive_item.update_inventory_meta(player, data)`
  * Update the inventory meta.

`function interactive_item.update_inventory_list(player, data)`
  * Update the inventory list.
  
`function interactive_item.delete_inventories(player)`
  * Close the added inventories.
  * This one is usually automatic on closing of formspec.

### Extra Inventory Funcs.

'inv': inventory name, example: 'main'
'stack': stack in question.

'data': the data that is passed through every function.

`interactive_item.inv_has(inv, stack, data)`
  * Check if 'inv' has the 'stack'
    Returns false if not enough.

`interactive_item.inv_fit(inv, stack, data)`
  * Check if 'inv' can fit 'stack'
    Returns false if not possible to fit all.

`interactive_item.inv_add(inv, stack, data)`
  * Add 'stack' to 'inv'
    Returns false if not possible to fit all.

`interactive_item.inv_take(inv, stack, data)`
  * Take 'stack' from 'inv'
    Returns false if not enough.
    
`interactive_item.inv_mass(fname, list, data)`
  * Calls the given function for every item in the tables inside 'list'.
     'fname' provides the function and 'list' the list of inventories and items.
     'list' is a table, example:
       {
         [inv] = { -- Inventory name
             [itemstring 1],
             [itemstring 2],
             ...
         }
       }
     'fname' is a string, can be either 'add', 'take', 'has', or 'fit'
     returns false and doesn't change inventory if the given functions returns false

### Inv-lock Functions

`function interactive_item.lock_inventory(item, inv, reason, data)`
  * Locks a specific inventory
  'reason' A string that specifies why.
  
`function interactive_item.lock_inventories(item, reason, data)`
  * Locks ALL inventories

`function interactive_item.unlock_inventory(item, inv, data)`
  * Unlocks a specific inventory
`function interactive_item.unlock_inventories(item, data)`
  * Unlocks ALL inventories

### Accessing inventories
  * You can do so through the data itself.
  * Make sure to save the changes

### Extras

`interactive_item.generate_id(counter)`
 * Generates a random id.
    'counter' is the id of the counter.
    returns a id.
    
`interactive_item.choose(list, cname)`
  * Choose from a list.
    'list' is a table that must have tables that have a value of 'iit_weight'
    iit_weight defines the weight of the table.
    will return the choosen table's name.
    'cname' is for logging, is a string.
    