Quantcast

It works!

Kevin Carpenter [04-18-13 - 03:37]
It works!
Filename
BennyHill.lua
diff --git a/BennyHill.lua b/BennyHill.lua
index ad27ce6..2feb525 100644
--- a/BennyHill.lua
+++ b/BennyHill.lua
@@ -1,4 +1,22 @@
-SLASH_BENNY_HILL, SLASH_BH = '/bennyhill', '/bh';
-function SlashCmdList.BENNY_HILL(msg, editbox)
-  PlaySoundFile("benny_hill.mp3");
-end
\ No newline at end of file
+function SlashCmdList_AddSlashCommand(name, func, ...)
+    SlashCmdList[name] = func
+    local command = ''
+    for i = 1, select('#', ...) do
+        command = select(i, ...)
+        if strsub(command, 1, 1) ~= '/' then
+            command = '/' .. command
+        end
+        _G['SLASH_'..name..i] = command
+    end
+end
+
+SlashCmdList_AddSlashCommand('BENNY_HILL', function(msg)
+
+ PlaySoundFile("Interface\\AddOns\\BennyHill\\benny_hill.mp3");
+end, 'bennyhill', 'bh')
+
+local frame = CreateFrame("Frame")
+frame:RegisterEvent("PLAYER_LOGIN")
+frame:SetScript("OnEvent", function(self, event, ...)
+	ChatFrame1:AddMessage(UnitName("Player") ..' has logged in.')
+end)
\ No newline at end of file