you can try to search this section on the manual : GetAtScreenXY (inventory)
Returns the inventory item at SCREEN co-ordinates (X,Y).
Code: ags
Returns the inventory item at SCREEN co-ordinates (X,Y).
InventoryItem *item = InventoryItem.GetAtScreenXY(mouse.x, mouse.y);
if (item == null) {
Display("No inventory item at the mouse co-ordinates");
}
else {
Display("Inventory item number %d at the mouse.", item.ID);
}