This is my automacro for push the Item to array
Code: Select all
automacro pushItem {
console /^Item added to inventory: (.*) \((\d+)\) x (\d+)/i
call {
$itemID = @inventory($.lastMatch1)
$arrItem = @eval (return $::char->inventory->size());
while ($itemID != $arrItem) as loop
$arrItem--
end loop
do eval my $_item = $arrItem; Settings::add($_item);
}
}
This code for view or get Item from array that I added it to Settings.pm
Code: Select all
our @itemArray;
our $_item;
sub add {
$_item = @_;
push (@itemArray, $_item);
}
sub retrieve {
pop @itemArray;
}
Thanks