Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[function ToggleAddon()
- print("Toggle Addon function was called");
- end
- function ShowMinimap()
- GameTooltip:SetOwner(this, "ANCHOR_LEFT");
- GameTooltip:AddLine( "|cFF00FF00Dunno what to call this yet|r" );
- GameTooltip:AddLine( "|cFF00FFCCLeft click to show/hide|r" );
- GameTooltip:AddLine( "|cFFFF0000Right click to drag this|r" );
- GameTooltip:Show();
- end]]
- -- creating data structure
- SwDi = { };
- --testing purposes only, cos im to lazy to press enter and the dot key and enter again after every /reload
- --SendChatMessage(".", "SAY", nil, nil)
- --Initilization for popups
- function SwDi:initDropdowns(player)
- --Create our dropdown for the unitpopup.
- --Create our menu and submenu buttons.
- UnitPopupButtons["SWDIKICKBAN"] = {text = "|cFF00FFFFKick/Ban", dist = 0, nested = 1, tooltipText = "|cFF00FFFFShows commands for kicking, banning, or muting the selected player."};
- UnitPopupButtons["SWDIPORT"] = {text = "|cFF00FFFFPort", dist = 0, nested = 1, tooltipText = "|cFF00FFFFShows commands for porting, appearing, or summoning the selected player."};
- UnitPopupButtons["PLAYERCONTROL"] = {text = "|cFF00FFFFPlayer Control", dist = 0, nested = 1, tooltipText = "|cFF00FFFFShows commands for Freezing, Unfreezing, Player Info and Resurrection"};
- UnitPopupButtons["MAIL"] = {text = "|cFF00FFFFMail", dist = 0, nested = 1, tooltipText = "|cFF00FFFFAllows you to send mail to an offline player addressing their issue."};
- ----Create all the dropdown menu buttons for our menus and submenus.
- --KickBan submenu
- UnitPopupButtons["SWDIKICK"] = {text = "|cFF00FFFFKick", dist = 0, checkable = nil};
- UnitPopupButtons["SWDIABAN"] = {text = "|cFF00FFFFAccount Ban", dist = 0, checkable = nil};
- UnitPopupButtons["SWDIIBAN"] = {text = "|cFF00FFFFIP Ban", dist = 0, checkable = nil};
- UnitPopupButtons["SWDIMUTE"] = {text = "|cFF00FFFFMute", dist = 0, checkable = nil};
- --Port submenu
- --UnitPopupButtons["SWDIPORTWIN"] = {text = "|cFF00FFFFPort", dist = 0, checkable = nil};
- UnitPopupButtons["SWDIAPPEAR"] = {text = "|cFF00FFFFAppear", dist = 0, checkable = nil};
- UnitPopupButtons["SWDISUMMON"] = {text = "|cFF00FFFFSummon", dist = 0, checkable = nil};
- UnitPopupButtons["RECALL"] = {text = "|cFF00FFFFRecall", dist = 0, checkable = nil};
- --Base menu buttons
- UnitPopupButtons["SWDIREVIVE"] = {text = "|cFF00FFFFResurrect", dist = 0, tooltipText = "|cFF00FFFFInstantly resurrects the selected player."};
- UnitPopupButtons["FREEZE"] = {text = "|cFF00FFFFFreeze", dist = 0, tooltipText = "|cFF00FFFFClick to Freeze the selected player."};
- UnitPopupButtons["UNFREEZE"] = {text = "|cFF00FFFFUnfreeze", dist = 0, tooltipText = "|cFF00FFFFClick to Unfreeze the selected player."};
- UnitPopupButtons["PINFO"] = {text = "|cFF00FFFFPlayer Info", dist = 0, tooltipText = "|cFF00FFFFClick to Unfreeze the selected player."};
- UnitPopupButtons["RENAME"] = {text = "|cFF00FFFFRename", dist = 0, tooltipText = "|cFF00FFFFClick to Unfreeze the selected player."};
- --Blue cancel button
- UnitPopupButtons["SWDICANCEL"] = {text = "|cFF00FFFFCancel", dist = 0, notCheckable = nil};
- --Mail Submenu
- UnitPopupButtons["MakeNewTicket"] = {text = "|cFF00FFFFMake new ticket", dist = 0, tooltipText = "|cFF00FFFFClick to send mail the selected player."};
- UnitPopupButtons["VoteShop"] = {text = "|cFF00FFFFVote Shop", dist = 0, tooltipText = "|cFF00FFFFClick to send mail the selected player."};
- UnitPopupButtons["LostItems"] = {text = "|cFF00FFFFLost Items", dist = 0, tooltipText = "|cFF00FFFFClick to send mail the selected player."};
- UnitPopupButtons["Quests"] = {text = "|cFF00FFFFQuests", dist = 0, tooltipText = "|cFF00FFFFClick to send mail the selected player."};
- UnitPopupButtons["BugTracker"] = {text = "|cFF00FFFFBug Tracker", dist = 0, tooltipText = "|cFF00FFFFClick to send mail the selected player."};
- UnitPopupButtons["CantHelp"] = {text = "|cFF00FFFFCan't Help", dist = 0, tooltipText = "|cFF00FFFFClick to send mail the selected player."};
- UnitPopupButtons["KnownIssue"] = {text = "|cFF00FFFFKnown Issue", dist = 0, tooltipText = "|cFF00FFFFClick to send mail the selected player."};
- UnitPopupButtons["PremiumSupport"] = {text = "|cFF00FFFFPremium Support", dist = 0, tooltipText = "|cFF00FFFFClick to send mail the selected player."};
- UnitPopupButtons["Paymentat"] = {text = "|cFF00FFFFPayment@", dist = 0, tooltipText = "|cFF00FFFFClick to send mail the selected player."};
- --insert our first dropdown button (which is a nested dropdown) into PLAYER (the target right-click menu) and FRIEND (the chat rightclick menu)
- tinsert(UnitPopupMenus["FRIEND"], #UnitPopupMenus["FRIEND"] - 1, "SWDIKICKBAN");
- tinsert(UnitPopupMenus["FRIEND"], #UnitPopupMenus["FRIEND"] - 1, "SWDIPORT");
- tinsert(UnitPopupMenus["FRIEND"], #UnitPopupMenus["FRIEND"] - 1, "PLAYERCONTROL");
- tinsert(UnitPopupMenus["FRIEND"], #UnitPopupMenus["FRIEND"] - 1, "MAIL");
- --tinsert(UnitPopupMenus["FRIEND"], #UnitPopupMenus["FRIEND"] - 1, "SWDIREVIVE");
- --[[ tinsert(UnitPopupMenus["PLAYER"], #UnitPopupMenus["PLAYER"] - 1, "SWDIKICKBAN");
- tinsert(UnitPopupMenus["PLAYER"], #UnitPopupMenus["PLAYER"] - 1, "SWDIPORT");
- tinsert(UnitPopupMenus["PLAYER"], #UnitPopupMenus["PLAYER"] - 1, "PLAYERCONTROL");
- tinsert(UnitPopupMenus["PLAYER"], #UnitPopupMenus["PLAYER"] - 1, "PLAYERCONTROL");]]--
- --create our dropdown menus and submenus, with our buttons as children of our menus.
- UnitPopupMenus["SWDIKICKBAN"] = {"SWDIABAN", "SWDIIBAN", "SWDIKICK", "SWDIMUTE", "SWDICANCEL"};
- UnitPopupMenus["SWDIPORT"] = { "SWDIAPPEAR", "RECALL", "SWDISUMMON", "SWDICANCEL"};
- UnitPopupMenus["PLAYERCONTROL"] = {"FREEZE", "RENAME", "PINFO", "SWDIREVIVE", "UNFREEZE", "SWDICANCEL"};
- UnitPopupMenus["MAIL"] = {"MakeNewTicket", "VoteShop", "LostItems", "Quests", "BugTracker", "CantHelp", "KnownIssue", "PremiumSupport", "Paymentat"};
- hooksecurefunc("UnitPopup_OnClick", function() SwDi:UnitPopup_OnClick(); end);
- end
- --send all commands through guild chat, so we are certain they are sent.
- function say(msg)
- SendChatMessage(msg, "GUILD", nil, nil)
- end
- function SwDi:UnitPopup_OnClick(self, player, name)
- name = UIDROPDOWNMENU_INIT_MENU.name
- local button = this.value;
- if(button == "SWDIREVIVE") then
- say(".revive " ..name)
- print("\124cff00B4FF\124Hitem:19:0:0:0:0:0:0:0\124h Player: \124h\124r \124cffffff00\124Hitem:19:0:0:0:0:0:0:0\124h'"..name.."'\124h\124r \124cff00B4FF\124Hitem:19:0:0:0:0:0:0:0\124h has been resurrected, " ..UnitName("player").. ".\124h\124r");
- elseif (button == "SWDIKICK") then
- say(".kick " ..name)
- elseif (button == "SWDIABAN") then
- StaticPopup_Show("BANFORREAL")
- elseif (button == "SWDIIBAN") then
- GetPlayerip(name)
- say(".pinfo " ..name)
- elseif (button == "FREEZE") then
- say(".freeze " ..name)
- elseif (button == "UNFREEZE") then
- say(".unfreeze " ..name)
- elseif (button == "RECALL") then
- say(".recall " ..name)
- elseif (button == "SWDIAPPEAR") then
- say(".appear " ..name)
- elseif (button == "SWDISUMMON") then
- say(".summon " ..name)
- elseif (button == "SWDIMUTE") then
- StaticPopup_Show("MUTEFORREAL")
- elseif (button == "PINFO") then
- say(".pinfo " ..name)
- elseif (button == "RENAME") then
- say(".char rename " ..name)
- say(".kick " ..name)
- elseif (button == "MakeNewTicket") then
- say(".send mail " ..name.. " \"RE: Your Ticket\" \"Hello, " ..name.. ". I can assist you with your ticket, but I need you to be online to do so. Please make a new ticket and remain online so I can assist you. Regards, Game Master " ..UnitName("player").. ".")
- print("\124cff00B4FF\124Hitem:19:0:0:0:0:0:0:0\124hMail to Player: \124h\124r \124cffffff00\124Hitem:19:0:0:0:0:0:0:0\124h'"..name.."'\124h\124r \124cff00B4FF\124Hitem:19:0:0:0:0:0:0:0\124h has been sent, " ..UnitName("player").. ". (New Ticket)\124h\124r");
- elseif (button == "VoteShop") then
- say(".send mail " ..name.. " \"RE: Your Ticket\" \"Hello, " ..name.. ". Unfortunately there is nothing that I can do to assist you with this issue. Vote Shop items are non refundable and are not eligible for support. Regards, Game Master " ..UnitName("player").. ".")
- print("\124cff00B4FF\124Hitem:19:0:0:0:0:0:0:0\124hMail to Player: \124h\124r \124cffffff00\124Hitem:19:0:0:0:0:0:0:0\124h'"..name.."'\124h\124r \124cff00B4FF\124Hitem:19:0:0:0:0:0:0:0\124h has been sent, " ..UnitName("player").. ". (Vote Shop)\124h\124r");
- elseif (button == "LostItems") then
- say(".send mail " ..name.. " \"RE: Your Ticket\" \"Hello, " ..name.. ". Sadly I cannot help you with your issue. If your item was purchased with Molten Coins then you can create a premium support ticket on the website. Regards, GM " ..UnitName("player").. ".")
- print("\124cff00B4FF\124Hitem:19:0:0:0:0:0:0:0\124hMail to Player: \124h\124r \124cffffff00\124Hitem:19:0:0:0:0:0:0:0\124h'"..name.."'\124h\124r \124cff00B4FF\124Hitem:19:0:0:0:0:0:0:0\124h has been sent, " ..UnitName("player").. ". (Lost Items)\124h\124r");
- elseif (button == "Quests") then
- say(".send mail " ..name.. " \"RE: Your Ticket\" \"Hello, " ..name.. ". Unfortunately there is nothing that I can do to assist you with this issue. Game Masters can not help you with non-class related quests. Regards, Game Master " ..UnitName("player").. ".")
- print("\124cff00B4FF\124Hitem:19:0:0:0:0:0:0:0\124hMail to Player: \124h\124r \124cffffff00\124Hitem:19:0:0:0:0:0:0:0\124h'"..name.."'\124h\124r \124cff00B4FF\124Hitem:19:0:0:0:0:0:0:0\124h has been sent, " ..UnitName("player").. ". (Quests)\124h\124r");
- elseif (button == "BugTracker") then
- say(".send mail " ..name.. " \"RE: Your Ticket\" \"Hello, " ..name.. ". Please submit a Bug Report on the Bug Tracker. Regards, Game Master " ..UnitName("player").. ".")
- print("\124cff00B4FF\124Hitem:19:0:0:0:0:0:0:0\124hMail to Player: \124h\124r \124cffffff00\124Hitem:19:0:0:0:0:0:0:0\124h'"..name.."'\124h\124r \124cff00B4FF\124Hitem:19:0:0:0:0:0:0:0\124h has been sent, " ..UnitName("player").. ". (Bug Tracker)\124h\124r");
- elseif (button == "CantHelp") then
- say(".send mail " ..name.. " \"RE: Your Ticket\" \"Hello, " ..name.. ". Unfortunately there is nothing I can do to assist you with this issue. Regards, Game Master " ..UnitName("player").. ".")
- print("\124cff00B4FF\124Hitem:19:0:0:0:0:0:0:0\124hMail to Player: \124h\124r \124cffffff00\124Hitem:19:0:0:0:0:0:0:0\124h'"..name.."'\124h\124r \124cff00B4FF\124Hitem:19:0:0:0:0:0:0:0\124h has been sent, " ..UnitName("player").. ". (Cant Help)\124h\124r");
- elseif (button == "KnownIssue") then
- say(".send mail " ..name.. " \"RE: Your Ticket\" \"Hello, " ..name.. ". That is a well known issue, please remain patient while the Developers work to resolve it. Regards, Game Master " ..UnitName("player").. ".")
- print("\124cff00B4FF\124Hitem:19:0:0:0:0:0:0:0\124hMail to Player: \124h\124r \124cffffff00\124Hitem:19:0:0:0:0:0:0:0\124h'"..name.."'\124h\124r \124cff00B4FF\124Hitem:19:0:0:0:0:0:0:0\124h has been sent, " ..UnitName("player").. ". (Known Issue)\124h\124r");
- elseif (button == "PremiumSupport") then
- say(".send mail " ..name.. " \"RE: Your Ticket\" \"Hello, " ..name.. ". Please log on to the website and create a premium support ticket. Game Masters can not help with donation related issues. Regards, Game Master " ..UnitName("player").. ".")
- print("\124cff00B4FF\124Hitem:19:0:0:0:0:0:0:0\124hMail to Player: \124h\124r \124cffffff00\124Hitem:19:0:0:0:0:0:0:0\124h'"..name.."'\124h\124r \124cff00B4FF\124Hitem:19:0:0:0:0:0:0:0\124h has been sent, " ..UnitName("player").. ". (Premium Support)\124h\124r");
- elseif (button == "Paymentat") then
- say(".send mail " ..name.. " \"RE: Your Ticket\" \"Hello, " ..name.. ". Please send an email to Payment@molten-wow.com. Game Masters can not help with donation related issues. Regards, Game Master " ..UnitName("player").. ".")
- print("\124cff00B4FF\124Hitem:19:0:0:0:0:0:0:0\124hMail to Player: \124h\124r \124cffffff00\124Hitem:19:0:0:0:0:0:0:0\124h'"..name.."'\124h\124r \124cff00B4FF\124Hitem:19:0:0:0:0:0:0:0\124h has been sent, " ..UnitName("player").. ". (Payment@)\124h\124r");
- end
- end
- --Getplayerip
- function GetPlayerip(self, name)
- if not ipFrame then
- ipFrame = CreateFrame("Frame")
- end
- local frame = ipFrame
- frame:RegisterEvent("CHAT_MSG_SYSTEM")
- frame:SetScript("OnEvent", function(self, event, ...)
- local system_msg = select(1, ...)
- if (system_msg:find("%u:%s%d(.*).%d(.*)%s%u%l%l%l%s") ~= nil) then
- local found = string.sub(system_msg, string.find(system_msg, "%u:%s%d(.*).%d(.*)%s%u%l%l%l%s", 2))
- ipsysmsg = string.sub(found, string.find(found, "%d(.*).(.*).(.*).(.*)%d"))
- frame:UnregisterEvent("CHAT_MSG_SYSTEM")
- StaticPopup_Show("IPBANFORREAL")
- end
- end
- )
- end
- SwDi:initDropdowns();
- --Confirmation popups.
- StaticPopupDialogs["IPBANFORREAL"] = { }
- StaticPopupDialogs["IPBANFORREAL"] = {
- text = "Syntax is Time(30m for 30 minutes) then reason. The IP Address is not needed it will be supplied. Example: 30m Spam",
- button1 = "Yes",
- button2 = "No",
- hasEditBox = true,
- showAlert = true,
- OnAccept = function (self, name)
- local ip = ipsysmsg
- print(ip)
- local text = self.editBox:GetText()
- if (text ~= "") then
- name = UIDROPDOWNMENU_INIT_MENU.name
- print(name)
- say(".ban ip " ..ip.. " " ..text)
- say(".ban char " ..name.. " " ..text)
- end
- end,
- sound = "GM_ChatWarning",
- timeout = 30,
- whileDead = true,
- hideOnEscape = true,
- }
- StaticPopupDialogs["MUTEFORREAL"] = { }
- StaticPopupDialogs["MUTEFORREAL"] = {
- text = "Syntax is Time(30m for 30 minutes) then reason. The character is not needed it will be supplied. Example: 30m Spam",
- button1 = "Yes",
- button2 = "No",
- hasEditBox = true,
- showAlert = true,
- OnAccept = function (self, name)
- local name = UIDROPDOWNMENU_INIT_MENU.name
- local text = self.editBox:GetText()
- if (text ~= "") then
- say(".mute " ..name.. " " ..text)
- end
- end,
- sound = "GM_ChatWarning",
- timeout = 30,
- whileDead = true,
- hideOnEscape = true,
- }
- StaticPopupDialogs["BANFORREAL"] = { }
- StaticPopupDialogs["BANFORREAL"] = {
- text = "Syntax is Time(30m for 30 minutes) then reason. The character is not needed it will be supplied. Example: 30m Spam",
- button1 = "Yes",
- button2 = "No",
- hasEditBox = true,
- showAlert = true,
- OnAccept = function (self, name)
- local name = UIDROPDOWNMENU_INIT_MENU.name
- local text = self.editBox:GetText()
- if (text ~= "") then
- say(".ban char " ..name.. " " ..text)
- end
- end,
- sound = "GM_ChatWarning",
- timeout = 30,
- whileDead = true,
- hideOnEscape = true,
- }
- StaticPopupDialogs["SendMail"] = { }
- StaticPopupDialogs["SendMail"] = {
- text = "Example: \"RE: Your Ticket\" \"This is the content\"",
- button1 = "Yes",
- button2 = "No",
- hasEditBox = true,
- showAlert = true,
- OnAccept = function (self, name)
- local name = UIDROPDOWNMENU_INIT_MENU.name
- local text = self.editBox:GetText()
- if (text ~= "") then
- say(".send mail " ..name.. " " ..text)
- end
- end,
- sound = "GM_ChatWarning",
- timeout = 60,
- whileDead = true,
- hideOnEscape = true,
- }
- -- This will clear the list of people frozen on the realm.
- frozen = "on"
- Frozen = { }
- function ListFreeze()
- say(".listfreeze")
- if not freezeFrame then
- freezeFrame = CreateFrame("Frame")
- end
- local frame = freezeFrame
- frame:RegisterEvent("CHAT_MSG_SYSTEM")
- frame:SetScript("OnEvent", function(self, event, ...)
- local system_msg = select(1, ...)
- if (system_msg:find(" -%s%u") ~= nil) then
- found = string.sub(system_msg, string.find(system_msg, "%u(.*)", 2))
- tinsert(Frozen, found)
- frozen = #Frozen
- --frame:UnregisterEvent("CHAT_MSG_SYSTEM")
- StaticPopup_Show("UnfreezeAll")
- end
- end
- )
- end
- StaticPopupDialogs["UnfreezeAll"] = { }
- StaticPopupDialogs["UnfreezeAll"] = {
- text = "Are you sure you want to unfreeze all?",
- button1 = "Yes",
- button2 = "No",
- hasEditBox = false,
- showAlert = true,
- OnAccept = function (self, name)
- local name = UIDROPDOWNMENU_INIT_MENU.name
- if (text ~= "") then
- freezeFrame:UnregisterEvent("CHAT_MSG_SYSTEM")
- UnfreezeAll()
- end
- end,
- sound = "GM_ChatWarning",
- timeout = 60,
- whileDead = true,
- hideOnEscape = true,
- }
- function UnfreezeAll()
- for i,v in ipairs(Frozen) do say(".unfreeze " ..v)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement