-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDropInvis.lua
More file actions
38 lines (33 loc) · 1.22 KB
/
Copy pathDropInvis.lua
File metadata and controls
38 lines (33 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
--[[
DropInvis
Automatically removes invisible status when attempting to use commands while invisible.
Copyright (c) 2025 Seekey
https://github.com/seekey13/DropInvis
This addon is designed for Ashita v4.
]]
addon.name = 'DropInvis';
addon.author = 'Seekey';
addon.version = '0.1';
addon.desc = 'Automatically removes invisible status when blocked by invisibility';
addon.link = 'https://github.com/seekey13/DropInvis';
require('common');
local INVIS_BUFFS = {
{id = 69, name = 'Invisible'},
{id = 76, name = 'Hide'},
{id = 77, name = 'Camouflage'}
};
-- Event: Incoming text (chat messages)
ashita.events.register('text_in', 'text_in_cb', function (e)
-- Only check messages in channel mode 121 (system text)
local redcol = e.mode % 256;
if redcol == 121 then
-- Check if the message contains the invisibility block message
if string.find(e.message, 'You cannot use that command while invisible.') then
-- Issue the command to remove invisible buff
local chatMgr = AshitaCore:GetChatManager();
for _, buff in ipairs(INVIS_BUFFS) do
chatMgr:QueueCommand(1, string.format('/debuff %d', buff.id));
end
end
end
end);