Ok so here's the full code.
lfg.lua
Lua Code:
-- Author : adamz
-- Create Date : 5/20/2017 2:16:57 PM
function OnLoad()
Main:Show();
local line = Main:CreateTexture()
line:SetTexture(.6 ,.6, .6, .4)
line:SetSize(170, 1)
line:SetPoint("TOP", 0,-207.5)
end
function MinimapButton_OnClick()
if not Main:IsVisible() then
Main:Show();
else
Main:Hide();
end
end
SLASH_LFGSHOW1 = '/lfg';
function SlashCmdList.LFGSHOW()
Main:Show();
end
-- RAID SETTINGS --
raids = {'Naxxramas','Vault of Archavon','Obsidian Sanctum','Ulduar','The Eye of Eternity','Trial of the Crusader','Onyxia\'s Lair','Icecrown Citadel','Ruby Sanctum'}
raid_values ={'naxx','voa','os','uldu','eoe','toc','onyxia','icc','rs'}
local raid;
local raidSize =10;
local tank =2;
local heal = 2;
local dps = 6;
local dropDown = CreateFrame("Frame", "raidDrop", Main, "UIDropDownMenuTemplate")
dropDown:SetPoint("TOPLEFT",0,0)
UIDropDownMenu_SetWidth(dropDown, 80)
UIDropDownMenu_SetText(dropDown,raid)
UIDropDownMenu_Initialize(dropDown, function(self, level, menuList)
local info = UIDropDownMenu_CreateInfo()
for i=1,9 do
info.text, info.arg1, info.checked = raids[i], raid_values[i], false
info.func = self.SetValue
UIDropDownMenu_AddButton(info)
end
end)
function dropDown:SetValue(newValue)
raid = newValue
UIDropDownMenu_SetText(dropDown,raid)
CloseDropDownMenus()
end
function updateCount()
tankCount:SetText(tostring(tank));
healCount:SetText(tostring(heal));
dpsCount:SetText(tostring(dps));
end
function Button10_OnClick()
raidSize = 10;
tank = 2;
heal = 2;
dps = 6;
updateCount();
end
function Button25_OnClick()
raidSize = 25;
tank = 2;
heal = 5;
dps = 17;
updateCount();
end
function tankMinus_OnClick()
tank = tank -1;
updateCount();
end
function tankPlus_OnClick()
tank = tank +1;
updateCount();
end
function healMinus_OnClick()
heal = heal -1;
updateCount();
end
function healPlus_OnClick()
heal = heal +1;
updateCount();
end
function dpsMinus_OnClick()
dps = dps -1;
updateCount();
end
function dpsPlus_OnClick()
dps = dps +1;
updateCount();
end
function sendButton_OnClick()
msg = dropDown:GetValue() .. raidSize .. 'need ' .. tank .. 'x tank, ' .. heal .. 'x heal' .. 'x dps' .. '';
SendChatMessage(msg,"CHANNEL", DEFAULT_CHAT_FRAME.editBox.languageID, GetChannelName(channel:GetText()));
end
lfg.xml
Code:
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Script file="lfg.lua" />
<Frame name="Main" movable="true" enableMouse="true">
<Size x="200" y="325" />
<Anchors>
<Anchor point="CENTER" x="0" y="0" />
</Anchors>
<Backdrop bgFile="Interface\DialogFrame\UI-DialogBox-Background" edgeFile="Interface\DialogFrame\UI-DialogBox-Border" tile="true">
<BackgroundInsets>
<AbsInset left="10" right="10" top="10" bottom="10" />
</BackgroundInsets>
<TileSize>
<AbsValue val="32" />
</TileSize>
<EdgeSize>
<AbsValue val="32" />
</EdgeSize>
</Backdrop>
<Layers>
<Layer level="OVERLAY">
<FontString inherits="GameFontNormalSmall" text="Raid">
<Anchors>
<Anchor point="TOPLEFT" x="20" y="-20" />
</Anchors>
</FontString>
<FontString inherits="GameFontNormalSmall" text="Tank">
<FontHeight val="10"/>
<Anchors>
<Anchor point="TOPLEFT" x="20" y="-60" />
</Anchors>
</FontString>
<FontString inherits="GameFontNormalSmall" text="Heal">
<Anchors>
<Anchor point="TOPLEFT" x="20" y="-80" />
</Anchors>
</FontString>
<FontString inherits="GameFontNormalSmall" text="Dps">
<Anchors>
<Anchor point="TOPLEFT" x="20" y="-100" />
</Anchors>
</FontString>
<FontString inherits="GameFontNormalSmall" text="Min GS">
<Anchors>
<Anchor point="TOPLEFT" x="20" y="-160" />
</Anchors>
</FontString>
<FontString inherits="GameFontNormalSmall" text="Info">
<Anchors>
<Anchor point="TOPLEFT" x="20" y="-180" />
</Anchors>
</FontString>
<FontString inherits="GameFontNormalSmall" text="Teamspeak">
<Anchors>
<Anchor point="TOPLEFT" x="20" y="-140" />
</Anchors>
</FontString>
<FontString inherits="GameFontNormalSmall" text="Channel name">
<Anchors>
<Anchor point="TOPLEFT" x="20" y="-220" />
</Anchors>
</FontString>
<FontString inherits="GameFontNormalSmall" text="Auto send">
<Anchors>
<Anchor point="TOPLEFT" x="20" y="-240" />
</Anchors>
</FontString>
<FontString inherits="GameFontNormalSmall" text="Msg delay">
<Anchors>
<Anchor point="TOPLEFT" x="20" y="-260" />
</Anchors>
</FontString>
</Layer>
</Layers>
<Frames>
<Button name="10_Button" inherits="UIPanelButtonTemplate" text="10">
<Size x="30" y="15" /> <NormalFont style="GameFontNormalSmall"/>
<Anchors>
<Anchor point="TOPLEFT" x="100" y="-40" />
</Anchors>
<Scripts>
<OnClick>
Button10_OnClick()
</OnClick>
</Scripts>
</Button>
<Button name="25_Button" inherits="UIPanelButtonTemplate" text="25">
<Size x="30" y="15" />
<NormalFont style="GameFontNormalSmall"/>
<Anchors>
<Anchor point="TOPLEFT" x="140" y="-40" />
</Anchors>
<Scripts>
<OnClick>
Button25_OnClick()
</OnClick>
</Scripts>
</Button>
<Button name="tankMinus" inherits="UIPanelButtonTemplate" text="-">
<Size x="15" y="15" />
<Anchors>
<Anchor point="TOPLEFT" x="100" y="-60" />
</Anchors>
<Scripts>
<OnClick>
tankMinus_OnClick()
</OnClick>
</Scripts>
</Button>
<Button name="tankPlus" inherits="UIPanelButtonTemplate" text="+">
<Size x="15" y="15" />
<Anchors>
<Anchor point="TOPLEFT" x="160" y="-60" />
</Anchors>
<Scripts>
<OnClick>
tankPlus_OnClick()
</OnClick>
</Scripts>
</Button>
<Button name="healMinus" inherits="UIPanelButtonTemplate" text="-">
<Size x="15" y="15" />
<Anchors>
<Anchor point="TOPLEFT" x="100" y="-80" />
</Anchors>
<Scripts>
<OnClick>
healMinus_OnClick()
</OnClick>
</Scripts>
</Button>
<Button name="healPlus" inherits="UIPanelButtonTemplate" text="+">
<Size x="15" y="15" />
<Anchors>
<Anchor point="TOPLEFT" x="160" y="-80" />
</Anchors>
<Scripts>
<OnClick>
healPlus_OnClick()
</OnClick>
</Scripts>
</Button>
<Button name="dpsMinus" inherits="UIPanelButtonTemplate" text="-">
<Size x="15" y="15" />
<Anchors>
<Anchor point="TOPLEFT" x="100" y="-100" />
</Anchors>
<Scripts>
<OnClick>
dpsMinus_OnClick()
</OnClick>
</Scripts>
</Button>
<Button name="dpsPlus" inherits="UIPanelButtonTemplate" text="+">
<Size x="15" y="15" />
<Anchors>
<Anchor point="TOPLEFT" x="160" y="-100" />
</Anchors>
<Scripts>
<OnClick>
dpsPlus_OnClick()
</OnClick>
</Scripts>
</Button>
<Button name="closeButton" inherits="UIPanelButtonTemplate" text="Close">
<Size x="80" y="20" /> <NormalFont style="GameFontNormalSmall"/>
<Anchors>
<Anchor point="TOPLEFT" x="100" y="-290" />
</Anchors>
<Scripts>
<OnClick>
MinimapButton_OnClick()
</OnClick>
</Scripts>
</Button>
<Button name="sendButton" inherits="UIPanelButtonTemplate" text="Send">
<Size x="80" y="20" /> <NormalFont style="GameFontNormalSmall"/>
<Anchors>
<Anchor point="TOPLEFT" x="20" y="-290" />
</Anchors>
<Scripts>
<OnClick>
sendButton_OnClick();
</OnClick>
</Scripts>
</Button>
<EditBox name="tankCount" autoFocus="false" inherits="InputBoxTemplate">
<Size x="20" y="20" />
<Anchors>
<Anchor point="TOPLEFT" x="130" y="-57.5" />
</Anchors>
</EditBox>
<EditBox name="healCount" autoFocus="false" inherits="InputBoxTemplate">
<Size x="20" y="20" />
<Anchors>
<Anchor point="TOPLEFT" x="130" y="-77.5" />
</Anchors>
</EditBox>
<EditBox name="dpsCount" autoFocus="false" inherits="InputBoxTemplate">
<Size x="20" y="20" />
<Anchors>
<Anchor point="TOPLEFT" x="130" y="-97.5" />
</Anchors>
</EditBox>
<EditBox name="delay" autoFocus="false" inherits="InputBoxTemplate">
<Size x="20" y="20" />
<Anchors>
<Anchor point="TOPLEFT" x="130" y="-257.5" />
</Anchors>
</EditBox>
<EditBox name="gs" autoFocus="false" inherits="InputBoxTemplate">
<Size x="40" y="20" />
<Anchors>
<Anchor point="TOPLEFT" x="120" y="-157.5" />
</Anchors>
</EditBox>
<EditBox name="info" autoFocus="false" inherits="InputBoxTemplate">
<Size x="80" y="20" />
<Anchors>
<Anchor point="TOPLEFT" x="100" y="-177.5" />
</Anchors>
</EditBox>
<EditBox name="channel" autoFocus="false" inherits="InputBoxTemplate">
<Size x="80" y="20" />
<Anchors>
<Anchor point="TOPLEFT" x="100" y="-217.5" />
</Anchors>
</EditBox>
<CheckButton name="teamspeakCheck" inherits="UICheckButtonTemplate" id="1">
<Size x="20" y="20" />
<Anchors>
<Anchor point="TOPLEFT" x="127.5" y="-137.5" />
</Anchors>
</CheckButton>
<CheckButton name="autosendCheck" inherits="UICheckButtonTemplate" id="2">
<Size x="20" y="20" />
<Anchors>
<Anchor point="TOPLEFT" x="127.5" y="-237.5" />
</Anchors>
</CheckButton>
</Frames>
<Scripts>
<OnLoad>
tinsert(UISpecialFrames, self:GetName());
OnLoad();
self:RegisterForDrag("LeftButton");
tankCount:SetScript("OnEscapePressed", function(self)
self:ClearFocus()
end)
healCount:SetScript("OnEscapePressed", function(self)
self:ClearFocus()
end)
dpsCount:SetScript("OnEscapePressed", function(self)
self:ClearFocus()
end)
</OnLoad>
<OnDragStart>
self:StartMoving();
</OnDragStart>
<OnDragStop>
self:StopMovingOrSizing();
</OnDragStop>
</Scripts>
</Frame>
<Button name="MinimapButton" parent="Minimap" movable="true" enableMouse="true">
<Size>
<AbsDimension x="33" y="33" />
</Size>
<Anchors>
<Anchor point="TOPLEFT" />
</Anchors>
<Layers>
<Layer level="BACKGROUND">
<Texture name="MyMod_MinimapButton_Icon" file="Interface\Icons\INV_Misc_QuestionMark">
<Size>
<AbsDimension x="21" y="21" />
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="7" y="-6" />
</Offset>
</Anchor>
</Anchors>
</Texture>
</Layer>
<Layer level="OVERLAY">
<Texture file="Interface\Minimap\MiniMap-TrackingBorder">
<Size>
<AbsDimension x="56" y="56" />
</Size>
<Anchors>
<Anchor point="TOPLEFT" />
</Anchors>
</Texture>
</Layer>
</Layers>
<Scripts>
<OnLoad>
this:RegisterForClicks("LeftButtonUp","RightButtonUp")
</OnLoad>
<OnClick>
MinimapButton_OnClick()
</OnClick>
</Scripts>
<HighlightTexture file="Interface\Minimap\UI-Minimap-ZoomButton-Highlight" alphaMode="ADD" />
</Button>
</Ui>
That's it.
Sorry if this is some basic stuff I'm missing, I just started learning lua today.