Jump to content

[PATCH] AuctionHouse Bot


Recommended Posts

  • Replies 702
  • Created
  • Last Reply

Top Posters In This Topic

The auctionhouse that i maintained ( I repeat i did not CREATE it i just updated when needed to, but not just patch wise )

It was done using initialiseSingleton though.

This line where you could simply SET a playername in configs then.

m_PlayerName = Config.MainConfig.GetStringDefault("Auctions", "PlayerName", "Ahbot"); <--- Vaue Ahbot is Set in configs.

then when getting the char name to set an auction If there isnt a player found then the player is named as "Ahbot" when an auction is set up.

if(!plr)

plr = new Player(sAHBotMgr.m_PlayerName);

??

Link to comment
Share on other sites

thyphoon: The reason why we wouldn't want a character for the AHBot is because, as my understanding of things, they don't want to implement this in Mangos directly (instead of a patch) if its characters related...

So no character's, the AHBot would be in Mangos instead of an Add-on...

Link to comment
Share on other sites

temporary: Maybe I wasn't very clear, I understand why having a player for the Bot is unwanted, I was writing about the posibility of not using a Player nor an NPC but to inserting the items directly to the AH and in case a player bought the item, remove it from the AH and send the item via mail.

To do that maybe a way is to script that when the item is put into AH by the Bot it has a 0 guid and it is Auctioned by a fictitious player wish name could be setted via conf, then if some player buy the item it is send to this player and removed of the AH.

Link to comment
Share on other sites

What I do not understand is, Mango has edited the file "Mail.cpp" last 9602 Why do I get an error?

Odd. The difference here probably has something to do with the fact that I am applying the patch in windows using a windows version of patch.exe and running it using the following command:

patch -p1 --binary < ..\\auctionhousebot_005b.patch

Perhaps git apply --check does something a bit different and more stringent. When I apply the patch - I get a number of messages regarding offsets for the specific positions - so while the patch will apply with some fuzzy matching, it may be that by default git is requiring a specific positioning match rather than allowing a fuzzy match. Make no mistake, the file I posted is a "patch jockey" job :)

Link to comment
Share on other sites

Well it works because I created it :) I use the --binary switch because otherwise the version of patch.exe I use on Windows crashes. If I use the cygwin version (which doesn't have this problem) - I get the following output when I attempt to patch a clean extract of the 9645 source tree:

$ patch -p1 --dry-run < ../../auctionhousebot_005b.patch
patching file README.AHBOT
patching file sql/characters_auctionhousebot.sql
patching file sql/characters_auctionhousebot_update.sql
patching file src/game/AuctionHouseBot.cpp
patching file src/game/AuctionHouseBot.h
patching file src/game/AuctionHouseHandler.cpp
Hunk #1 succeeded at 28 with fuzz 2 (offset 1 line).
Hunk #2 succeeded at 122 (offset 1 line).
Hunk #3 succeeded at 255 (offset 1 line).
Hunk #4 succeeded at 270 (offset 1 line).
patching file src/game/AuctionHouseMgr.cpp
Hunk #1 succeeded at 462 (offset -1 lines).
patching file src/game/AuctionHouseMgr.h
patching file src/game/Chat.cpp
patching file src/game/Chat.h
Hunk #1 succeeded at 107 (offset 3 lines).
patching file src/game/Level3.cpp
Hunk #1 succeeded at 52 (offset 1 line).
patching file src/game/Mail.cpp
Hunk #2 succeeded at 1022 (offset 13 lines).
Hunk #3 succeeded at 1043 with fuzz 1 (offset 13 lines).
patching file src/game/Makefile.am
patching file src/game/Player.cpp
Hunk #1 succeeded at 14508 (offset 81 lines).
patching file src/game/Player.h
Hunk #1 succeeded at 1413 (offset -6 lines).
patching file src/game/World.cpp
Hunk #2 succeeded at 1275 (offset 2 lines).
Hunk #3 succeeded at 1350 (offset 2 lines).
patching file src/mangosd/mangosd.conf.dist.in
Hunk #1 succeeded at 1362 (offset 13 lines).
patching file win/VC100/game.vcxproj
Hunk #2 succeeded at 499 (offset 1 line).
patching file win/VC80/game.vcproj
patching file win/VC90/game.vcproj

Link to comment
Share on other sites

Also worth noting - if I run patch with a fuzz factor of 0, here is the output I get instead:

$ patch -p1 --dry-run -F0 < ../../auctionhousebot_005b.patch
patching file README.AHBOT
patching file sql/characters_auctionhousebot.sql
patching file sql/characters_auctionhousebot_update.sql
patching file src/game/AuctionHouseBot.cpp
patching file src/game/AuctionHouseBot.h
patching file src/game/AuctionHouseHandler.cpp
Hunk #1 FAILED at 27.
Hunk #2 succeeded at 122 (offset 1 line).
Hunk #3 succeeded at 255 (offset 1 line).
Hunk #4 succeeded at 270 (offset 1 line).
1 out of 4 hunks FAILED -- saving rejects to file src/game/AuctionHouseHandler.c
pp.rej
patching file src/game/AuctionHouseMgr.cpp
Hunk #1 succeeded at 462 (offset -1 lines).
patching file src/game/AuctionHouseMgr.h
patching file src/game/Chat.cpp
patching file src/game/Chat.h
Hunk #1 succeeded at 107 (offset 3 lines).
patching file src/game/Level3.cpp
Hunk #1 succeeded at 52 (offset 1 line).
patching file src/game/Mail.cpp
Hunk #2 succeeded at 1022 (offset 13 lines).
Hunk #3 FAILED at 1043.
1 out of 3 hunks FAILED -- saving rejects to file src/game/Mail.cpp.rej
patching file src/game/Makefile.am
patching file src/game/Player.cpp
Hunk #1 succeeded at 14508 (offset 81 lines).
patching file src/game/Player.h
Hunk #1 succeeded at 1413 (offset -6 lines).
patching file src/game/World.cpp
Hunk #2 succeeded at 1275 (offset 2 lines).
Hunk #3 succeeded at 1350 (offset 2 lines).
patching file src/mangosd/mangosd.conf.dist.in
Hunk #1 succeeded at 1362 (offset 13 lines).
patching file win/VC100/game.vcxproj
Hunk #2 succeeded at 499 (offset 1 line).
patching file win/VC80/game.vcproj
patching file win/VC90/game.vcproj

Link to comment
Share on other sites

Okay I've tweaked it so the patch will apply with no fuzz and no offsets to 9645 now:

http://www.jaylittle.com/jaylittle/downloads/auctionhousebot_005c.zip

Here is the patch output:

$ patch -p1 --dry-run -F0 < ../../auctionhousebot_005c.patch
patching file README.AHBOT
patching file sql/characters_auctionhousebot.sql
patching file sql/characters_auctionhousebot_update.sql
patching file src/game/AuctionHouseBot.cpp
patching file src/game/AuctionHouseBot.h
patching file src/game/AuctionHouseHandler.cpp
patching file src/game/AuctionHouseMgr.cpp
patching file src/game/AuctionHouseMgr.h
patching file src/game/Chat.cpp
patching file src/game/Chat.h
patching file src/game/Level3.cpp
patching file src/game/Mail.cpp
patching file src/game/Makefile.am
patching file src/game/Player.cpp
patching file src/game/Player.h
patching file src/game/World.cpp
patching file src/mangosd/mangosd.conf.dist.in
patching file win/VC100/game.vcxproj
patching file win/VC80/game.vcproj
patching file win/VC90/game.vcproj

Hope this helps!

Link to comment
Share on other sites

Okay and for my last post in this thread for awhile (about to leave on a trip), I've updated the patch so that it cleanly patches 9648 with no offsets (fuzz wasn't an issue this time):

