Bug: $char(buff,"Buff Name")

A forum for feature requests/discussions and user submitted patches that improve MQ2

Moderator: MacroQuest Developers

kagonis
a hill giant
a hill giant
Posts: 228
Joined: Sat May 24, 2003 8:48 pm

Bug: $char(buff,"Buff Name")

Post by kagonis » Wed Jun 04, 2003 3:45 pm

When calling that it crashes EQ to desktop.

Amadeus
The Maestro
The Maestro
Posts: 2036
Joined: Sat Jun 29, 2002 3:51 pm

Post by Amadeus » Wed Jun 04, 2003 6:08 pm

Can you give me an example macro with 'echo' output for me to test it?

I'll look into it then.

kagonis
a hill giant
a hill giant
Posts: 228
Joined: Sat May 24, 2003 8:48 pm

Post by kagonis » Wed Jun 04, 2003 10:19 pm

Well..
I merely tried to test it by running a simple /echo within EQ. Ie:

/echo $char(buff,"Blessing of Reverence")

Wich in turn should tell me what buffslot it is in, or that it isnt on me, but it just crashed eqclient..

Was testing it to find out exactly how it worked, to make a macro to keep buffs up on me at all times, by alerting me when a buff is no longer on me etc.

User avatar
ap50
a snow griffon
a snow griffon
Posts: 425
Joined: Sun Aug 18, 2002 2:29 pm

Post by ap50 » Thu Jun 05, 2003 8:20 am

Got a horse up at the time ?
[color=yellow][size=92][b]Just because you're paranoid, it doesn't mean everyone isn't out to get you![/b][/size][/color]

Plazmic
The One
The One
Posts: 800
Joined: Fri Jun 14, 2002 12:31 am
Contact:

Post by Plazmic » Sun Jun 08, 2003 4:55 am

buff window stuff will blow up... It current checks for 0xFFFFFFFF as "no spell in that slot", just like gem and book do.
The problem is, buff should actually be checking against 0xFFFF.

The crash is then caused by GetSpellNameById having a local define of szUnknown.

So, change all 0xFFFFFFFF's to 0xFFFF inside the $char(buff,xxx) handler, and remove the local szUnknown from GetSpellNameById (and for extra clarity, rename the global on to szUnknownSpell)
- Plazmic

kagonis
a hill giant
a hill giant
Posts: 228
Joined: Sat May 24, 2003 8:48 pm

Post by kagonis » Sat Jun 14, 2003 4:57 am

I'm not very thrilled about messing directly in the source, since I honestly donøt know anything about the C++ programming language.

Is this something that is going to be changed in CVS, so it will work for everyone? Or do I have to slap myself hard and actually risk having some fun messing up the sources on my own? :p

I do a compile of latest CVS daily, so if the change has reached CVS Iøm pretty sure I am using that version.

$char(buff,xxx) still crashes me however, so perhaps I will try and do more than simple scripting :) I might just learn something, can't have that ;)

Mckorr
Developer
Developer
Posts: 2326
Joined: Fri Oct 18, 2002 1:16 pm
Location: Texas

Post by Mckorr » Sat Jun 14, 2003 10:14 am

Hey Plaz, how about making those changes in the CVS for us :)
MQ2: Think of it as Evolution in action.

Plazmic
The One
The One
Posts: 800
Joined: Fri Jun 14, 2002 12:31 am
Contact:

Post by Plazmic » Sat Jun 14, 2003 11:58 pm

If I made a CVS change, people would think I was working on MQ again ;)

I do have a real contribution coming up that will help people diagnose bad macros, and fix some crashes related to badly written macros.

Any of these small random tidbits will get checked in then if they aren't in CVS yet.
- Plazmic

Amadeus
The Maestro
The Maestro
Posts: 2036
Joined: Sat Jun 29, 2002 3:51 pm

Post by Amadeus » Sun Jun 15, 2003 12:12 am

I also have some stuff sent into DKAA right now that will fix a couple things.

Plazmic
The One
The One
Posts: 800
Joined: Fri Jun 14, 2002 12:31 am
Contact:

Post by Plazmic » Sun Jun 15, 2003 12:37 am

I'm mostly concerned about finding out what went wrong if the macro 'sucks'...
My patch consists of changing all error spew and EndMacro(pChar,"")'s into a GracefullyEndBadMacro that will dump the calling stack of the macro up to that point including source file and line number from the script.
- Plazmic

icon
Official loudmouth
Official loudmouth
Posts: 158
Joined: Fri Jun 14, 2002 2:59 pm
Location: ...
Contact:

Post by icon » Mon Jun 16, 2003 3:52 pm

Whoa, Plazmic!? Who's that?

Forgive me if I'm wrong but isn't the dev named "Plazmic" just a myth?

Somebody pinch me!

- Icon
In memory of [b][color=darkblue]MasTerKeyZ[/b][/color].

kagonis
a hill giant
a hill giant
Posts: 228
Joined: Sat May 24, 2003 8:48 pm

Post by kagonis » Mon Jun 16, 2003 4:17 pm

Back to the buff thing, Plaz, to your post:
Could you give me some hints where to make the suggested changes?
What file I need to open, what string I need to find, and edit?

Would really love to have that working since I could really use a simple macro to keep an eye on my buffs (I tend to forget to look) then warn me when a buff is either fading or has faded.

Thanks in advance :)

wassup
Official Guardian and Writer of TFM
Official Guardian and Writer of TFM
Posts: 1487
Joined: Sat Oct 26, 2002 5:15 pm

Post by wassup » Mon Jun 16, 2003 5:36 pm

kagonis wrote:Well..
I merely tried to test it by running a simple /echo within EQ. Ie:

/echo $char(buff,"Blessing of Reverence")

Wich in turn should tell me what buffslot it is in, or that it isnt on me, but it just crashed eqclient..

Was testing it to find out exactly how it worked, to make a macro to keep buffs up on me at all times, by alerting me when a buff is no longer on me etc.
I tried this today and it also made the client crash to desktop.

Was not on a horse or drogmor.

kagonis
a hill giant
a hill giant
Posts: 228
Joined: Sat May 24, 2003 8:48 pm

Post by kagonis » Wed Jun 18, 2003 8:26 pm

Would really love to get a macro put together that reminds me at all times when a buff is no longer one me. I am too forgetfull to remember to check for those buffs myself :)

So, the solution suggested, is the easy implemented or something? :)

Amadeus
The Maestro
The Maestro
Posts: 2036
Joined: Sat Jun 29, 2002 3:51 pm

Post by Amadeus » Wed Jun 18, 2003 11:10 pm

This bug was caused by me without realizing it. The fix is quite easy and I'll get it checked in next time around...but, for now, simply go to MQ.h and find these two lines:

Code: Select all

/*0x04*/	WORD      SpellID;
/*0x06*/	WORD      Unknown0x06;
Remove the second line entirely and make the first line read:

Code: Select all

/*0x04*/	DWORD      SpellID;

...there is an update coming to SPELLBUFF already new in the CVS, so I won't confuse the matter by posting the complete struct here; however, if you simply remove the /*0x06*/ line completely, and then make it DWORD instead of WORD ..you should be fine. You shouldn't have to edit EQLib_MacroParser.cpp once this is corrected.

Anyway, this should correct most of the issue that Plaz was mentioning in his post. The part about the szUnknown returning weird things from GetSpellByID..I didn't quite follow...so, if this doesn't fix it entirely..let me know.