SpeedyAutoLoot

SpeedyAutoLoot自動拾取插件

SpeedyAutoLoot.lua

local AutoLoot = CreateFrame('Frame')SpeedyAutoLootDB = SpeedyAutoLootDB or {}
SpeedyAutoLootDB.global = SpeedyAutoLootDB.global or {}local BACKPACK_CONTAINER = BACKPACK_CONTAINER
local LOOT_SLOT_CURRENCY = LOOT_SLOT_CURRENCY
local LOOT_SLOT_ITEM = LOOT_SLOT_ITEM
local LOOT_SLOT_MONEY = LOOT_SLOT_MONEY
local NUM_BAG_SLOTS = NUM_BAG_SLOTS
local GetContainerNumFreeSlots = GetContainerNumFreeSlots
local GetCVarBool = GetCVarBool
local GetItemCount = GetItemCount
local GetItemInfo = GetItemInfo
local GetLootSlotInfo = GetLootSlotInfo
local GetLootSlotLink = GetLootSlotLink
local GetLootSlotType = GetLootSlotType
local GetNumLootItems = GetNumLootItems
local GetCursorPosition = GetCursorPosition
local IsFishingLoot = IsFishingLoot
local IsModifiedClick = IsModifiedClick
local LootSlot = LootSlot
local PlaySound = PlaySound
local SetCVar = SetCVar
local find = string.find
local select = select
local tContains = tContains
local errorList = { ERR_INV_FULL, ERR_ITEM_MAX_COUNT }
local fishingChannel = 'Master'function AutoLoot:PlayFishingSound()if IsFishingLoot() thenreturn (fishingChannel and PlaySound(SOUNDKIT.FISHING_REEL_IN, fishingChannel)) or PlaySound(SOUNDKIT.FISHING_REEL_IN)end
endfunction AutoLoot:PlayInventoryFullSound()if SpeedyAutoLootDB.global.enableSound and not self.isItemLocked thenPlaySound(SpeedyAutoLootDB.global.InventoryFullSound, 'Master')end
endfunction AutoLoot:LootUnderMouse(self, parent)if(GetCVar('lootUnderMouse') == '1') thenlocal x, y = GetCursorPosition()x = x / self:GetEffectiveScale()y = y / self:GetEffectiveScale()self:ClearAllPoints()self:SetPoint('TOPLEFT', UIParent, 'BOTTOMLEFT', x - 40, y + 20)self:GetCenter()self:Raise()elseself:ClearAllPoints()self:SetPoint('TOPLEFT', parent, 'TOPLEFT')end
endfunction AutoLoot:CalculateFreeSlots()local numTotalFree, numFreeSlots, bagFamily = 0for i = BACKPACK_CONTAINER, NUM_BAG_SLOTS donumFreeSlots, bagFamily = GetContainerNumFreeSlots(i)if bagFamily == 0 thennumTotalFree = numTotalFree + numFreeSlotsendendreturn numTotalFree
endfunction AutoLoot:ProcessLoot(itemLink, quantity, slotType)if slotType == LOOT_SLOT_MONEY thenreturn trueelseif slotType == LOOT_SLOT_CURRENCY thenreturn trueelseif slotType == LOOT_SLOT_ITEM thenif self:CalculateFreeSlots() > 0 thenreturn trueendlocal have = (GetItemCount(itemLink) or 0)if have > 0 thenlocal itemStackCount = (select(8,GetItemInfo(itemLink)) or 0)if itemStackCount > 1 thenwhile have > itemStackCount dohave = have - itemStackCountendlocal remain = itemStackCount - haveif remain >= quantity thenreturn trueendendendend
endfunction AutoLoot:ShowLootFrame(show)if self.XLoot thenif show thenself:LootUnderMouse(XLootFrame, UIParent)XLootFrame:SetParent(UIParent)XLootFrame:SetFrameStrata('DIALOG')self.isHidden = falseelseXLootFrame:SetParent(self)self.isHidden = trueendelseif self.ElvUI thenif show thenself:LootUnderMouse(ElvLootFrame, ElvLootFrameHolder)ElvLootFrame:SetParent(ElvLootFrameHolder)ElvLootFrame:SetFrameStrata('HIGH')self.isHidden = falseelseElvLootFrame:SetParent(self)self.isHidden = trueendelseif LootFrame:IsEventRegistered('LOOT_SLOT_CLEARED') thenLootFrame.page = 1;if show thenself:LootUnderMouse(LootFrame, UIParent)LootFrame_Show(LootFrame)self.isHidden = falseelseself.isHidden = trueendendself:PlayFishingSound()
endfunction AutoLoot:LootItems()local numItems = GetNumLootItems() or 0if numItems > 0 thenfor i = numItems, 1, -1 dolocal itemLink = GetLootSlotLink(i)local slotType = GetLootSlotType(i)local quantity, _, _, locked, isQuestItem = select(3, GetLootSlotInfo(i))if locked thenself.isItemLocked = lockedelseif isQuestItem or self:ProcessLoot(itemLink, quantity, slotType) thennumItems = numItems - 1LootSlot(i)endendif numItems > 0 thenself:ShowLootFrame(true)self:PlayInventoryFullSound()endend
endfunction AutoLoot:OnEvent(e, ...)if e == 'PLAYER_LOGIN' thenif XLootFrame thenself.XLoot = trueelseif ElvUI and ElvUI[1].private.general.loot thenself.ElvUI = trueendif SpeedyAutoLootDB.global.alwaysEnableAutoLoot thenSetCVar('autoLootDefault',1)endLootFrame:UnregisterEvent('LOOT_OPENED')self:ShowLootFrame(false)elseif (e == 'LOOT_READY' or e == 'LOOT_OPENED') and not self.isLooting thenself.isLooting = truelocal autoLoot = ...if autoLoot or GetCVarBool('autoLootDefault') ~= IsModifiedClick('AUTOLOOTTOGGLE') thenself:LootItems()elseself:ShowLootFrame(true)endelseif e == 'LOOT_CLOSED' thenself.isLooting = falseself.isHidden  = falseself.isItemLocked = nilself:ShowLootFrame(false)elseif e == 'UI_ERROR_MESSAGE' and tContains(errorList, select(2,...)) thenif self.isLooting and self.isHidden thenself:ShowLootFrame(true)self:PlayInventoryFullSound()endend
endSLASH_SPEEDYAUTOLOOT1, SLASH_SPEEDYAUTOLOOT2, SLASH_SPEEDYAUTOLOOT3  = '/sal', '/speedyloot', '/speedyautoloot'
function SlashCmdList.SPEEDYAUTOLOOT(msg)local _, _, cmd, args = find(msg, '%s?(%w+)%s?(.*)')if not cmd or cmd == '' or cmd == 'help' thenprint('|cffEEE4AESpeedy AutoLoot:|r |cffEF6D6D/sal /speedyautoloot /speedyloot|r')print('  |cffEF6D6D/sal auto              -|r  |cffFAD1D1Enable Auto Looting for new/all characters|r')print('  |cffEF6D6D/sal sound            -|r  |cffFAD1D1Play a Sound when Inventory is full while looting|r')print('  |cffEF6D6D/sal set (SoundID) -|r  |cffFAD1D1Set a Sound (SoundID), Example: /sal set 139|r')elseif cmd == 'auto' thenif SpeedyAutoLootDB.global.alwaysEnableAutoLoot thenSpeedyAutoLootDB.global.alwaysEnableAutoLoot = falseprint('|cffEEE4AESpeedy AutoLoot:|r |cffB6B6B6Auto Loot for all Characters disabled.')elseSpeedyAutoLootDB.global.alwaysEnableAutoLoot = trueprint('|cffEEE4AESpeedy AutoLoot:|r |cff37DB33Auto Loot for all Characters enabled.')endelseif cmd == 'sound' thenif SpeedyAutoLootDB.global.enableSound thenSpeedyAutoLootDB.global.enableSound = falseprint('|cffEEE4AESpeedy AutoLoot:|r |cffB6B6B6Don\'t play a sound when inventory is full.')elseif not SpeedyAutoLootDB.global.InventoryFullSound thenSpeedyAutoLootDB.global.InventoryFullSound = 139endSpeedyAutoLootDB.global.enableSound = trueprint('|cffEEE4AESpeedy AutoLoot:|r |cff37DB33Play a sound when inventory is full.')endelseif cmd == 'set' and args ~= '' thenlocal SoundID = tonumber(args:match('%d+'))if SoundID thenSpeedyAutoLootDB.global.InventoryFullSound = tonumber(args:match('%d+'))PlaySound(SoundID, 'Master')print('|cffEEE4AESpeedy AutoLoot: Set Sound|r |cff37DB33'..SoundID..'|r')endend
endfunction AutoLoot:OnLoad()self:SetToplevel(true)self:Hide()self:SetScript('OnEvent', function(_, ...)self:OnEvent(...)end)for _,e in next, ({	'PLAYER_LOGIN','LOOT_READY','LOOT_OPENED','LOOT_CLOSED','UI_ERROR_MESSAGE' }) doself:RegisterEvent(e)end
end
AutoLoot:OnLoad()

