View Single Post
05-25-10, 05:54 PM   #10
numein
A Cyclonian
 
numein's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2009
Posts: 43
I'm not too familiar with Lua yet, but if I understood what you want to do with your addon, this should do it (I only changed your slash command, the rest of the code can stay as is):
Code:
...

SlashCmdList["SaveRaidMembers_SlashCommand"] = function(str)
	if (str == 'delete') then
		KRAHLog_raidmembers = {}
		print('|cff00aaff<krahlog> Data deleted.|r')
	elseif (str == 'save') then
		klog()
		print('|cff00aaff<krahlog> Data saved.|r')
	else
		print('<krahlog> To save current data type: /klog save')
		print('<krahlog> To delete all saved data type: /klog delete')
	end
end
SLASH_SaveRaidMembers_SlashCommand1 = "/klog"
If u type /klog in chat it will just print you a message to use /klog save, /klog delete.
On /klog save it will call your klog() function to save the data, and print out a msg in chat that it's saved.
On /klog delete it will empty the table in SavedVars.

Hope it helps.
  Reply With Quote