function Max_Msg(msg)
if( DEFAULT_CHAT_FRAME ) then
DEFAULT_CHAT_FRAME:AddMessage(msg);
end
end
function Max_OnLoad()
this:RegisterEvent("VARIABLES_LOADED");
SLASH_MaxCMD1 = "/Max";
SlashCmdList["MaxCMD"] = Max_Command;
end
function Max_Command(param1)
NumFacts = table.getn( Facts );
RNum = math.random( NumFacts );
Quote = Facts[RNum];
local start, finish, command, value = string.find(param1, "(%w+) (%w+)");
if (string.lower(param1) == "say") or (string.lower(param1) == "yell") or (string.lower(param1) == "party") or (string.lower(param1) == "guild") or (string.lower(param1) == "raid") or (string.lower(param1) == "officer") then
SendChatMessage(Quote, param1, this.language);
elseif (string.lower(param1) == "1") or (string.lower(param1) == "2") or (string.lower(param1) == "3") or (string.lower(param1) == "4") or (string.lower(param1) == "5") or (string.lower(param1) == "6") or (string.lower(param1) == "7") or (string.lower(param1) == "8") or (string.lower(param1) == "9") then
local MyChannel = GetChannelName(param1);
if (MyChannel ~= nil) then
SendChatMessage(Quote, "CHANNEL", this.language, MyChannel);
end
elseif (command ~=nil and string.lower(command) == "whisper") then
if (value ~=nil) then
SendChatMessage(Quote, "WHISPER", this.language, value);
elseif (value == nil) then
Max_Msg("|cffffff00 blabla");
end
else
Max_Usage();
end
end
Ok But How i can tell the Addon to Post the Randomfacts in Bigwigs i have no Idea -.-
A question my leader has few quotations of Max Paine or sm...
Now I wanted to write a Addon it permitted with a MinimapButton quotations random in the
Raidwarn Frame to write.
But I do not deduce like I Bigwigs in addition bring to make
Ideas?
PS: Sry 4 my Bad English :)
thanks erhm...got it now i think !
The Code is now :
local RNum = 0;
local Quote = "";
function Max_Msg(msg)
if( DEFAULT_CHAT_FRAME ) then
DEFAULT_CHAT_FRAME:AddMessage(msg);
end
end
function Max_OnLoad()
this:RegisterEvent("VARIABLES_LOADED");
SLASH_MaxCMD1 = "/Max";
SlashCmdList["MaxCMD"] = Max_Command;
end
function Max_Command(param1)
NumFacts = table.getn( Facts );
RNum = math.random( NumFacts );
Quote = Facts[RNum];
local start, finish, command, value = string.find(param1, "(%w+) (%w+)");
if (string.lower(param1) == "say") or (string.lower(param1) == "yell") or (string.lower(param1) == "party") or (string.lower(param1) == "guild") or (string.lower(param1) == "raid") or (string.lower(param1) == "officer") then
SendChatMessage(Quote, param1, this.language);
elseif (string.lower(param1) == "1") or (string.lower(param1) == "2") or (string.lower(param1) == "3") or (string.lower(param1) == "4") or (string.lower(param1) == "5") or (string.lower(param1) == "6") or (string.lower(param1) == "7") or (string.lower(param1) == "8") or (string.lower(param1) == "9") then
local MyChannel = GetChannelName(param1);
if (MyChannel ~= nil) then
SendChatMessage(Quote, "CHANNEL", this.language, MyChannel);
end
elseif (command ~=nil and string.lower(command) == "whisper") then
if (value ~=nil) then
SendChatMessage(Quote, "WHISPER", this.language, value);
elseif (value == nil) then
Max_Msg("|cffffff00 blabla");
end
else
Max_Usage();
end
end
Ok But How i can tell the Addon to Post the Randomfacts in Bigwigs i have no Idea -.-
BigWigs:TriggerEvent("BigWigs_ThrottleSync", "Quote", 5)
BigWigs:TriggerEvent("BigWigs_SendSync", "Quote " .. Quote)
self:RegisterEvent("BigWigs_RecvSync")
function myAddon:BigWigs_RecvSync(sync, rest, nick)
if sync == "Quote" and rest then
BigWigs:TriggerEvent("BigWigs_Message", rest, "Red")
end
end
i try ur Stuff !
Ty Rabbit :)
Bugsack says =>
[2007/01/08 22:05:05-162-x1]: Max-2.00\Max.lua:66: attempt to index global 'self' (a nil value)
*mäh*
Thx 4 your Time Rabbit ! I appreciate that :)
Any idea where i can find a lil help to ace my addon? :)
:)