SpeedyAutoLoot.toc

## Interface: 11302
## Title: |cffEEE4AESpeedy AutoLoot|r
## Notes: |cff58C6FALoot at ludicrous speed!|r
## Author: Yuyuli
## Version: 2.0.9
## SavedVariables: SpeedyAutoLootDBSpeedyAutoLoot.lua

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/903268.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/903268.shtml
英文地址,請注明出處:http://en.pswp.cn/news/903268.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

xe-upload上傳文件插件

1.xe-upload地址:文件選擇、文件上傳組件(圖片,視頻,文件等) - DCloud 插件市場 2.由于開發app要用到上傳文件組件,uni.chooseFile在app上不兼容,所以找到了xe-upload,兼容性很強&a…

Golang|外觀模式和具體邏輯

最終返回的是Document的切片,然后取得Bytes自己再去做反序列化拿到文檔的各種詳細信息。 外觀模式是一種結構型設計模式,它的目的是為復雜的子系統提供一個統一的高層接口,讓外部調用者(客戶端)可以更簡單地使用子系統…

2025年3月AGI技術月評|技術突破重構數字世界底層邏輯

〔更多精彩AI內容,盡在 「魔方AI空間」 ,引領AIGC科技時代〕 本文作者:貓先生 ——當「無限照片」遇上「可控試穿」,我們正在見證怎樣的智能革命? 被低估的進化:開源力量改寫游戲規則 當巨頭們在AGI賽道…

