Jump to content

klunk

Members
  • Posts

    37
  • Joined

  • Last visited

    Never
  • Donations

    0.00 GBP 

Posts posted by klunk

  1. ok kool blue!

    I have been battling it out with klunks repo and its very odd... what did you do to your repo klunk... vcproj is all messed up and your botcode doesnt quite line up with blue's... is it based off a different repo altogether?

    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. ok can someone help with these compile errors?

    >game.lib(Group.obj) : error LNK2019: unresolved external symbol "public: virtual __thiscall PlayerbotMgr::~PlayerbotMgr(void)" (??1PlayerbotMgr@@UAE@XZ) referenced in function "public: virtual void * __thiscall PlayerbotMgr::`scalar deleting destructor'(unsigned int)" (??_GPlayerbotMgr@@UAEPAXI@Z)

    12>game.lib(Player.obj) : error LNK2001: unresolved external symbol "public: virtual __thiscall PlayerbotMgr::~PlayerbotMgr(void)" (??1PlayerbotMgr@@UAE@XZ)

    12>game.lib(WorldSession.obj) : error LNK2001: unresolved external symbol "public: virtual __thiscall PlayerbotMgr::~PlayerbotMgr(void)" (??1PlayerbotMgr@@UAE@XZ)

    12>game.lib(CharacterHandler.obj) : error LNK2001: unresolved external symbol "public: virtual __thiscall PlayerbotMgr::~PlayerbotMgr(void)" (??1PlayerbotMgr@@UAE@XZ)

    12>game.lib(Group.obj) : error LNK2019: unresolved external symbol "public: void __thiscall PlayerbotMgr::RemoveAllBotsFromGroup(void)" (?RemoveAllBotsFromGroup@PlayerbotMgr@@QAEXXZ) referenced in function "public: unsigned int __thiscall Group::RemoveMember(unsigned __int64 const &,unsigned char const &)" (?RemoveMember@Group@@QAEIAB_KABE@Z)

    12>game.lib(Player.obj) : error LNK2019: unresolved external symbol "public: virtual __thiscall PlayerbotAI::~PlayerbotAI(void)" (??1PlayerbotAI@@UAE@XZ) referenced in function "public: virtual void * __thiscall PlayerbotAI::`scalar deleting destructor'(unsigned int)" (??_GPlayerbotAI@@UAEPAXI@Z)

    12>game.lib(WorldSession.obj) : error LNK2001: unresolved external symbol "public: virtual __thiscall PlayerbotAI::~PlayerbotAI(void)" (??1PlayerbotAI@@UAE@XZ)

    12>game.lib(ChatHandler.obj) : error LNK2001: unresolved external symbol "public: virtual __thiscall PlayerbotAI::~PlayerbotAI(void)" (??1PlayerbotAI@@UAE@XZ)

    12>game.lib(QuestHandler.obj) : error LNK2001: unresolved external symbol "public: virtual __thiscall PlayerbotAI::~PlayerbotAI(void)" (??1PlayerbotAI@@UAE@XZ)

    12>game.lib(Player.obj) : error LNK2019: unresolved external symbol "public: void __thiscall PlayerbotMgr::UpdateAI(unsigned int)" (?UpdateAI@PlayerbotMgr@@QAEXI@Z) referenced in function "public: virtual void __thiscall Player::Update(unsigned int)" (?Update@Player@@UAEXI@Z)

    12>game.lib(Player.obj) : error LNK2019: unresolved external symbol "public: void __thiscall PlayerbotAI::UpdateAI(unsigned int)" (?UpdateAI@PlayerbotAI@@QAEXI@Z) referenced in function "public: virtual void __thiscall Player::Update(unsigned int)" (?Update@Player@@UAEXI@Z)

    12>game.lib(Player.obj) : error LNK2019: unresolved external symbol "public: void __thiscall PlayerbotMgr::Stay(void)" (?Stay@PlayerbotMgr@@QAEXXZ) referenced in function "public: bool __thiscall Player::TeleportTo(unsigned int,float,float,float,float,unsigned int)" (?TeleportTo@Player@@QAE_NIMMMMI@Z)

    12>game.lib(Chat.obj) : error LNK2019: unresolved external symbol "protected: bool __thiscall ChatHandler::HandlePlayerbotCommand(char const *)" (?HandlePlayerbotCommand@ChatHandler@@IAE_NPBD@Z) referenced in function "protected: class ChatCommand * __thiscall ChatHandler::getCommandTable(void)" (?getCommandTable@ChatHandler@@IAEPAVChatCommand@@XZ)

    12>game.lib(WorldSession.obj) : error LNK2019: unresolved external symbol "public: void __thiscall PlayerbotMgr::HandleMasterOutgoingPacket(class WorldPacket const &)" (?HandleMasterOutgoingPacket@PlayerbotMgr@@QAEXABVWorldPacket@@@Z) referenced in function "public: void __thiscall WorldSession::SendPacket(class WorldPacket const *)" (?SendPacket@WorldSession@@QAEXPBVWorldPacket@@@Z)

    12>game.lib(WorldSession.obj) : error LNK2019: unresolved external symbol "public: void __thiscall PlayerbotAI::HandleBotOutgoingPacket(class WorldPacket const &)" (?HandleBotOutgoingPacket@PlayerbotAI@@QAEXABVWorldPacket@@@Z) referenced in function "public: void __thiscall WorldSession::SendPacket(class WorldPacket const *)" (?SendPacket@WorldSession@@QAEXPBVWorldPacket@@@Z)

    12>game.lib(WorldSession.obj) : error LNK2019: unresolved external symbol "public: void __thiscall PlayerbotAI::HandleTeleportAck(void)" (?HandleTeleportAck@PlayerbotAI@@QAEXXZ) referenced in function __catch$?Update@WorldSession@@QAE_NI@Z$0

    12>game.lib(WorldSession.obj) : error LNK2019: unresolved external symbol "public: void __thiscall PlayerbotMgr::HandleMasterIncomingPacket(class WorldPacket const &)" (?HandleMasterIncomingPacket@PlayerbotMgr@@QAEXABVWorldPacket@@@Z) referenced in function "public: bool __thiscall WorldSession::Update(unsigned int)" (?Update@WorldSession@@QAE_NI@Z)

    12>game.lib(WorldSession.obj) : error LNK2019: unresolved external symbol "public: void __thiscall PlayerbotMgr::LogoutAllBots(void)" (?LogoutAllBots@PlayerbotMgr@@QAEXXZ) referenced in function "public: void __thiscall WorldSession::LogoutPlayer(bool)" (?LogoutPlayer@WorldSession@@QAEX_N@Z)

    12>game.lib(ChatHandler.obj) : error LNK2019: unresolved external symbol "public: void __thiscall PlayerbotAI::HandleCommand(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class Player &)" (?HandleCommand@PlayerbotAI@@QAEXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAVPlayer@@@Z) referenced in function "public: void __thiscall WorldSession::HandleMessagechatOpcode(class WorldPacket &)" (?HandleMessagechatOpcode@WorldSession@@QAEXAAVWorldPacket@@@Z)

    12>game.lib(QuestHandler.obj) : error LNK2019: unresolved external symbol "public: void __thiscall PlayerbotAI::AcceptQuest(class Quest const *,class Player *)" (?AcceptQuest@PlayerbotAI@@QAEXPBVQuest@@PAVPlayer@@@Z) referenced in function "public: void __thiscall WorldSession::HandlePushQuestToParty(class WorldPacket &)" (?HandlePushQuestToParty@WorldSession@@QAEXAAVWorldPacket@@@Z)

    12>game.lib(CharacterHandler.obj) : error LNK2019: unresolved external symbol "public: void __thiscall PlayerbotMgr::OnBotLogin(class Player * const)" (?OnBotLogin@PlayerbotMgr@@QAEXQAVPlayer@@@Z) referenced in function "public: void __thiscall CharacterHandler::HandlePlayerBotLoginCallback(class QueryResult *,class SqlQueryHolder *)" (?HandlePlayerBotLoginCallback@CharacterHandler@@QAEXPAVQueryResult@@PAVSqlQueryHolder@@@Z)

    12>..\\..\\bin\\Win32_Release\\mangosd.exe : fatal error LNK1120: 15 unresolved externals

    it keeps erroring

    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. More or less. When I added the 'group loot roll' feature to playerbot, there was an annoying glitch that caught me out a few times, during play. If bots have full bags, they may still take part in rolls. If they win and can't collect their reward, the item is lost. If you as the player try to pick up the item from the corpse, the system will teases you ' item is still being rolled for'. As Sods Law dictates, the item will be just what you wanted.

    The trade feature just lists items that are tradable, and not all the items. You have no way to determine how full the bags are. I'm hoping that this 'bag' feature will give you enough warning, so you can visit a vendor, and that's where your 'buy' & 'sell' feature will come into its own.

    Cheers

    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. know what would be REALLY nice? if someone could design an LUA or whatever it takes, so that when you are looking in your bots bags you can at least SEE, if not actually affect, the items it has... (would be even better if you could affect them but no need to be pushy *lmao*

    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. Hi Guys,

    I propose to work on an inventory feature for the bots, which I feel is lacking from the present code. At anytime you will be able to determine the bot inventory, and available space, simply by using the command 'bag'. I will start this as soon as I have resolved the present issues that I have mentioned.

    Cheers

    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. Great to see your 'bot buy' patch is ready for testing. I'll try out on my next build. I guess 'bot sell' will be the next challenge. I was thinking that it might be useful if we get the bots to warn when their bags are full. It would certainly prevent 'group loot rolls' from being messed up. Great work, thanks for your contribution.

    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 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.

    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. Here is the code straight from my server,

        else if ((text == "buy") || (text == "buy ") || (text.size() > 4 && text.substr(0, 4) == "buy "))
       {
           const uint64 playerSelection = fromPlayer.GetSelection( );
           Object* const pNpc = ObjectAccessor::GetObjectByTypeMask(*m_bot, playerSelection, TYPEMASK_UNIT|TYPEMASK_GAMEOBJECT);
           if (!pNpc)
           {
               SendWhisper ("Selected player is not an NPC I can talk to.", fromPlayer);
               return;
           } 
           Creature *creature = GetPlayer()->GetNPCIfCanInteractWith(playerSelection,UNIT_NPC_FLAG_VENDOR);
    
       // sLog.outDebug("[PlayerbotAI] pNpc TypeId %u", pNpc->GetTypeId());
       // sLog.outDebug("[PlayerbotAI] playerSelection is(GUID:%u)",uint32(GUID_LOPART(playerSelection)));
    
               std::ostringstream itemsOut;
               if (!creature) {
                   SendWhisper ("Barf.", fromPlayer);
                   return;
               }
               const VendorItemData* items = creature->GetVendorItems ();
               if (items->Empty()) {
                   SendWhisper("This vendor does not have items I can buy.", fromPlayer);
               }
           for (uint64 index = 0; index < items->GetItemCount ();++index) {
                   const VendorItem* vItem = items->GetItem(index);
                   ItemPrototype const* pItemProto = ObjectMgr::GetItemPrototype(vItem->item);
    
                   std::string itemName = pItemProto->Name1;
                   ItemLocalization(itemName, pItemProto->ItemId);
    
                   itemsOut << " |cffffffff|Hitem:" << pItemProto->ItemId
                   << ":0:0:0:0:0:0:0" << "|h[" << itemName << "]|h|r";
                   if (creature->GetVendorItemCurrentCount(vItem) > 1)
                       itemsOut << "x" << creature->GetVendorItemCurrentCount(vItem) << ' ';
    
               }
               ChatHandler ch(&fromPlayer);
               SendWhisper("Here are the items I can buy", fromPlayer);
               ch.SendSysMessage(itemsOut.str().c_str());
    //          SendWhisper("Buying!!!", fromPlayer);
               SendWhisper("I dont know how to do that yet!!!", fromPlayer);
       }
    

    Some vendors have more than one of an item for sale. A good example is 'Antonio Perelli' the traveling salesman who walks up and down the road just by the Eastvale Logging Camp, in Elwynn Forest. Try it.

    Hope this helps

    That is so good, thanks. It works a treat. Now to actually purchase the item.

  11. Hi klunk,

    Yes, all I really changed was the flag mentioned. I realise that the block of code was in a prototype stage, no problems. I did experience the jump back effect on one occasion. It only seemed to occur while fromPlayer. was being used to address the GetNPCIfCanInteractWith function (I changed this to GetPlayer()->), although it didn't make much sense.

    I did for the sake of testing, I added some additional code (on my server) to list the names and quantities of vendor items. If you would like this, let me know.

    No, I don't use gdb, I prefer to add my own flags 'sLog.outDebug' to monitor variables & pointers, in debugging. Thats just my choice!

    Cheers

    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

  12. Hi klunk,

    I got it working with a little adjustment. If the player selects a valid Vendor, and you type

    /p buy

    the bots will all list items they can buy, if not, they will whisper 'Barf'.

      else if ((text == "buy") || (text == "buy ") || (text.size() > 4 && text.substr(0, 4) == "buy "))
       {
           const uint64 playerSelection = fromPlayer.GetSelection( );
           Object* const pNpc = ObjectAccessor::GetObjectByTypeMask(*m_bot, playerSelection, TYPEMASK_UNIT|TYPEMASK_GAMEOBJECT);
           if (!pNpc)
           {
               SendWhisper ("Selected player is not an NPC I can talk to.", fromPlayer);
               return;
           } 
           Creature *creature = GetPlayer()->GetNPCIfCanInteractWith(playerSelection, UNIT_NPC_FLAG_VENDOR);
           // Changed from TYPEMASK_UNIT
           sLog.outDebug("[PlayerbotAI] pNpc TypeId %u", pNpc->GetTypeId()); // TypeID from Object.h
           sLog.outDebug("[PlayerbotAI] playerSelection is (GUID:%u)",uint32(GUID_LOPART(playerSelection))); 
           // 'guid' from 'creature' table. Then use 'id' to find 'entry' in 'creature_template' table
    
           if (text == "buy" || text =="buy ") {
               std::ostringstream itemsOut;
               if (!creature) {
                   SendWhisper ("Barf.", fromPlayer);
                   return;
               }
               const VendorItemData* items = creature->GetVendorItems ();
               if (items->Empty()) {
                   SendWhisper("This vendor does not have items I can buy.", fromPlayer);
               }
               uint64 index = 0;
               for (index = 0; index < items->GetItemCount ();++index) {
                   const VendorItem* item = items->GetItem(index);
                   itemsOut << item->item << "|r";
               }
               ChatHandler ch(&fromPlayer);
               SendWhisper("Here are the items I can buy", fromPlayer);
               ch.SendSysMessage(itemsOut.str().c_str());
    //          SendWhisper("Buying!!!", fromPlayer);
           }
           SendWhisper("I dont know how to do that yet!!!", fromPlayer);
       }

    Hope this helps

    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?

  13. 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.

  14. ok that is understandable, what about something similar to 'use actionbar1' to make him use what ever is bound to the '1' key from that char?

    also along the lines of your buying function, could it be possible to make the bot become a vendor and allow me, or others, to purchase items from its inv?

    p.s.

    also if someone whispers a bot could the whisper be routed to me..

    and i could do something like,,

    [bot] whispers: billy said:gief gols!!!

    /w (bot) say lol wth?

    [bot] says: lol wth?

    You could achieve the action bar effect with macros saying /w bot cast x or /w bot use x and binding them to your keys

  15. Does anyone have a routine that gets a Creature object from a guid?

    I am trying to write a routine that will buy from an NPC, I can get the bot to accept the message and I am trying to run :

           Creature* const creature = fromPlayer.GetNPCIfCanInteractWith(playerSelection, TYPEMASK_UNIT);

    I have also tried using a pointer m_bot instead of fromPlayer, the method gets called correctly once and I step over the next line, only to jump back to the line above when I continue. I dont understand why it is doing that, I can only presume it is a threading issue of some sort.

    For some reason edit post does not work for me, so here is the code I am trying to add to the HandleCommand method of PlayerbotAI.cpp, anywhere in the if statements to handle the various comands.

        // SJW - Conversation with NPC will go here
       else if ((text == "buy") || (text == "buy ") || (text.size() > 4 && text.substr(0, 4) == "buy "))
       {
           const uint64 playerSelection = fromPlayer.GetSelection( );
              Object* const pNpc = ObjectAccessor::GetObjectByTypeMask(*m_bot, playerSelection, TYPEMASK_UNIT|TYPEMASK_GAMEOBJECT);
           if (!pNpc)
           {
               SendWhisper ("Selected player is not an NPC I can talk to.", fromPlayer);
               return;
           } 
    
           Creature* const creature = fromPlayer.GetNPCIfCanInteractWith(playerSelection, TYPEMASK_UNIT);
           if (text == "buy" || text =="buy ") {
               std::ostringstream itemsOut;
               if (!creature) {
                   SendWhisper ("Barf.", fromPlayer);
                   return;
               }
               const VendorItemData* items = creature->GetVendorItems ();
               if (items->Empty()) {
                   SendWhisper("This vendor does not have items I can buy.", fromPlayer);
               }
               uint64 index = 0;
               for (index = 0; index < items->GetItemCount ();++index) {
                   const VendorItem* item = items->GetItem(index);
                   itemsOut << item->item << "|r";
               }
               ChatHandler ch(&fromPlayer);
               SendWhisper("Here are the items I can buy", fromPlayer);
               ch.SendSysMessage(itemsOut.str().c_str());
    //            SendWhisper("Buying!!!", fromPlayer);
           }
           SendWhisper("I dont know how to do that yet!!!", fromPlayer);
       }
    
    

  16. Does anyone have a routine that gets a Creature object from a guid?

    I am trying to write a routine that will buy from an NPC, I can get the bot to accept the message and I am trying to run :

           Creature* const creature = fromPlayer.GetNPCIfCanInteractWith(playerSelection, TYPEMASK_UNIT);

    I have also tried using a pointer m_bot instead of fromPlayer, the method gets called correctly once and I step over the next line, only to jump back to the line above when I continue. I dont understand why it is doing that, I can only presume it is a threading issue of some sort.

  17. this may have been asked already, or unreasonable, but would it be possible fpr a player to 'become the bot' and have the original char line up as a bot itself, somewhat of posession from one to the other?

    I am not sure that will be possible, I think that will probably require a change in the client.

  18. Just FYI. I have started to look at getting the bot to interact with NPCs better. I will start with vendors so it can buy and sell items, potentially giving an instruction to sell junk automatically and repair automatically. The next step will be to buy items and finally to train individual or all spells.

    Firstly does anyone have any issue with this, or has anyone already started looking at it? Secondly, does anyone know (from memory) how to establish the location of an NPC/Creature so I can get the bot to walk towards it? I was thinking of getting the bot to target the NPC and if it is within a certain distance to move there. The trouble is how do I convert an name supplied on whisper to an NPC? There seems to be some position data on the creature struct which I thought I might be able to use.

  19. Lots of questions, and I promise at some point I will start providing some answers. :)

    When I was playing with the bot last night it seems that the bot player does not get XP for discovering areas and does not get the completed on the explore quests. the second of this can be found with a quest in Goldshire to explore a kobold mine to the south. I had to log on the bot character and run into the mine to get the quest completion. Is this a known issue? Is there a jira/trac/issue site for playerbot?

    I also noticed that sometimes, when I speak to a trainer that also has a quest, I get a GOSSIP_ enum instead of a text label, this seems to be a mangos issue rather than playerbot but does anyone else see this?

  20. Hi klunk

    Thanks for checking it out. If you enter '/p' (party) at the command line with 'invite', I am not suprised you get a 'What?' whisper. There isn't an 'invite' command supported with Playerbot.

    What I have found is that the ChatHandler is being called when you do a menu invite. I have looked at the text, and it is garbage, and the same text each time. I am trying to silence this.

    Cheers

    Yes, I am not sure that there is anything you can do with it, other than put up with it. If you want to party with real people and bots you will get noise because bots listen to party chat as well. The only way around it is a special bot channel just for bot commands but then how do you stop all bots on the system getting the messages.

    As for the floor issue I menioned, it seems to happen in the start areas, Human and Drainei but is fine in the city, stormwind.

  21. Hi Guys,

    Yes I have found a solution. I changed a pointer to the players name. I thought that if the members name was obtained from the CMSG_GROUP_INVITE, then it made sense that this should also be passed to the SMSG_GROUP_INVITE. You will see where I have commented out GetPlayer()->GetName(); and replaced it with membername;

    In 'void WorldSession::HandleGroupInviteOpcode( WorldPacket & recv_data ), GroupHandler.cpp';

       // ok, we do it
       WorldPacket data(SMSG_GROUP_INVITE, 10);                // guess size
       data << uint8(1);                                       // ok
       data << membername;  //  GetPlayer()->GetName();
       player->GetSession()->SendPacket(&data);
    
    

    I will make a temporary patch shortly for you to test out, or just change the value and see if it works.

    @klunk It would useful if you can check that my change does not mess up real player groups.

    Edit: One further change. Comment out recv_data.read_skip<uint32>();

    In GroupHandler.cpp

    void WorldSession::HandleGroupAcceptOpcode( WorldPacket & recv_data )
    {
       //  recv_data.read_skip<uint32>();                          // value received in WorldSession::HandleGroupInviteOpcode and also skipeed currently?
    
       Group *group = GetPlayer()->GetGroupInvite();
       if (!group) return;

    This was probably what caused the issue. It may have been added in MaNGOS[9172].

    Hope this helps

    OK, so I managed to group with both bots and real people, interestingly if I type in /p with real people and bots I get a whisper from the bot every time. If its my bot it doesnt understand or someone elses it says speak to my master. Maybe have to have different chanels for real chat.

×
×
  • 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