/
mount.lua
executable file
·63 lines (56 loc) · 2.11 KB
/
mount.lua
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
local tip = CreateFrame('GAMETOOLTIP', 'modmount', nil, 'GameTooltipTemplate')
tip:SetOwner(UIParent, 'ANCHOR_NONE')
local dismount = function()
for i = -1, 16 do
local j = GetPlayerBuff(i)
tip:ClearLines()
tip:SetPlayerBuff(j)
local t = _G['modmountTextLeft2']:GetText()
if t then
local _, _, speed = string.find(t, 'Increases speed by (.+)%%')
if speed then CancelPlayerBuff(i) return end
end
end
end
local fishing = function()
for bag = 0, NUM_BAG_SLOTS do
for slot = 1, GetContainerNumSlots(bag) do
local link = GetContainerItemLink(bag, slot)
if link then
local _, _, istring = string.find(link, '|H(.+)|h')
local n = GetItemInfo(istring)
if n and (string.find(n, 'Fishing Pole') or string.find(n, 'FC-5000')) then
UseContainerItem(bag, slot)
print'|cff4c8d00Your Fishing Pole has been equipped.|r'
break
end
end
end
end
end
local shapeshift = function()
for i = 1, GetNumShapeshiftForms() do
local _, name, active = GetShapeshiftFormInfo(i)
if active ~= nil then
CastShapeshiftForm(i)
break
end
end
end
local f = CreateFrame'Frame'
f:RegisterEvent'UI_ERROR_MESSAGE' f:RegisterEvent'GOSSIP_SHOW'
f:SetScript('OnEvent', function()
if event =='UI_ERROR_MESSAGE' then
if string.find(arg1, 'mounted') or string.find(arg1, 'while silenced') then
dismount()
elseif string.find(arg1, 'Fishing Pole') then
fishing()
elseif string.find(arg1, 'shapeshift') then
shapeshift()
end
else
local _, g1 = GetGossipOptions()
if g1 == 'taxi' then dismount() end
end
end)
--