可解釋人工智能(XAI):讓機器決策透明化

在人工智能(AI)技術飛速發展的今天,AI 系統已經廣泛應用于金融、醫療、交通等多個關鍵領域。然而,隨著 AI 系統的復雜性不斷增加,尤其是深度學習模型的廣泛應用,AI 的“黑箱”問題逐漸凸顯。AI 系統的決策過…

【Go語言】ORM(對象關系映射)庫

github.com/jinzhu/gorm 是 Go 語言中一個非常流行的 ORM(對象關系映射)庫,用于簡化與關系型數據庫的交互。以下是關于它的關鍵信息: 核心特點 全功能 ORM 支持主流數據庫:MySQL、PostgreSQL、SQLite、SQL Server 等。…

大數據企業實驗室管理的痛點 質檢LIMS系統在大數據企業的應用

在數字化轉型浪潮中,大數據企業正面臨海量數據管理與質量控制的雙重挑戰。實驗室作為數據生產的核心環節,其檢測流程的規范化、數據處理的智能化直接關系到企業數據資產的可靠性。質檢LIMS(實驗室信息管理系統)通過整合實驗室資源…

在Arduino U8g2庫中顯示中文的方法

U8g2庫支持中文顯示,但需要手動添加中文字體或使用內置的有限中文字符。以下是具體實現方法: 方法一 使用U8g2內置的中文字體(不推薦) 缺點:內置字體支持的漢字較少,可能無法顯示所有需要的字符。不推薦。…

自動駕駛分級

