Thread Tools Display Modes
11-17-10, 02:59 PM   #1
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Also, you don't need this:
Code:
function InitRrr() 

	DEFAULT_CHAT_FRAME:AddMessage("|c00FF0000Rrr |cFF00FF01loaded.\nTalk like a |c00FF0000rovare!"); 
	
	rrr_toggle = true;
	
	SLASH_RRRTOGGLE = "/rrr";
	SlashCmdList["RRRTOGGLE"] = rrrToggle;
	
end
It's never called from anywhere, for one, and even if you did call it, the "/rrr" command still wouldn't do anything because no function "rrrToggle" is defined. Plus, nobody likes addons that spam "hey, this addon you just installed and enabled is loaded!" at login.
  Reply With Quote
11-17-10, 04:28 PM   #2
Dzib
A Deviate Faerie Dragon
Join Date: Nov 2010
Posts: 16
Originally Posted by Phanx View Post
Also, you don't need this:
Code:
function InitRrr() 

	DEFAULT_CHAT_FRAME:AddMessage("|c00FF0000Rrr |cFF00FF01loaded.\nTalk like a |c00FF0000rovare!"); 
	
	rrr_toggle = true;
	
	SLASH_RRRTOGGLE = "/rrr";
	SlashCmdList["RRRTOGGLE"] = rrrToggle;
	
end
It's never called from anywhere, for one, and even if you did call it, the "/rrr" command still wouldn't do anything because no function "rrrToggle" is defined. Plus, nobody likes addons that spam "hey, this addon you just installed and enabled is loaded!" at login.
Ok, but I called function Initrrr in rrr.xml:

Code:
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/
..\FrameXML\UI.xsd">

	<Frame name="Rrr" parent="UIParent" hidden="true">
		<Scripts>
			<OnLoad>
				InitRrr();
			</OnLoad>
		</Scripts>
	</Frame>
	
</Ui>
  Reply With Quote
11-17-10, 10:09 PM   #3
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
But you don't have a function called rrrToggle - aren't you getting a nil error there?
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
11-18-10, 01:27 AM   #4
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
You don't get an error by setting something to nil; only if you then try to do something with the nil something.

But, nothing in your InitRrr function has any purpose, so you should just get rid of it (and get rid of the similarly useless XML file).
  Reply With Quote
11-18-10, 02:48 AM   #5
Dzib
A Deviate Faerie Dragon
Join Date: Nov 2010
Posts: 16
But I need an xml file, no? so what should be in it?
  Reply With Quote
11-18-10, 10:15 AM   #6
Xubera
A Cobalt Mageweaver
 
Xubera's Avatar
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 207
actually, you dont need an XML fille, you dont even need a frame. You dont listen for any events and you dont need any sort of timer. The only thing you need is a .toc and that .lua that phanx posted and it works.
__________________
Chat Consolidate is the solution to any out of control trade chat. Ignore lines, throttle chat, consolidate posts!Follow the link to find out how!

▲ ▲ WoWInterface wont let me triforce >.>
  Reply With Quote
11-18-10, 11:58 AM   #7
Dzib
A Deviate Faerie Dragon
Join Date: Nov 2010
Posts: 16
Doesnt work for me....
  Reply With Quote
11-18-10, 04:39 PM   #8
Xubera
A Cobalt Mageweaver
 
Xubera's Avatar
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 207
post your .toc and your .lua file

you could just copy and paste it, but put the toc and lua in different [code] tags.
__________________
Chat Consolidate is the solution to any out of control trade chat. Ignore lines, throttle chat, consolidate posts!Follow the link to find out how!

▲ ▲ WoWInterface wont let me triforce >.>
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Transforming an existing addon

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off