MaienM
09-03-2008, 10:55 AM
Okay, this is probaly an very obvious problem, but it 'aint workin.
This is my code, but the messageframe isn't even showing up.
The frame show up, but without any sign of a messageframe.
The frame isn't closing when I press ESC, like it's supposed to do.
And the slash commands aren't working either.
It probally are small mistakes or something, but it ain't workin as it's now.
local frame = CreateFrame("Frame", "TGMT");
frame:SetWidth(600);
frame:SetHeight(600);
frame:SetPoint("CENTER", UIParent, "CENTER");
frame:SetBackdrop({bgFile = "Interface/DialogFrame/UI-DialogBox-Background",
edgeFile = "Interface/Tooltips/UI-Tooltip-Border",
tile = true, tileSize = 16, edgeSize = 16,
insets = { left = 4, right = 4, top = 4, bottom = 4 }});
frame:SetScript("OnEvent", TGMT_OnEvent);
frame:SetScript("OnLoad", TGMT_OnLoad);
frame:RegisterEvent("GUILDBANKFRAME_OPENED");
frame:RegisterEvent("GUILDBANKLOG_UPDATE");
local payed = CreateFrame("MessageFrame", "TGMT_Payed", frame);
payed:SetWidth(550);
payed:SetHeight(550);
payed:SetPoint("TOPLEFT", frame, "TOPLEFT", 25, 25);
payed:SetInsertMode("TOP");
payed:SetFading(false);
function TMGT_OnLoad()
SLASH_TGMT1 = "/tgmt";
SLASH_TGMT2 = "/payed";
SLASH_TGMT3 = "/taxes";
SlashCmdList["TGMT"] = TGMT_Show();
tinsert(UISpecialFrames,"frame");
end
function TGMT_Show()
frame:Show();
payed:Show();
payed:Clear();
TGMT_CheckPayments();
end
function TGMT_OnEvent()
if (event=="GUILDBANKFRAME_OPENED") then
QueryGuildBankLog(MAX_GUILDBANK_TABS+1);
end
if (event=="GUILDBANKLOG_UPDATE") then
TGMT_GuildBankCheck();
end
end
function TGMT_GuildBankCheck()
local lType, lUser, lAmount = GetGuildBankMoneyTransaction(1);
if (lUser~=lastUser) and (lAmount~=lastAmount) and (lType~=lastType) then
nName = "";
nAmount = "";
nType = "";
num = 1;
count = 1;
while (nName~=lastName) and (nAmount~=lastAmount) and (nType~=lastType) do
nType, nName, nAmount = GetGuildBankMoneyTransaction(num);
num = num + 1
count = count + 1
end
num = 1;
while (count~=0) do
local trans, name, amount = GetGuildBankMoneyTransaction(num);
if (trans=="deposit") then
GuildRoster();
SortGuildRoster("rank");
num2 = 1;
name2 = "";
while(name2~=name) do
name2 = GetGuildRosterInfo(num2);
num2 = num2 + 1;
end
rank = GetGuildRosterInfo(num2);
if (rank=="Silver Manster") and (amount>9999) then
GuildRosterSetOfficerNote("Payed");
end
if (rank=="Golden Manster") and (amount>19999) then
GuildRosterSetOfficerNote("Payed");
end
end
count = count - 1;
num = num + 1;
end
lastType, lastUser, lastAmount = GetGuildBankMoneyTransaction(1);
end
end
function TGMT_CheckPayments()
GuildRoster();
SortGuildRoster("rank");
count2 = 1;
num3 = GetNumGuildMembers(true);
while (count2~=num3) do
local name = GetGuildRosterInfo(count2);
local rank = GetGuildRosterInfo(count2);
local officernote = GetGuildRosterInfo(count2);
if ((rank=="Silver Manster") or (rank=="Golden Manster")) and (officernote~="Payed") then
payed:AddMessage(name);
end
count2 = count2 + 1;
end
end
If someone could help me with this, that would be greatly appreciated.
T.I.A.
Greetz MaienM
This is my code, but the messageframe isn't even showing up.
The frame show up, but without any sign of a messageframe.
The frame isn't closing when I press ESC, like it's supposed to do.
And the slash commands aren't working either.
It probally are small mistakes or something, but it ain't workin as it's now.
local frame = CreateFrame("Frame", "TGMT");
frame:SetWidth(600);
frame:SetHeight(600);
frame:SetPoint("CENTER", UIParent, "CENTER");
frame:SetBackdrop({bgFile = "Interface/DialogFrame/UI-DialogBox-Background",
edgeFile = "Interface/Tooltips/UI-Tooltip-Border",
tile = true, tileSize = 16, edgeSize = 16,
insets = { left = 4, right = 4, top = 4, bottom = 4 }});
frame:SetScript("OnEvent", TGMT_OnEvent);
frame:SetScript("OnLoad", TGMT_OnLoad);
frame:RegisterEvent("GUILDBANKFRAME_OPENED");
frame:RegisterEvent("GUILDBANKLOG_UPDATE");
local payed = CreateFrame("MessageFrame", "TGMT_Payed", frame);
payed:SetWidth(550);
payed:SetHeight(550);
payed:SetPoint("TOPLEFT", frame, "TOPLEFT", 25, 25);
payed:SetInsertMode("TOP");
payed:SetFading(false);
function TMGT_OnLoad()
SLASH_TGMT1 = "/tgmt";
SLASH_TGMT2 = "/payed";
SLASH_TGMT3 = "/taxes";
SlashCmdList["TGMT"] = TGMT_Show();
tinsert(UISpecialFrames,"frame");
end
function TGMT_Show()
frame:Show();
payed:Show();
payed:Clear();
TGMT_CheckPayments();
end
function TGMT_OnEvent()
if (event=="GUILDBANKFRAME_OPENED") then
QueryGuildBankLog(MAX_GUILDBANK_TABS+1);
end
if (event=="GUILDBANKLOG_UPDATE") then
TGMT_GuildBankCheck();
end
end
function TGMT_GuildBankCheck()
local lType, lUser, lAmount = GetGuildBankMoneyTransaction(1);
if (lUser~=lastUser) and (lAmount~=lastAmount) and (lType~=lastType) then
nName = "";
nAmount = "";
nType = "";
num = 1;
count = 1;
while (nName~=lastName) and (nAmount~=lastAmount) and (nType~=lastType) do
nType, nName, nAmount = GetGuildBankMoneyTransaction(num);
num = num + 1
count = count + 1
end
num = 1;
while (count~=0) do
local trans, name, amount = GetGuildBankMoneyTransaction(num);
if (trans=="deposit") then
GuildRoster();
SortGuildRoster("rank");
num2 = 1;
name2 = "";
while(name2~=name) do
name2 = GetGuildRosterInfo(num2);
num2 = num2 + 1;
end
rank = GetGuildRosterInfo(num2);
if (rank=="Silver Manster") and (amount>9999) then
GuildRosterSetOfficerNote("Payed");
end
if (rank=="Golden Manster") and (amount>19999) then
GuildRosterSetOfficerNote("Payed");
end
end
count = count - 1;
num = num + 1;
end
lastType, lastUser, lastAmount = GetGuildBankMoneyTransaction(1);
end
end
function TGMT_CheckPayments()
GuildRoster();
SortGuildRoster("rank");
count2 = 1;
num3 = GetNumGuildMembers(true);
while (count2~=num3) do
local name = GetGuildRosterInfo(count2);
local rank = GetGuildRosterInfo(count2);
local officernote = GetGuildRosterInfo(count2);
if ((rank=="Silver Manster") or (rank=="Golden Manster")) and (officernote~="Payed") then
payed:AddMessage(name);
end
count2 = count2 + 1;
end
end
If someone could help me with this, that would be greatly appreciated.
T.I.A.
Greetz MaienM