Flourine 106 Posted October 30, 2018 Share Posted October 30, 2018 Hi, i did command that can be used for auto opener of items (like 27987) Spoiler ACMD(do_fast_opener) { std::vector<std::string> vecArgs; split_argument(argument, vecArgs); DWORD whatIsUsed; int howMuch, itemSlot; str_to_number(whatIsUsed, vecArgs[1].c_str()); str_to_number(howMuch, vecArgs[2].c_str()); str_to_number(itemSlot, vecArgs[3].c_str()); for (int i = 1; i < 3; i++) { if (!*vecArgs[i].c_str() || !isnhdigit(*vecArgs[i].c_str())) { return ; } } if (!ch->CanWarp()) return ; if (howMuch > 500) howMuch = 500; LPITEM item = ch->GetInventoryItem(itemSlot); struct { DWORD itemVnum; } disabledItems [] = { {70038}, }; for (int i = 0; i < (sizeof(disabledItems) / (1 * sizeof(int))); ++i) { if (item->GetVnum() == disabledItems[i].itemVnum) { ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("disabled_item") ); return; } } if (item) { if (item->GetVnum() == whatIsUsed) { for (int i = 0; i < howMuch; i++) { ch->UseItem(TItemPos (INVENTORY, itemSlot)); } } } } Code of func. is here https://paste.ubuntu.com/p/YPGX6ZXsXg/ Example: /fast_opener itemvnum howMuchtoOpen positionOfItem Link to comment Share on other sites More sharing options...
ManiacRobert 429 Posted October 30, 2018 Share Posted October 30, 2018 elif self.IsTreasureBox(itemSlotIndex): self.SendMultipleUseItemPacket(itemSlotIndex) def IsTreasureBox(self, slotIndex): itemVnum = player.GetItemIndex(slotIndex) item.SelectItem(itemVnum) if item.GetItemType() == item.ITEM_TYPE_GIFTBOX: return True treasures = { 0: 27987, 1: 50024, 2: 50025, 3: 50031, 4: 50032, 5: 80003, } if itemVnum in treasures.values(): return True return False def SendMultipleUseItemPacket(self, slotIndex): for i in xrange(player.GetItemCount(slotIndex)): self.__SendUseItemPacket(slotIndex) Link to comment Share on other sites More sharing options...
Flourine 106 Posted October 30, 2018 Author Share Posted October 30, 2018 2 godziny temu, ManiacRobert napisał: elif self.IsTreasureBox(itemSlotIndex): self.SendMultipleUseItemPacket(itemSlotIndex) def IsTreasureBox(self, slotIndex): itemVnum = player.GetItemIndex(slotIndex) item.SelectItem(itemVnum) if item.GetItemType() == item.ITEM_TYPE_GIFTBOX: return True treasures = { 0: 27987, 1: 50024, 2: 50025, 3: 50031, 4: 50032, 5: 80003, } if itemVnum in treasures.values(): return True return False def SendMultipleUseItemPacket(self, slotIndex): for i in xrange(player.GetItemCount(slotIndex)): self.__SendUseItemPacket(slotIndex) I can't python thats why i did like that. Link to comment Share on other sites More sharing options...
Endymion 320 Posted October 30, 2018 Share Posted October 30, 2018 (edited) 2 hours ago, ManiacRobert said: elif self.IsTreasureBox(itemSlotIndex): self.SendMultipleUseItemPacket(itemSlotIndex) def IsTreasureBox(self, slotIndex): itemVnum = player.GetItemIndex(slotIndex) item.SelectItem(itemVnum) if item.GetItemType() == item.ITEM_TYPE_GIFTBOX: return True treasures = { 0: 27987, 1: 50024, 2: 50025, 3: 50031, 4: 50032, 5: 80003, } if itemVnum in treasures.values(): return True return False def SendMultipleUseItemPacket(self, slotIndex): for i in xrange(player.GetItemCount(slotIndex)): self.__SendUseItemPacket(slotIndex) 200 packets vs 1 command Edited August 26, 2022 by Metin2 Dev Core X - External 2 Internal 1 3 Link to comment Share on other sites More sharing options...
ManiacRobert 429 Posted October 30, 2018 Share Posted October 30, 2018 (edited) Acum 24 minute, Endymion a spus: 200 packets vs 1 command Do with autoclicker and it's same result Edited August 26, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
Active Member hachiwari 138 Posted October 30, 2018 Active Member Share Posted October 30, 2018 1 minutę temu, ManiacRobert napisał: Do with autoclicker and it's same result not same Link to comment Share on other sites More sharing options...
Recommended Posts