Saturday, April 14, 2012

my addon not being found...

[:1]I am trying to make a very simple addon that when you logs on it auto-joins a channel and then prints a message that tells you that you are in that channel.

First I made a macro that does what I want but I do not think that there is a way to run the macro when you log on so I made a lua file and put this in to it...


Code:
print ("/join ......")
print ("You are now Chatting in The ...... chat channel.")

Simple as that...then I saved it as a lua file in a folder inside that addon folder. When I load the game and look in my addons it is not in there. So what am I missing? Why can the game not find the "addon"?



also would it be better to change the print to "DEFAULT_CHAT_FRAME:AddMessage"|||is the .toc file name the same as the folder name?|||That is the problem I do not have a toc file. Now when I look at my list of addons it is in that list but it said that it is incompatible.

I have a addon folder called test and in that is a test.toc and test.lua. The test.toc has this...


Code:
test.lua

and the test.lua has this...


Code:
print("/join testchannel01")
print("you are in the test channel 01 now.")

What am I missing now?|||Code:
## Interface: 30000 <---- this is the current version of the game
## Title: Test <----- Name of Mod
## Notes: Test does xxx <------- what does the mod do?
## Author: XXXXX <----------- Who is it bye
test.xml
test.lua

for a more in depth explanation go here|||thank you. do I have to have a xml file? If so then for a simple mod like this what would one put in that XML file?|||xmls are not needed only got graphics :D (im pretty sure atleast).|||Quote:








thank you. do I have to have a xml file? If so then for a simple mod like this what would one put in that XML file?




No you do not need an XML file for that addon.

The code you have there, assuming you can call 'Print' because it is defined in another addon, is still not going to do very much.

What I think you want is this:


Code:
local MyChannel = "YourChannelName"

JoinChannelByName(MyChannel)
DEFAULT_CHAT_FRAME:AddMessage("You are in "..MyChannel.." now",1,1,1)

If you want to list all channels, you could retrieve them with


Code:
for i=1,10,1 do
local id..i, name..i = GetChannelName(i)
if (name..i) then
local MyChannel = name..i


DEFAULT_CHAT_FRAME:AddMessage("You are in "..MyChannel.." now",1,1,1)


end
end
|||Quote:









Code:
local MyChannel = "YourChannelName"

JoinChannelByName(MyChannel)
DEFAULT_CHAT_FRAME:AddMessage("You are in "..MyChannel.." now",1,1,1)








Ok, that makes since to me except for the end part ",1,1,1". What is that for?|||hey Bangerz you gonna upload your BANG mods here?|||Thanks for the help people this works now. Now to the next feature.

No comments:

Post a Comment