一、美國 SAE J3016 Taxonomy and Definitions for Terms Related to Driving Automation Systems for On-Road Motor Vehicles(2021) 1、駕駛自動化級別(Levels of Driving Automation) 共分為 6 個級別,從 無自動化(0&#…

工業園區工廠企業數字IP廣播應急呼叫對講系統:數字IP廣播極大提升工廠企業管理效率與應急響應效能

工業園區工廠企業數字IP廣播應急呼叫對講系統:數字IP廣播極大提升工廠企業管理效率與應急響應效能 北京海特偉業科技有限公司任洪卓發布于2025年4月28日 在數字化轉型浪潮下,IP應急廣播呼叫對講廣播系統憑借其網絡化、智能化、融合化、多元化等優勢,已…

DNS主從同步及解析

DNS 域名解析原理 域名系統的層次結構 :DNS 采用分層樹狀結構,頂級域名(如.com、.org、.net 等)位于頂層,下面是二級域名、三級域名等。例如,在域名 “www.example.com” 中,“com” 是頂級域名…

再看 BBR 到 BBRv3 的公平性改進

從看一篇論文開始:Performance Evaluation of TCP BBRv3 in Networks with Multiple Round Trip Times,結論比較悲觀: 雖然 BBRv2/3 試圖解決 BBRv1 的公平性問題,但結果依舊不夠理想,BBR 的迭代依舊任重而道遠。 BB…

locust壓力測試

安裝 pip install locust驗證是否安裝成功 locust -V使用 網上的教程基本上是前幾年的,locust已經更新了好幾個版本,有點過時了,在此做一個總結 啟動 默認是使用瀏覽器進行設置的 # 使用瀏覽器 locust -f .\main.py其他參數 Usage: locust […

優先隊列和單調隊列(雙端隊列實現的)

這里寫自定義目錄標題 一、優先隊列與單調隊列二、優先隊列2.1 概念2.2 增刪查 判空2.3 示例代碼 三、雙端隊列四、單調隊列4.1 單調遞增隊列4.2 單調遞減隊列 一、優先隊列與單調隊列 二、優先隊列 2.1 概念 一種特殊的隊列,它與普通隊列的主要區別在于元素的出…

如何在idea中寫spark程序

在 IntelliJ IDEA 中編寫 Spark 程序是一個高效且便捷的方式,以下是一個詳細的步驟指南,幫助你在 IntelliJ IDEA 中創建和運行 Spark 程序。 一、環境準備 安裝 Java: 確保已經安裝了 JDK 1.8 或更高版本。可以通過以下命令檢查:…

BERT BERT

BERT ***** 2020年3月11日更新:更小的BERT模型 ***** 這是在《深閱讀的學生學得更好:預訓練緊湊模型的重要性》(arXiv:1908.08962)中提到的24種較小規模的英文未分詞BERT模型的發布。 我們已經證明,標準的BERT架構和…

SpringBoot啟動警告:OpenJDK 64-Bit Server VM warning

問題描述 以Debug模式啟動Spring boot項目之后,日志打印:OpenJDK 64-Bit Server VM warning: Sharing is only supported for boot loader classes because bootstrap classpath has been appended, 警告信息 解決方案:配置VM opt…

“該虛擬機似乎正在使用中“

當某一天打開虛擬機突然彈出"該虛擬機似乎正在使用中"。 遇到這種問題的解決方法很簡單,出現這種問題是因為錯誤關閉虛擬機導致,當我們點擊獲取所有權時發現不能解決問題。這里分享一種簡單的解決方法。 打開虛擬機的文件目錄 找到lck文件夾下…

【CSS】層疊,優先級與繼承(三):超詳細繼承知識點

目錄 繼承一、什么是繼承?2.1 祖先元素2.2 默認繼承/默認不繼承 二、可繼承屬性2.1 字體相關屬性2.2 文本相關屬性2.3 列表相關屬性 三、不可繼承屬性3.1 盒模型相關屬性3.2 背景相關屬性 四、屬性初始值4.1 根元素4.2 屬性的初始值4.3 得出結論 五、強制繼承5.1 in…

Android LiveData關鍵代碼

1、observer方法 public void observe(NonNull LifecycleOwner owner, NonNull Observer<? super T> observer) {assertMainThread("observe");if (owner.getLifecycle().getCurrentState() DESTROYED) {// ignorereturn;}LifecycleBoundObserver wrapper …

Docker-高級使用

前言 書接上文Docker-初級安裝及使用_用docker安裝doccano-CSDN博客&#xff0c;我們講解了Docker的基本操作&#xff0c;下面我們講解的是高級使用&#xff0c;請大家做好準備&#xff01; 大家如果是從初級安裝使用過來的話&#xff0c;建議把之前鏡像和搭載的容器數據卷里面…