Billy 164 Report post Posted June 6, 2016 (edited) NPC allows GM to set up auctions for users to bid on. Auction has a set end time. Auction can have multiple items. Users bids are in GM defined increments. Supports multiple auctions at once. Users must talk to the NPC to claim their rewards if they win the bid. Users can claim back gold spent on bids were they lose (this feature can be disabled) To do: Allow use of item attributes on reward items. Bidding System.lua Edited June 6, 2016 by 7n6 6 Quote Share this post Link to post Share on other sites
DevMorgan 6 Report post Posted June 6, 2016 Nice bro! Quote Share this post Link to post Share on other sites
Shako 97 Report post Posted October 6, 2016 @Billy I'm not sure if you added the HandleChat function to add auctions in your script, because I can't find it. /AddNewItem & /addnewitem returns nothing, am I supposed to add this myself? Quote Sunny Go! Online pko.host Share this post Link to post Share on other sites
Billy 164 Report post Posted October 6, 2016 @Shako since different people structure their handlechats different i didnt add one in by default. You need to make it call Bidding.Add(role,message) Quote Share this post Link to post Share on other sites
Shako 97 Report post Posted October 6, 2016 (edited) 5 minutes ago, Billy said: @Shako since different people structure their handlechats different i didnt add one in by default. You need to make it call Bidding.Add(role,message) Thats what I figured, I'm trying to make it work. I put in Bidding.Add(role,message) on my HandleChat function, but now when a non-GM account does even "/" it returns ERROR, whereas the GM account who does /addnewitem doesn't have any feedback. function HandleChat () Bidding.Add ( role , message) Should I do something like this instead? if (message == "/addnewitem") then Bidding.Add ( role , message) EDIT: Ill assume yes, sry Edited October 6, 2016 by Shako Quote Sunny Go! Online pko.host Share this post Link to post Share on other sites
Shako 97 Report post Posted October 6, 2016 @Billy I found a bug. When you press claim back gold / items, it resets your cash stack to the amount claimed. For example, I had 99 mil inside my inventory, and claimed back the item, and received back 1000 gold, but all the gold I have now is only 1000. Quote Sunny Go! Online pko.host Share this post Link to post Share on other sites
Shako 97 Report post Posted October 6, 2016 (edited) 49 minutes ago, Shako said: @Billy I found a bug. When you press claim back gold / items, it resets your cash stack to the amount claimed. For example, I had 99 mil inside my inventory, and claimed back the item, and received back 1000 gold, but all the gold I have now is only 1000. Edited: Here is the fixed code. Can you review it? function Bidding.ClaimOwedGold(role) local name = GetChaDefaultName(role) local Owed = table.load(Bidding.OwedSavePath,"r") local gold = GetChaAttr(role,8) local Owed_Money = 0 if Owed[name] == nil or Owed[name].Gold == 0 then SystemNotice(role,Bidding.Messages[16]) elseif gold == 2000000000 then SystemNotice(role,Bidding.Messages[17]) else local givenGold = math.min(2000000000 - gold,Owed[name].Gold) Owed[name].Gold = Owed[name].Gold - givenGold table.save(Owed,Bidding.OwedSavePath,"w") Owed_Money = givenGold givenGold = gold + givenGold SetCharaAttr( givenGold ,role , 8) RefreshCha(role) local msg = string.gsub(Bidding.Messages[22],"$X",Owed_Money) SystemNotice(role,msg) end end Another bug: When the time expires, you still can't get it. Claim owed items doesn't give you anything either. The item stays in the auction list, and can still be bidded. Edited October 6, 2016 by Shako Quote Sunny Go! Online pko.host Share this post Link to post Share on other sites