http://www.jaylittle.com/jaylittle/downloads/auctionhousebot_005d.zip

<stdin>:3466: trailing whitespace.

warning: 1 line adds whitespace errors.

Mangos Clean 9651

i try Comp the branch

Link to comment
Share on other sites

was unable to patch the latest scriptdev2 (1662) with this trunk

Applying: ScriptDev2 patch.
error: patch failed: src/mangosd/Makefile.am:51
error: src/mangosd/Makefile.am: patch does not apply
Patch failed at 0001 ScriptDev2 patch.
When you have resolved this problem run "git am --resolved".
If you would prefer to skip this patch, instead run "git am --skip".
To restore the original branch and stop patching run "git am --abort".

Link to comment
Share on other sites

was unable to patch the latest scriptdev2 (1662) with this trunk

Applying: ScriptDev2 patch.
error: patch failed: src/mangosd/Makefile.am:51
error: src/mangosd/Makefile.am: patch does not apply
Patch failed at 0001 ScriptDev2 patch.
When you have resolved this problem run "git am --resolved".
If you would prefer to skip this patch, instead run "git am --skip".
To restore the original branch and stop patching run "git am --abort".

Investigating now.

Link to comment
Share on other sites

xeross155: Why have you removed the soap (and all the files assoc with soap) that was added back in February?

From what I can tell, the reason it is failing is because the script patch is looking for a certain line which no longer is available in your version, but is available in the master mangos version.

OK the patch worked fine with a clone of master and a pull from xeross's branch

git clone git:// githib.com/mangos/mangos.git

git pull git://github.com/xeross/mangos.git ahbot

then applied the SD2 patch and had no errors.

Link to comment
Share on other sites

I didn't need a patch, here's is what I did (I use PuTTy on a headless Ubuntu server):

git clone git://github.com/mangos/mangos.git (this grabs the latest mangos master branch)

cd mangos (changes directory to mangos folder)

git pull git://github.com/xeross/mangos.git ahbot (this patches the mangos master branch you cloned and adds in the abhot files)

mkdir src/bindings/ScriptDev2 (creates the SD2 directory)

svn co https://scriptdev2.svn.sourceforge.net/svnroot/scriptdev2/ src/bindings/ScriptDev2 (downloads the scriptdev2 files)

git apply src/bindings/ScriptDev2/patches/MaNGOS-9519-ScriptDev2.patch (patches scriptdev2 files into master branch)

then continue on with the rest of the installation procedures

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • 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