Charm Up-grader.
My charm up-grader will upgrade you from Rank 1 to Rank 2, but after that he just gives back your items, any ideas? Code below:
Code:
sub EVENT_SAY |
Think about the logic there. Check if the first item matches, if it does give the upgrade, otherwise return the items. By the time you get to checking the second item you've already given everything back.
I'm no expert, but it seems to me you would want to check the whole list for matches before giving anything back. |
improper use of return items.
see: http://www.peqtgc.com/phpBB3/viewtop...p=65083#p65083 |
Revised version, haven't tested, is this the way mentioned in that post?
Code:
sub EVENT_SAY |
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) |
oops. that should read:
Code:
foreach my $itemid (keys %itemcount) |
The one you gave me actually doesn't work, in the fact that he just eats the items, the second one I posted, the revised one, works correctly.
|
that $charmid should be $itemid. was half asleep both times i posted.
|
All times are GMT -4. The time now is 03:42 PM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.