View Single Post
  #5  
Old 03-30-2013, 06:28 AM
c0ncrete's Avatar
c0ncrete
Dragon
 
Join Date: Dec 2009
Posts: 719
Default

very inefficient to loop through the entire list of valid charms (100?) instead of just checking the item ids that were turned in (max of 4).
put this at the top of your file to be able to use the ~~ operator:
Code:
use 5.012;
Code:
foreach my $itemid (%itemcount)
{
    next unless $itemid ~~ [140126..140225];
    if (plugin::check_handin(\%itemcount, $charmid => 1, 140226 => 1))
    {
        plugin::Whisper("Here is your upgraded charm!");
        quest::summonitem($itemid+1, 1); 
    }
}
plugin::return_items(\%itemcount);
quest::givecash($copper, $silver, $gold, $platinum);
__________________
I muck about @ The Forge.
say(rand 99>49?'try '.('0x'.join '',map{unpack 'H*',chr rand 256}1..2):'incoherent nonsense')while our $Noport=1;
Reply With Quote