Thread Tools Display Modes
11-30-10, 11:26 PM   #1
Thevolget
A Deviate Faerie Dragon
Join Date: Jul 2009
Posts: 11
Need help updating a old addon

I've come to like the addon Autograts since it helps with making it seem like i'm taking the time to congratulate my guild members when they level. The problem is, the addon was broken after 4.0.1's removal of the "this, arg1, arg2, argX". I've been trying to repair the addon into a working state, however all of the fixes that I know of aren't working. I'm not asking for someone here to rewrite it, but if anyone can glance over and let me know what i'm needing to correct (quite possibly alot) so I can get the addon working again.

autograts.xml
Code:
<Ui xsi:schemaLocation="http://www.blizzard.com/wow/ui/">
	<Script file="autograts.lua"/>
	<Frame name="AGFrame">
		<Scripts>
			<OnLoad>
				AG_OnLoad();
			</OnLoad>
			<OnEvent> 
				AG_OnEvent(event);
			</OnEvent>
		</Scripts>
	</Frame>
</Ui>
autograts.lua
The code was too long to put in the post, it's at the link below
Code:
http://pastebin.com/VymEwrqg
  Reply With Quote
12-01-10, 02:55 AM   #2
Duugu
Premium Member
 
Duugu's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 851
Any errors?

Change
Code:
AG_OnEvent(event)
into
Code:
AG_OnEvent(event, arg1, arg2, arg3)
and
Code:
AG_OnLoad()
into
Code:
AG_OnLoad(self)
in both files

Last edited by Duugu : 12-01-10 at 02:58 AM.
  Reply With Quote
12-01-10, 12:40 PM   #3
Thevolget
A Deviate Faerie Dragon
Join Date: Jul 2009
Posts: 11
Well that fixed the loading issue, now it loads but it triggers an LUA error whenever someone talks in guild chat (due to the registering of CHAT_MSG_GUILD). Seems to now be passing a "nil" value into the string.gsub(m,"%p+","")
  Reply With Quote
12-01-10, 12:51 PM   #4
Dridzt
A Pyroguard Emberseer
 
Dridzt's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2005
Posts: 1,360
Lua:
Code:
function AG_OnEvent(self, event, ...)
        local arg1, arg2, arg3 = ...
        if (event == "VARIABLES_LOADED")then AG_Init();
        elseif (AGenabled and event == "CHAT_MSG_GUILD" ) then AG_GuildText(arg1, arg2, arg3);
        elseif (event == "GUILD_ROSTER_UPDATE")then AG_GotRoster();
        end
        if (AGtimer) then
                AG_CheckDelayedMsg();
        end
end
Xml:
Code:
<OnEvent> 
	AG_OnEvent(self, event, ...);
</OnEvent>
  Reply With Quote
12-01-10, 01:40 PM   #5
Thevolget
A Deviate Faerie Dragon
Join Date: Jul 2009
Posts: 11
Smile

I can't say how much i appreciate the help guys, it seems to be functioning fine now.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Need help updating a old addon


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