-
Notifications
You must be signed in to change notification settings - Fork 0
/
gui_relog.lua
34 lines (31 loc) · 894 Bytes
/
gui_relog.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
local toggle = true
local button = CreateFrame("Button", nil, UIParent, "UIPanelButtonTemplate")
button:SetSize(100, 50)
button:SetPoint("TOPRIGHT", MinimapCluster, "TOPLEFT", -5, -100)
button:SetText("Auto: " .. tostring(toggle))
button:SetMovable(true)
button:SetScript("OnClick", function()
toggle = not toggle
button:SetText("Auto: " .. tostring(toggle))
end)
button:SetScript("OnMouseDown", function(self, button)
if button == "RightButton" then
self:StartMoving()
end
end)
button:SetScript("OnMouseUp", function(self, button)
if button == "RightButton" then
self:StopMovingOrSizing()
end
end)
local function relog()
if toggle and GMR.IsFullyLoaded() and not GMR.IsExecuting() then
GMR.Print("autoplay!")
GMR.Execute()
end
if not toggle then
GMR.Print("Autoplay disabled until /reload")
end
button:Hide()
end
C_Timer.After(7, relog)