Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Jan 24th, 2011  |  syntax: Lua  |  size: 1.26 KB  |  views: 101  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. SLASH_ROLLINGAME1, SLASH_ROLLINGAME2 = '/rollin', '/rg';
  2. SlashCmdList["ROLLINGAME"] = function() btn_hide_OnClick() end;
  3.  
  4. function btn_hide_OnClick()
  5.         if not RollinGame:IsVisible() then
  6.         RollinGame:Hide();
  7.     else
  8.         RollinGame:Hide();
  9.     end
  10. end
  11.  
  12. function btn_roll_OnClick()
  13.         local num = math.random(1,100)
  14.     local roll = tostring(num)
  15.         SendChatMessage(roll, "SAY", nil, "General")
  16.         SendAddonMessage("RollinGame", roll,"RAID")
  17.         SendAddonMessage("RollinGame", roll,"GUILD")
  18.     msg_box:AddMessage(sender.." has rolled: "..message) --just testing
  19.          msg_box2:AddMessage(sender.." has rolled: "..message) --just testing
  20.          msg_box3:AddMessage(sender.." has rolled: "..message) --just testing
  21. end
  22.  
  23. function RollinGame_OnEvent(self, event, ...)
  24.    if event == "CHAT_MSG_ADDON" then
  25.      local prefix, message, channel, sender = ...
  26.      if prefix == "RollinGame" then
  27.          msg_box:AddMessage(sender.." has rolled: "..message) --just testing
  28.          msg_box2:AddMessage(sender.." has rolled: "..message) --just testing
  29.          msg_box3:AddMessage(sender.." has rolled: "..message) --just testing
  30.          print("Got an addon message from ", sender, " on ", channel, " with text ", message)
  31.      end
  32.    elseif event == "PARTY_MEMBERS_CHANGED" then
  33.      
  34.    end
  35.  end
clone this paste RAW Paste Data