Added whisper when outbid

Interested contributing to WebDKP? Find the latest development progress here.

Posts: 6
Joined: Thu Jan 29, 2009 4:43 am
PostPosted: Thu Mar 12, 2009 4:47 pm
I've seen this requested by others in the past (when i myself was looking for a fix for this). As there was no fix before, I made one myself.

What this do:
This will whisper the OLD highest bidder, when they are outbid, telling them that they are no longer the highest bidder.
This is good for silent bidding, where you still want people to know if they are winning or must bid higher.

Howto:
Open Bidding.lua and find the following function:


Code: Select all
-- ================================
-- Handles a bid placed by a player.
-- ================================
function WebDKP_Bid_HandleBid(playerName, bidAmount)
   
   -- if a bid is not in progress ignore it
   if(WebDKP_bidInProgress) then
      --load up some information about the player
      local dkp = WebDKP_GetDKP(playerName);         -- how much dkp do they have now
      local postDkp = dkp-bidAmount;               -- what they will have if they spend this
      bidAmount = bidAmount+0;                  -- make sure bid amount is an int
      local date  = date("%Y-%m-%d %H:%M:%S");      -- record when this bid was placed
      
      -- check to see if we should reject this bid if it makes the user go into
      -- negative balance
      if ( postDkp < 0 and WebDKP_Options["BidAllowNegativeBids"] == 0 ) then
         WebDKP_SendWhisper(playerName,"Bid Rejected - you cannot bid more than you have.");
         WebDKP_SendWhisper(playerName,"Your maximum bid is "..dkp);
      else
         -- bid is ok, we can go ahead and record it
         WebDKP_BidList[playerName..date] = {         -- place their bid in the bid table (combine it with the date so 1 player can have multiple bids / unique indices in the table)
            ["Name"] = playerName,
            ["Bid"] = bidAmount,
            ["DKP"] = dkp,
            ["Post"] = postDkp,
            ["Date"] = date,
         }
         
         if(WebDKP_BidList[playerName..date]["Selected"]==nil) then
            WebDKP_BidList[playerName..date]["Selected"] = false;
         end
         
         WebDKP_Bid_UpdateTable();
         
         WebDKP_SendWhisper(playerName,"Bid Recieved");
         
         -- if they bid too low we should tell them
         local highBidder, highBid = WebDKP_Bid_GetHighestBid();
         if ( highBidder == playerName and WebDKP_Options["BidNotifyLowBids"]==1) then
            WebDKP_SendWhisper(playerName,"You are the current high bidder");
         elseif (highBidder ~= playerName and WebDKP_Options["BidNotifyLowBids"]==1) then
            WebDKP_SendWhisper(playerName,"You are NOT the high bidder. The current high bid is  "..highBid.." dkp.");
         end
      
      end
   else
      WebDKP_SendWhisper(playerName,"No bid is in progress");
   end
end


Replace all that with:


Code: Select all
-- ================================
-- Handles a bid placed by a player.
-- ================================
function WebDKP_Bid_HandleBid(playerName, bidAmount)
   
   -- if a bid is not in progress ignore it
   if(WebDKP_bidInProgress) then
      --load up some information about the player
      local dkp = WebDKP_GetDKP(playerName);         -- how much dkp do they have now
      local postDkp = dkp-bidAmount;               -- what they will have if they spend this
      bidAmount = bidAmount+0;                  -- make sure bid amount is an int
      local date  = date("%Y-%m-%d %H:%M:%S");      -- record when this bid was placed
      
      -- check to see if we should reject this bid if it makes the user go into
      -- negative balance
      if ( postDkp < 0 and WebDKP_Options["BidAllowNegativeBids"] == 0 ) then
         WebDKP_SendWhisper(playerName,"Bid Rejected - you cannot bid more than you have.");
         WebDKP_SendWhisper(playerName,"Your maximum bid is "..dkp);
      else
         -- Finding out who used to be High Bidder
         local ohighBidder, ohighBid = WebDKP_Bid_GetHighestBid();
         -- bid is ok, we can go ahead and record it
         WebDKP_BidList[playerName..date] = {         -- place their bid in the bid table (combine it with the date so 1 player can have multiple bids / unique indices in the table)
            ["Name"] = playerName,
            ["Bid"] = bidAmount,
            ["DKP"] = dkp,
            ["Post"] = postDkp,
            ["Date"] = date,
         }
         
         if(WebDKP_BidList[playerName..date]["Selected"]==nil) then
            WebDKP_BidList[playerName..date]["Selected"] = false;
         end
         
         WebDKP_Bid_UpdateTable();
         
         WebDKP_SendWhisper(playerName,"Bid Recieved");
         
         -- if they bid too low we should tell them
         local highBidder, highBid = WebDKP_Bid_GetHighestBid();
         if ( highBidder == playerName and WebDKP_Options["BidNotifyLowBids"]==1) then
            WebDKP_SendWhisper(playerName,"You are the current high bidder");
            WebDKP_SendWhisper(ohighBidder,"You have been outbid and are no longer high bidder. The current high bid is "..highBid.." dkp.";
         elseif (highBidder ~= playerName and WebDKP_Options["BidNotifyLowBids"]==1) then
            WebDKP_SendWhisper(playerName,"You are NOT the high bidder. The current high bid is  "..highBid.." dkp.");
         end
      
      end
   else
      WebDKP_SendWhisper(playerName,"No bid is in progress");
   end
end



(I know I could just tell you to add 2 lines, but i'm trying to make something that anyone can do, even if they have no idea how this works :))

Posts: 1
Joined: Thu Apr 30, 2009 10:42 pm
PostPosted: Thu Apr 30, 2009 10:51 pm
I have tired this and when i do it i can not open the bidding window in game any help would be very much appreciated

Posts: 3
Joined: Tue May 19, 2009 3:39 am
PostPosted: Fri May 22, 2009 2:10 am
I have tried to see if I can figure this out, I don't see any real solution for this. I put the script in as written but I cannot get into the bidding in game. It looks like there has to be an option in the options.lua for the script to work. If this is true please let us know how to do it.

If you can send a whisper to someone that they are not the current high bidder then there should be a way to send the LAST person who bid on the item that the bid went up.

Posts: 6
Joined: Thu Jan 29, 2009 4:43 am
PostPosted: Sat Jun 06, 2009 7:19 am
Just had a look here.

This script does not work with the latest version of WebDKP addon. I made similar changes to the latest version, but couldn't make it work right (not quite sure why, but the latest version seems to have a problem seeing who bid first when you get 2 similar bids).

In any case, you can get the modded version my guild is using from here:
http://s.guildomatic.com/4848/host/2d/2 ... 46a0b0.zip

That one works, it unfortunally do not have some of the newer features like automaticly linking the item when bids are started, or saving of options for next session.

Posts: 3
Joined: Fri Oct 30, 2009 4:44 pm
PostPosted: Fri Oct 30, 2009 4:50 pm
Hello from Sargeras, and thanks for a nice mod!

Anyways, I coded this sometime ago.. I did not realize that other people needed this.

Bidding starts as normal, and when someone who has the high bid is either tied or outbid, they get one warning and the new current high bid. They do not receive further warnings or notifications until they become the high bidder again.

I don't think I have very much else modified in this script, I recall having to change something in the event handling section, but I think this should work what you guys need. Let me know if you have any problems.

---
Edit: Link in post below this one, forum rules dictate one post before link posting.
Last edited by CmaN on Fri Oct 30, 2009 4:52 pm, edited 1 time in total.

Posts: 3
Joined: Fri Oct 30, 2009 4:44 pm
PostPosted: Fri Oct 30, 2009 4:50 pm
http://www.mediafire.com/download.php?2maevm5znmj

Modified bidding.lua, with notification.
User avatar
Site Admin
Posts: 636
Joined: Fri May 22, 2009 12:06 pm
Location: Bronzebeard Server
PostPosted: Sat Oct 31, 2009 3:23 pm
Hey,

Would you guys mind if I added this into the Webdkp version available on curse.com? It probably wouldn't be for a bit because I'm working on raid attendance right now but I know several people are looking for this.

Thanks

Zevious

Posts: 3
Joined: Fri Oct 30, 2009 4:44 pm
PostPosted: Mon Nov 02, 2009 3:10 pm
I hope it makes it into the version, myself.

I will look at where development is at for raid attendance to see if I can lend a hand with that, as well.
User avatar
Site Admin
Posts: 636
Joined: Fri May 22, 2009 12:06 pm
Location: Bronzebeard Server
PostPosted: Mon Nov 09, 2009 2:18 pm
I threw some stuff together today and took a slightly different approach on notifying people who the high bidder is. Instead of whispers you can set up a bid time of like 60 seconds. The addon will announce in raid at 45s, 30s, 15s, and 5 seconds who the high bidder is and how much their bid is. If you'd prefer a silent bid simply leave the timer value blank and it wont do the announcements so no one will know for sure what the high bid is. You will just have to coordinate the time another way or simply announce in voice chat that the bid is coming to an end. A few other features added that will be in the next release. Keep in mind this is a beta version so back up your table.
You can download it at:
http://dkptracker.com/index.php?topic=21.0

Zevious

Return to Development

Who is online

Users browsing this forum: No registered users and 1 guest

cron