This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Version 1 | |
-- Get WoW Client version 1-Classic, 2-TBCc, 9-Retail | |
local wowver=floor((floor(select(4, GetBuildInfo()))/10000)) | |
print("Toc:", wowver) | |
if wowver == 1 then | |
print("This is Classic") | |
elseif wowver == 2 then | |
print("This is TBC") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/lua5.1 | |
--- Async/Await for Lua 5.1 | |
-- This script implements async/await functions for Lua, allowing tasks to | |
-- be queued and scheduled independently. | |
-- | |
-- This is just an example and has a bunch of issues, isn't tested, isn't | |
-- even actually used anywhere; I basically just got bored and had one of | |
-- those "what if?" type ideas 6 hours ago. | |
local co_create = coroutine.create |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MyAddon = LibStub("AceAddon-3.0"):NewAddon("MyAddon") | |
MyAddon.version = "1.0" | |
local Console = LibStub("AceConsole-3.0") | |
local L = LibStub("AceLocale-3.0"):GetLocale("MyAddon") | |
-- Register slash command /myaddon | |
MyAddon:RegisterChatCommand("myaddon", "MyAddonCommand") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- LocaleKeysCleanUp.lua | |
-- Author: Rubgrsch | |
-- License: MIT | |
-- This code helps you find unused localeKeys in your WoW addon. | |
-- What may cause false positive | |
-- 1. keys in comments | |
-- 2. keys in several lines | |
-- 3. keys doesn't match any patterns, e.g. L[ThisIsVariable] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local frame = CreateFrame("Frame") | |
-- The minimum number of seconds between each update | |
local ONUPDATE_INTERVAL = 0.1 | |
-- The number of seconds since the last update | |
local TimeSinceLastUpdate = 0 | |
frame:SetScript("OnUpdate", function(self, elapsed) | |
TimeSinceLastUpdate = TimeSinceLastUpdate + elapsed | |
if TimeSinceLastUpdate >= ONUPDATE_INTERVAL then |