Openkore.com

OpenKore Forums
It is currently 17 Dec 2017, 10:02

All times are UTC - 5 hours [ DST ]





Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Shopper.pl Error
PostPosted: 03 Oct 2017, 16:02 
Offline
Noob
Noob

Joined: 19 Sep 2017, 11:55
Posts: 4
Hi, I found out that --

The code for maintaining the character inventory has changed since version 2.0.1.
Storage inventory and cart inventory are not affected by this change. $char->{inventory} doesn't exist anymore.
Instead, one should use $char->inventory, which returns an InventoryList object.
Use the InventoryList methods to access the inventory.

souce : http://openkore.com/index.php/Porting_Plugins

Now irewrite some codes inside shopper.pl

Code:
my $binID = main::findIndexString_lc($char->{'inventory'}, "name", $config{$prefix.$i});
      my $item = $char->{'inventory'}[$binID];


To :

Code:
my $binID = $char->inventory->getByName($config{$prefix.$i});
      my $item = $char->inventory->get($binID);


then, when I try to login my account, i get these errors

Code:
OpenKore version what-will-become-2.1
@ai_seq = checkShop checkShop checkShop checkShop checkShop checkShop checkShop
Network state = 5
Network handler = Network::DirectConnection
Revision: ctime:2017_10_03
Loaded plugins:
  plugins/breakTime/breakTime.pl (breakTime; description: Automatically disconnect and reconnect at certain times of the day)
  plugins/eventMacro/eventMacro.pl (eventMacro; description: allows usage of eventMacros)
  plugins/item_weight_recorder/item_weight_recorder.pl (item_weight_recorder; description: item_weight_recorder plugin)
  plugins/macro/macro.pl (macro; description: allows usage of macros)
  plugins/map/map.pl (map; description: map)
  plugins/profiles/profiles.pl (profiles; description: Profiles Selector)
  plugins/raiseSkill/raiseSkill.pl (raiseSkill; description: automatically raise character skills)
  plugins/raiseStat/raiseStat.pl (raiseStat; description: automatically raise character stats)
  plugins/reconnect/reconnect.pl (reconnect; description: v1.0)
  plugins/shopper/shopper.pl (shopper; description: automatically buy items from merchant vendors)
  plugins/xconf/xconf.pl (xConf; description: commands for change items_control, mon_control, pickupitems, priority)

Error message:
Operation ">=": no method found,
   left argument in overloaded package Actor::Item,
   right argument has no overloaded magic at src/Utils/ObjectList.pm line 168.

Stack trace:
Operation ">=": no method found,
   left argument in overloaded package Actor::Item,
   right argument has no overloaded magic at src/Utils/ObjectList.pm line 168.
at src/Utils/ObjectList.pm line 168
   ObjectList::get('InventoryList::Inventory=HASH(0x6858fe4)', 'Actor::Item=HASH(0x6cea98c)') called at (eval 214) line 5
   InventoryList::get('InventoryList::Inventory=HASH(0x6858fe4)', 'Actor::Item=HASH(0x6cea98c)') called at D:/OpenKore/TG-Merchant1.5/openkore-master - shoppertest/plugins/shopper/shopper.pl line 74
   shopper::storeList('packet_vender_store', 'HASH(0x6cef264)', undef) called at src/Plugins.pm line 434
   Plugins::callHook('packet_vender_store', 'HASH(0x6cef264)') called at src/Network/Receive/ServerType0.pm line 4514
   Network::Receive::ServerType0::vender_items_list('Network::Receive::iRO::Restart=HASH(0x66d639c)', 'HASH(0x685ed24)') called at src/Network/PacketParser.pm line 276
   Network::PacketParser::parse('Network::Receive::iRO::Restart=HASH(0x66d639c)', '\x{0}\x{8}\x{99}\x{0}\x{98}\x{f5}\x{2}\x{0}\x{18}\x{1}\x{0}\x{0}\x{8f}\x{1}\x{0}\x{0}\x{ad}\x{4}\x{3}\x{0}\x{3}\x{a3}\x{3}\x{1}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{8f}\x{1}...', 'Network::Receive::iRO::Restart=HASH(0x66d639c)') called at src/Network/Receive.pm line 137
   Network::Receive::parse('Network::Receive::iRO::Restart=HASH(0x66d639c)', '\x{0}\x{8}\x{99}\x{0}\x{98}\x{f5}\x{2}\x{0}\x{18}\x{1}\x{0}\x{0}\x{8f}\x{1}\x{0}\x{0}\x{ad}\x{4}\x{3}\x{0}\x{3}\x{a3}\x{3}\x{1}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{8f}\x{1}...', 'Network::Receive::iRO::Restart=HASH(0x66d639c)') called at src/Network/PacketParser.pm line 410
   Network::PacketParser::process('Network::Receive::iRO::Restart=HASH(0x66d639c)', 'Network::MessageTokenizer=HASH(0x398e624)', 'Network::Receive::iRO::Restart=HASH(0x66d639c)') called at src/functions.pl line 735
   main::mainLoop_initialized() called at src/functions.pl line 75
   main::mainLoop() called at src/Interface.pm line 75
   Interface::mainLoop('Interface::Console::Win32=HASH(0x4793b44)') called at openkore.pl line 97
   main::__start() called at start.pl line 136

Died at this line:
     my ($self, $index) = @_;
*    assert($index >= 0) if DEBUG;
     return $self->{OL_items}[$index];



Image


Can anyone please help me what to do with this.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group