分区:插件 更新时间:2024-08-08 原文地址:http://wowdata.top/blog/12
【魔兽插件 21】拍卖被钓鱼,用魔法打败魔法(超好用的秒杀插件)
https://www.bilibili.com/video/BV1GT4y117Pq/
/run scanItemID()
toc和lua做成一个插件:新建一个空的文件“LaohuAuctionScan”,然后把LaohuAuctionScan.toc和LaohuAuctionScan.lua放进去就行了
LaohuAuctionScan.toc
## Interface: 90005
## Title: <>|cff00fe00LaohuAuctionScan-老胡
## Notes: 这是一个拍卖扫描和秒杀插件|r|n——|cff00fe00老胡QQ376665005
## Author: 老胡
LaohuAuctionScan.lua
LaohuAuctionScan.lua
--当前需要购买的物品和价格
currentItem=nil
nextIdx=1
local settingItemIdList = {
{
['itemID']=173202,
['itemName']='萦亡布',
['unitPrice']=1.5*10000,
},
{
['itemID']=172089,
['itemName']='荒革',
['unitPrice']=2.5*10000,
},
{
['itemID']=172092,
['itemName']='苍骨',
['unitPrice']=0.4*10000,
},
}
--/dump C_AuctionHouse.GetCommoditySearchResultInfo(173202,1)
function getFirstRowCount()
local info = C_AuctionHouse.GetCommoditySearchResultInfo(currentItem.itemID,1)
--info is nil
return info and info.quantity or 1
end
--/run scanItemID()
function scanItemID()
print("StartCommoditiesPurchase")
currentItem = settingItemIdList[nextIdx]
nextIdx = nextIdx+1
if nextIdx>#settingItemIdList then
nextIdx=1
end
C_AuctionHouse.StartCommoditiesPurchase(currentItem.itemID,getFirstRowCount())
end
local frame =CreateFrame("Frame")
frame:RegisterEvent("COMMODITY_PRICE_UPDATED")
frame:SetScript("OnEvent",function(self,event,...)
local unitPrice,allPrice=...
print(currentItem.itemID,currentItem.itemName,event,...)
if unitPrice<=currentItem.unitPrice then
print("购买",currentItem.itemID,"单价=",unitPrice/10000)
C_AuctionHouse.ConfirmCommoditiesPurchase(currentItem.itemID,getFirstRowCount())
else
print("价格过高,不购买",currentItem.itemID,"单价=",unitPrice/10000)
end
end)
--C_Timer.NewTicker(3, function()
-- scanItemID()
--end)