Advertisement
Henrybk

get wieht

Apr 29th, 2017
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.38 KB | None | 0 0
  1. sub get_item_weight {
  2.     my ($id) = @_;
  3.    
  4.     if (!exists $itemsDesc_lut{$id}) {
  5.         message(T("Error: No description available.\n"), "info");
  6.         return -1;
  7.     }
  8.    
  9.     if ($itemsDesc_lut{$id} =~ /Peso:\s+\^\d\d\d\d\d\d(\d+)\^\d\d\d\d\d\d/) {
  10.         return $1;
  11.     } elsif ($itemsDesc_lut{$id} =~ /Peso:\s+(\d+)/) {
  12.         return $1;
  13.     }
  14.    
  15.     return -1;
  16. }
  17.  
  18.  
  19. $itemWeight = get_item_weight("$itemID")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement