Remove Advertisements

ThatJustHappened: Combat Event Announcement Mod

All things /script related

Moderators: Fridmarr, Worldie, Aergis, _Chloe

Re: ThatJustHappened: Combat Event Announcement Mod

Postby Pyched » Mon Oct 18, 2010 11:30 am

I am quite useless when it comes to understanding code. If it's not too inconvenient, please let me know exactly where I add each of those lines in the Lua and xml files. Alternatively, it might just be easier for me to wait for the edited files to be made available. Any help will be appreciated!
Pyched
 
Posts: 4
Joined: Mon Oct 18, 2010 11:10 am

Re: ThatJustHappened: Combat Event Announcement Mod

Postby Echaa » Mon Oct 18, 2010 5:52 pm

Pyched wrote:I am quite useless when it comes to understanding code. If it's not too inconvenient, please let me know exactly where I add each of those lines in the Lua and xml files. Alternatively, it might just be easier for me to wait for the edited files to be made available. Any help will be appreciated!

I'm in the same boat, unfortunately ctrl+f and copy/paste can only do so much. I wasn't able to find half of the arg# segments and I had no idea what to do for the preceding steps.
Echaa
 
Posts: 61
Joined: Wed Jun 04, 2008 10:24 pm

Re: ThatJustHappened: Combat Event Announcement Mod

Postby fuzzygeek » Mon Oct 18, 2010 6:47 pm

You'll need a text editor, such as notepad. Notepad2 is even better, since it'll support line numbers and stuff.

In ThatJustHappened.xml:

Line 7 looks like:
Code: Select all
this:SetOwner(UIParent, "ANCHOR_NONE");

Change it to:
Code: Select all
self:SetOwner(UIParent, "ANCHOR_NONE");


Lines 12-17 look like:
Code: Select all
   <Frame name="ThatJustHappened" visible="true" parent="UIParent">
      <Scripts>
         <OnLoad>TJH_OnLoad();</OnLoad>
         <OnEvent>TJH_OnEvent(this, event, ...);</OnEvent>
      </Scripts>
   </Frame>

You'll want to change lines 14 and 15 to read:
Code: Select all
         <OnLoad>TJH_OnLoad(self);</OnLoad>
         <OnEvent>TJH_OnEvent(self, event, ...);</OnEvent>


Line 273
Code: Select all
EasyMenu(TJHevent_menuList, this, "TJH_RuleEventBox", 245, 245);

change to:
Code: Select all
EasyMenu(TJHevent_menuList, self, "TJH_RuleEventBox", 245, 245);


Line 598
Code: Select all
EasyMenu(TJHclass_menuList, this, "TJH_RuleAffiliationBox", 170, 50);

change to:
Code: Select all
EasyMenu(TJHclass_menuList, self, "TJH_RuleAffiliationBox", 170, 50);


Line 1648
Code: Select all
this:RegisterForDrag("LeftButton");

change to:
Code: Select all
self:RegisterForDrag("LeftButton");


Line 1675-1676
Code: Select all
<OnDragStart>this:StartMoving();this.isMoving = true;</OnDragStart>
<OnDragStop>this:StopMovingOrSizing();this.isMoving = false;</OnDragStop>

change to:
Code: Select all
<OnDragStart>self:StartMoving();self.isMoving = true;</OnDragStart>
<OnDragStop>self:StopMovingOrSizing();self.isMoving = false;</OnDragStop>


Save the file, close it.

Open the ThatJustHappened.lua file.

Line 108
Code: Select all
function TJH_OnLoad()

change to:
Code: Select all
function TJH_OnLoad(frame)


Lines 114-115
Code: Select all
   this:RegisterEvent("VARIABLES_LOADED");
   this:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED");

change to:
Code: Select all
   frame:RegisterEvent("VARIABLES_LOADED");
   frame:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED");


Line 143:
Code: Select all
this:UnregisterEvent("COMBAT_LOG_EVENT_UNFILTERED");

change to:
Code: Select all
self:UnregisterEvent("COMBAT_LOG_EVENT_UNFILTERED");


Line 191
Code: Select all
function TJH_OnEvent(event, ...)

change to
Code: Select all
function TJH_OnEvent(frame, event, ...)


Look for lines 208 to 213. Looks like this:
Code: Select all
   if arg2 == nil then arg2 = ""; end
   if arg4 == nil then arg4 = ""; end
   if arg7 == nil then arg7 = ""; end
   if arg9 == nil then arg9 = ""; end
   if arg10 == nil then arg10 = ""; end
   if arg12 == nil then arg12 = ""; end


Insert these lines IN FRONT OF this block so it looks like:
Code: Select all
   if (select(2, ...) ~= nil) then arg2 = select(2, ...); end
   if (select(4, ...) ~= nil) then arg4 = select(4, ...); end
   if (select(5, ...) ~= nil) then arg5 = select(5, ...); end
   if (select(7, ...) ~= nil) then arg7 = select(7, ...); end
   if (select(8, ...) ~= nil) then arg8 = select(8, ...); end
   if (select(9, ...) ~= nil) then arg9 = select(9, ...); end
   if (select(10, ...) ~= nil) then arg10 = select(10, ...); end
   if (select(11, ...) ~= nil) then arg11 = select(11, ...); end
   if (select(12, ...) ~= nil) then arg12 = select(12, ...); end

   if arg2 == nil then arg2 = ""; end
   if arg4 == nil then arg4 = ""; end
   if arg7 == nil then arg7 = ""; end
   if arg9 == nil then arg9 = ""; end
   if arg10 == nil then arg10 = ""; end
   if arg12 == nil then arg12 = ""; end


Do a search-and-replace for: this:GetID()
Replace it with: self:GetID()

There should be 49 occurances.

Save the file.

And you should be good to go.
Last edited by fuzzygeek on Mon Nov 08, 2010 10:01 am, edited 2 times in total.
Image
User avatar
fuzzygeek
Maintankadonor
 
Posts: 5130
Joined: Wed Aug 01, 2007 1:58 pm

Re: ThatJustHappened: Combat Event Announcement Mod

Postby Echaa » Tue Oct 19, 2010 12:30 am

I went through everything you suggested and the game doesn't recognize /tjh as a command.

I initially tried to follow Dukka's instructions and didn't get it to work so I tried restoring my backup xml/lua files. After using your guide and it failing to register, I deleted and reinstalled it and followed the steps you gave again to no avail. One thing that looked suspicious is the line 9-10 suggestion, it looked to me like the lines you said to paste in were already there. I'm also a little confused on how to do the lua lines 208-213.

Right now my lua file looks like
Code: Select all
   208 if (select(2, ...) ~= nil) then arg2 = select(2, ...); end
   209 if (select(4, ...) ~= nil) then arg4 = select(4, ...); end
   210 if (select(5, ...) ~= nil) then arg5 = select(5, ...); end
   211 if (select(7, ...) ~= nil) then arg7 = select(7, ...); end
   212 if (select(8, ...) ~= nil) then arg8 = select(8, ...); end
   213 if (select(9, ...) ~= nil) then arg9 = select(9, ...); end
   214 if (select(10, ...) ~= nil) then arg10 = select(10, ...); end
   215 if (select(11, ...) ~= nil) then arg11 = select(11, ...); end
   216 if (select(12, ...) ~= nil) then arg12 = select(12, ...); end
   217
   218 if arg2 == nil then arg2 = ""; end
   219 if arg4 == nil then arg4 = ""; end
   220 if arg7 == nil then arg7 = ""; end
   221 if arg9 == nil then arg9 = ""; end
   222 if arg10 == nil then arg10 = ""; end
   223 if arg12 == nil then arg12 = ""; end

Is this correct? I'm not sure if I should put the new lines in front of
Code: Select all
if arg2 == nil then arg2 = ""; end
or above it.
I'm wondering if its
Code: Select all
if (select(2, ...) ~= nil) then arg2 = select(2, ...); end if arg2 == nil then arg2 = ""; end
ect..
or
Code: Select all
    if (select(2, ...) ~= nil) then arg2 = select(2, ...); end
    if (select(4, ...) ~= nil) then arg4 = select(4, ...); end
     ect...

    if arg2 == nil then arg2 = ""; end
    if arg4 == nil then arg4 = ""; end
    ...
Echaa
 
Posts: 61
Joined: Wed Jun 04, 2008 10:24 pm

Re: ThatJustHappened: Combat Event Announcement Mod

Postby fuzzygeek » Tue Oct 19, 2010 12:59 am

Echaa wrote:I went through everything you suggested and the game doesn't recognize /tjh as a command.

I initially tried to follow Dukka's instructions and didn't get it to work so I tried restoring my backup xml/lua files. After using your guide and it failing to register, I deleted and reinstalled it and followed the steps you gave again to no avail. One thing that looked suspicious is the line 9-10 suggestion, it looked to me like the lines you said to paste in were already there. I'm also a little confused on how to do the lua lines 208-213.


Line 9&10 add "self" references.

<OnLoad>TJH_OnLoad(self);</OnLoad>
<OnEvent>TJH_OnEvent(self, event, ...);</OnEvent>


You've pasted the lines in correctly, with 208-216 being "if (select(2, ...) ~= nil) then arg2 = select(2, ...); end" etc, and 218 etc being the existing block.
Image
User avatar
fuzzygeek
Maintankadonor
 
Posts: 5130
Joined: Wed Aug 01, 2007 1:58 pm

Re: ThatJustHappened: Combat Event Announcement Mod

Postby Echaa » Tue Oct 19, 2010 2:43 am

fuzzygeek wrote:
Echaa wrote:I went through everything you suggested and the game doesn't recognize /tjh as a command.

I initially tried to follow Dukka's instructions and didn't get it to work so I tried restoring my backup xml/lua files. After using your guide and it failing to register, I deleted and reinstalled it and followed the steps you gave again to no avail. One thing that looked suspicious is the line 9-10 suggestion, it looked to me like the lines you said to paste in were already there. I'm also a little confused on how to do the lua lines 208-213.


Line 9&10 add "self" references.

<OnLoad>TJH_OnLoad(self);</OnLoad>
<OnEvent>TJH_OnEvent(self, event, ...);</OnEvent>


You've pasted the lines in correctly, with 208-216 being "if (select(2, ...) ~= nil) then arg2 = select(2, ...); end" etc, and 218 etc being the existing block.


My XML line 9-10 are:
Code: Select all
</Scripts>
</GameTooltip>


Reading Notepad(regular) was absolutely impossible so I got Notepad2, which I'm assuming is what you're using. I'm not seeing the lines you mention anywhere near 9 or 10. I know nothing about programming but I've got a hinting suspicion that removing the text on those two lines will break some scripts seeing as <Scripts> and <OnLoad> appear on lines 5 and 6 respectively followed by line 7, "this:SetOwner(UIParent, "ANCHOR_NONE");".
Echaa
 
Posts: 61
Joined: Wed Jun 04, 2008 10:24 pm

Re: ThatJustHappened: Combat Event Announcement Mod

Postby fuzzygeek » Tue Oct 19, 2010 8:11 am

What about references to TJH_Onload?

Are you using the file currently posted on Curse? The snippets posted were done on a fresh download last night.
Image
User avatar
fuzzygeek
Maintankadonor
 
Posts: 5130
Joined: Wed Aug 01, 2007 1:58 pm

Re: ThatJustHappened: Combat Event Announcement Mod

Postby Echaa » Tue Oct 19, 2010 8:21 am

fuzzygeek wrote:What about references to TJH_Onload?

Are you using the file currently posted on Curse? The snippets posted were done on a fresh download last night.

Yes, I'm using 3.0.5.2 from the Curse updater. I opened my XML file and
Code: Select all
<OnLoad>TJH_OnLoad();</OnLoad>
<OnEvent>TJH_OnEvent(this, event, ...);</OnEvent>

popped right out at me, though they're on lines 14 and 15. I changed them to:
Code: Select all
<OnLoad>TJH_OnLoad(self);</OnLoad>
<OnEvent>TJH_OnEvent(self, event, ...);</OnEvent>

I'll test it out again when the server comes up.

Does what line they're on have any bearing at all on what their function is?
Echaa
 
Posts: 61
Joined: Wed Jun 04, 2008 10:24 pm

Re: ThatJustHappened: Combat Event Announcement Mod

Postby tobinbereznak » Tue Oct 19, 2010 10:16 am

Fuzzy could you make your ThatJustHappened.xml and ThatJustHappened.lua files available somewhere? If not I'll just make the changes given in this post. Of all the addons I've used, I miss this one the most :cry:
Penji on Mal'Ganis
tobinbereznak
 
Posts: 3
Joined: Thu Nov 19, 2009 11:11 am

Re: ThatJustHappened: Combat Event Announcement Mod

Postby fuzzygeek » Tue Oct 19, 2010 10:34 am

Echaa wrote:Does what line they're on have any bearing at all on what their function is?


No. Line numbers are just a guide to help find the code. You can ignore the line numbers entirely as long as you update the references.

If the mod author doesn't update it in the next couple weeks I'll post a fork or something; I don't know what the convention is for continuing an abandoned project on wowinterface etc.
Image
User avatar
fuzzygeek
Maintankadonor
 
Posts: 5130
Joined: Wed Aug 01, 2007 1:58 pm

Re: ThatJustHappened: Combat Event Announcement Mod

Postby Echaa » Tue Oct 19, 2010 12:02 pm

fuzzygeek wrote:
Echaa wrote:Does what line they're on have any bearing at all on what their function is?


No. Line numbers are just a guide to help find the code. You can ignore the line numbers entirely as long as you update the references.

If the mod author doesn't update it in the next couple weeks I'll post a fork or something; I don't know what the convention is for continuing an abandoned project on wowinterface etc.

All in all, I had to delete and reinstall the mod and go through those steps at least 5 times but it works now, thanks for all the help fuzzy.

I do have a question on the rules though - I'm trying to make a "this persons taunt failed" rule and the *Source and *Target options aren't working. I'm using crusader strike because its more easily spammable to test with than hand of reckoning is.

SPELL_MISSED;;;Crusader Strike;;SELF;*Source's CRUSADER STRIKE FAILED ON *Target

It may be worth mentioning that *s/*t/%s/%t don't work either, though I'm not sure if they're even supposed to.
Echaa
 
Posts: 61
Joined: Wed Jun 04, 2008 10:24 pm

Re: ThatJustHappened: Combat Event Announcement Mod

Postby Pyched » Tue Oct 19, 2010 9:24 pm

After following Fuzzygeek's instructions and making a few corrections,I was able to run the mod with no problems during the raid today. Thank you so much!

fuzzygeek wrote:
Lines 12-17 look like:
Code: Select all
   <Frame name="ThatJustHappened" visible="true" parent="UIParent">
      <Scripts>
         <OnLoad>TJH_OnLoad();</OnLoad>
         <OnEvent>TJH_OnEvent(this, event, ...);</OnEvent>
      </Scripts>
   </Frame>

You'll want to change lines 9 and 10 to read:
Code: Select all
         <OnLoad>TJH_OnLoad(self);</OnLoad>
         <OnEvent>TJH_OnEvent(self, event, ...);</OnEvent>



I think that those lines were actually 14 and 15, not 9 and 10.

fuzzygeek wrote:Do a search-and-replace for: this:GetID()
Replace it with: self.GetID()

There should be 49 occurances.
And you should be good to go.


I had to change this:GetID() to self:GetID() instead in order to get the addon to work.

Once again, thank you for typing out those instructions. I don't think I would have managed to figure it out on my own. Hopefully, other people that want to get this addon back in working shape will have similar success.
Pyched
 
Posts: 4
Joined: Mon Oct 18, 2010 11:10 am

Re: ThatJustHappened: Combat Event Announcement Mod

Postby fuzzygeek » Wed Oct 20, 2010 9:43 am

I was having problems last night with TJH announcing stacks and a few other things. I don't know if it's a function of the new version or old; I don't use the new features in 3.0.5 so I've regressed to 3.0.1 -- haven't had a chance to test it yet, but if the problem persists I'll go back to 3.0.5 and see if I can't fix the problem.
Image
User avatar
fuzzygeek
Maintankadonor
 
Posts: 5130
Joined: Wed Aug 01, 2007 1:58 pm

Re: ThatJustHappened: Combat Event Announcement Mod

Postby wobina » Sat Oct 23, 2010 2:58 pm

Thank you so much Dukka and Fuzzy and whoever else has helped me to make this amazing addon work again. I really encourage you guys to post this to Curse so the masses can benefit from your hard work, as it seems the author will no longer be supporting it.
wobina
 
Posts: 1
Joined: Sat Oct 23, 2010 2:56 pm

Re: ThatJustHappened: Combat Event Announcement Mod

Postby xlos » Sun Nov 07, 2010 1:43 pm

Couldnt find it to work, but in the end (and more better readin) this was a great tip

had to change this:GetID() to self:GetID() instead in order to get the addon to work.


edit: I give up, I get rid of all the errors, but I can't get it to display some info :<

If somebody could send me their working version, Pm me :(
xlos
 
Posts: 20
Joined: Sun Aug 31, 2008 11:36 pm

PreviousNext

Return to Add-ons, UI, and Macros

Who is online

Users browsing this forum: Bing [Bot] and 1 guest


Remove Advertisements

Who is online

In total there are 2 users online :: 1 registered, 0 hidden and 1 guest (based on users active over the past 5 minutes)
Most users ever online was 380 on Tue Oct 14, 2008 6:28 pm

Users browsing this forum: Bing [Bot] and 1 guest