Jump to content

klunk

Members
  • Posts

    37
  • Joined

  • Last visited

    Never
  • Donations

    0.00 GBP 

klunk's Achievements

Advanced Member

Advanced Member (3/3)

0

Reputation

  1. Sorry for not replying sooner. I think my code may be a little behind Blue's code, and I have done stuff to make it work with a later revision, I forget off hand. As for the vcproj files, I dont use them so I made a hack at resolving conflicts, obviously not very well.
  2. These are all link errors, rather than compile. Are there any errors further up in the output that you have missed? Are you compiling a clean build or doing an incremental compile? I would suggest doing make clean followed by make and seeing if it persists.
  3. OK, my repository now includes the functionality to sell junk items to the vendor selected by the player. Whisper sell junk to the bot and they will sell all junk items. Buyback items will then be available to the player, not the bot, however this does not work quite right as the icon and item name do not appear for the player. The player can buy the item back though without any problems. This is not tested for BoP items. If I can I will change this to add it to the bots buyback and give a buyback function to the bot. latest repo, merged with [9254] from core and latest ScriptDev2 available at http://github.com/klunk/mangos.git [9524] builds on Linux (Ubuntu 9.04 64bit and 9.10 32 bit)
  4. The following code snippet will list the items that the bot has, as you say it gives no indication of how many empty slots the bot has but it does list their invetory. I took this from the trade functionality, removing the tradeable check, for the sell function. It also lists the item level (0 for junk) and once I figure out how to actually sell an item I will write a sell junk command. else if (text == "sell") { // list out items available for trade std::ostringstream out; // list out items in main backpack for (uint8 slot = INVENTORY_SLOT_ITEM_START; slot < INVENTORY_SLOT_ITEM_END; slot++) { const Item* const pItem = m_bot->GetItemByPos(INVENTORY_SLOT_BAG_0, slot); if (pItem) { const ItemPrototype* const pItemProto = pItem->GetProto(); std::string itemName = pItemProto->Name1; const uint32 itemQuality = pItemProto->Quality; ItemLocalization(itemName, pItemProto->ItemId); out << " " << itemQuality << " |cffffffff|Hitem:" << pItemProto->ItemId << ":0:0:0:0:0:0:0" << "|h[" << itemName << "]|h|r"; if (pItem->GetCount() > 1) out << "x" << pItem->GetCount() << ' '; } } // list out items in other removable backpacks for (uint8 bag = INVENTORY_SLOT_BAG_START; bag < INVENTORY_SLOT_BAG_END; ++bag) { const Bag* const pBag = (Bag*) m_bot->GetItemByPos(INVENTORY_SLOT_BAG_0, bag); if (pBag) { for (uint8 slot = 0; slot < pBag->GetBagSize(); ++slot) { const Item* const pItem = m_bot->GetItemByPos(bag, slot); if (pItem) { const ItemPrototype* const pItemProto = pItem->GetProto(); std::string itemName = pItemProto->Name1; const uint32 itemQuality = pItemProto->Quality; ItemLocalization(itemName, pItemProto->ItemId); // item link format: [url]http://www.wowwiki.com/ItemString[/url] // itemId, enchantId, jewelId1, jewelId2, jewelId3, jewelId4, suffixId, uniqueId out << " " << itemQuality << " |cffffffff|Hitem:" << pItemProto->ItemId << ":0:0:0:0:0:0:0" << "|h[" << itemName << "]|h|r"; if (pItem->GetCount() > 1) out << "x" << pItem->GetCount() << ' '; } } } }
  5. There are addons (arkinventory for example) that will show you the bags of othe characters, however this relies on cached information and you having logged on to the caracter to fill the cache. I am sure something could be done along the same lines.
  6. Sounds like a good idea to me. Its something I would have liked last week when I was playing about with bots, its only really an extension of the trade functionality that lists the bag contents isnt it?
  7. I do check the bags can store the item in my [atch and if it cannot I give an error message. To be honest though, I didnt test this by filling up my bots bag.
  8. I should also have mentioned, my repo is currently at Mangos [9183]. I need to bring it up to date.
  9. I have pushed my first change through to my git repository, please feel free to pull it down from there. The change is denoted with the initials SJW. This change allows the player to select a vendor and whisper buy to the bot. The bot will then list the items available from the vendor and you can then whisper buy <itemlink> and the bot will purchase it if they have enough money and bag space. The bot needs to be close enough to the vendor to trade with it. I wanted to give some feedback on the success of the trade, but other than checking the bag space before buying I cannot do it, the BuyItemFromVendor returns a boolean but it seems to always be false, regardless if the purchase worked or not, which was my problem last night. I was actually buying it (and filling my bag) but it kept telling me it couldn't buy. I am more than happy for people to give pointers on how to improve what I have done. The next step is to sell items and more importantly junk.
  10. Me again I am very close to completing the buy side, only problem I have is that the call to BuyItemFromVendor on m_bot is failing and I cant see why at the moment. Once I have buy working I will update my repo and make it available for people to test.
  11. That is so good, thanks. It works a treat. Now to actually purchase the item.
  12. Hi Blueboy If you have code to translate the item guids to names and quantities I would appreciate that. I will be looking at that this evening, but if i can crib yours I can concentrate on the code to actually make the purchase Thanks
  13. I will try this tonight, thanks. It looks like you only change the type mask to indicate vendor and added some logging, is that right? Obviously this is my approach to iterative development, change something and see what result it give, building up over a series of edits to a final solution, hence some unnecessary code in there. One question, did you experience my wired jumping back in the code issue with my original code sample or did it work fine for you? Do you run this through gdb at all?
  14. I have an odd problem, seen both in Anjuta and Eclipse with the C++ dev environment. I am working on the Playerbot code trying to get the bot to talk to a vendor, nothing more than talk at the moment, but when I step thru the code I get strange behaviour, I hit the breakpoint for a call to GetPlayer()->GetNPCIfCanInteractWith(...), step over that and can see that the call returns a non-null value, however when I step over the next line the debugger jumps back to the GetPlayer()->GetNPCIfCanInteractWith(...) line which this time returns NULL. My first thoughts were threading but Eclipse is telling me I am in the same thread for both calls, and I dont understand why it would call the method twice anyway.
  15. I am a Linux user, but never done C++ on Linux (Java commercially and about 10 years ago I did commercial C++ on Windows). so what do people use to develop code and more interestingly to debug, especially on Linux? Thanks Klunk
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use