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.mzph.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;建议把之前镜像和搭载的容器数据卷里面…