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

Post by kagonis » Thu Jun 19, 2003 3:38 am

Just tested it, seems to be working now, thanks a lot :)
Edit: Also works while being on a horse ;)

cww256
orc pawn
orc pawn
Posts: 20
Joined: Mon Jun 23, 2003 7:58 pm

Post by cww256 » Mon Jun 23, 2003 8:07 pm

Removed the line from MQ.h and changed DWORD now I cant compile... :x

Code: Select all

EQLib_MacroParser.cpp
EQLib_MacroParser.cpp(1850) : error C2039: 'DamageAbsorbRemaining' : is not a me
mber of '_SPELLBUFF'
        c:\macroquest\EQLib\MQ.h(366) : see declaration of '_SPELLBUFF'
EQLib_MacroParser.cpp(2205) : error C2039: 'DamageAbsorbRemaining' : is not a me
mber of '_SPELLBUFF'
        c:\macroquest\EQLib\MQ.h(366) : see declaration of '_SPELLBUFF'
EQLib_MacroParser.cpp(2206) : error C2039: 'DamageAbsorbRemaining' : is not a me
mber of '_SPELLBUFF'
        c:\macroquest\EQLib\MQ.h(366) : see declaration of '_SPELLBUFF'
NMAKE : fatal error U1077: 'cl.exe' : return code '0x2'
Stop.
I replaced the orignal MQ.h and it compiled fine... :?

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

Post by Amadeus » Mon Jun 23, 2003 8:16 pm

get a COMPLETE, FRESH download of all the files from the CVS ...make the change I suggested, and then compile.

It looks like you have a new version of one file but an old version of another file to me.

cww256
orc pawn
orc pawn
Posts: 20
Joined: Mon Jun 23, 2003 7:58 pm

Post by cww256 » Mon Jun 23, 2003 8:25 pm

:( Just did a "from scratch" CVS less than 2 hours ago...?

What would make it look like I got an old file?

Hows this look?
Directly from my MQ.h

Code: Select all

// 6-11-2003 Amadeus
typedef struct _SPELLBUFF {
/*0x00*/	BYTE      Unknown0x00;
/*0x01*/	BYTE      Level;
/*0x02*/	WORD      Unknown0x02;
/*0x04*/	DWORD     SpellID;
/*0x08*/	DWORD     Duration;
/*0x0c*/	DWORD     DamageAbsorbRemaining;  // Melee or Spellshield type
} SPELLBUFF, *PSPELLBUFF; 


// 5-15-2003   eqmule

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

Post by Amadeus » Mon Jun 23, 2003 9:05 pm

That is correct now. ...and you're getting the error messages that you posted before still?

Try a 'make clean' or 'clean your solution' ...depending on whatever type of compiler you're using. Perhaps you have an old cached header somewhere.

cww256
orc pawn
orc pawn
Posts: 20
Joined: Mon Jun 23, 2003 7:58 pm

Post by cww256 » Mon Jun 23, 2003 10:33 pm

Plain default install of Visual Studio .NET Architect if it helps any.

cww256
orc pawn
orc pawn
Posts: 20
Joined: Mon Jun 23, 2003 7:58 pm

Post by cww256 » Mon Jun 23, 2003 10:46 pm

Ok - :D First thanks to Amadeus for the quick replies that got me in the right direction.

I totally cleared away my CVS - got a new CVS - edited MQ.h as shown above - recompiled - no errors :P

I think the problem occoured when I tried to compile the first time and got an error because of PATHs being wrong. I kept hammering at the nmake while running vsvars32.bat in all kindsa of diffrent directories.

So for anyone reading thread up to this point...

1. CVS
2. Edit MQ.h as listed above
3. run vsvars32.bat from where Visual Studio is installed (for me was Program Files\Microsoft Visual Studio .NET 2003\Common7\Tools)
3. nmake from c:\macroquest\EQlib

That should get you there 8)

Darkhearted_Wizard
orc pawn
orc pawn
Posts: 22
Joined: Fri Jun 20, 2003 7:14 pm

Post by Darkhearted_Wizard » Wed Jun 25, 2003 8:05 am

At the moment $char(buff,1) if there's no 1st buff is crashing to desktop with a nice memory read error. I've put in Plazmic's fixes, as well as the structure fix Amadeus posted. using latest CVS(w/ above changes) . Fryfrog is having same problem

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 » Wed Jun 25, 2003 9:56 am

Darkhearted_Wizard wrote:At the moment $char(buff,1) if there's no 1st buff is crashing to desktop with a nice memory read error. I've put in Plazmic's fixes, as well as the structure fix Amadeus posted. using latest CVS(w/ above changes) . Fryfrog is having same problem
I think the syntax is $char(buff,"<spell name>"), at least from what I have seen in other posts.

Darkhearted_Wizard
orc pawn
orc pawn
Posts: 22
Joined: Fri Jun 20, 2003 7:14 pm

Post by Darkhearted_Wizard » Wed Jun 25, 2003 9:58 am

there are, in theory, supposed to be two things you can do though.( buff,"buff name") and also (buff,buffslot). The second isn't working

User avatar
BlueSkies
a ghoul
a ghoul
Posts: 132
Joined: Tue Oct 01, 2002 6:22 pm

Post by BlueSkies » Wed Jun 25, 2003 11:27 am

From the Manual:
$char(buff,xxx) returns the buff slot for a spell name, or 0 if the buff isn't up
$char(buff,#[,xxx]) returns information on a buff slot, or NULL if the slot is empty
If xxx is omitted, the spell name is returned, otherwise, xxx can be: spellid, level, duration (in ticks remaining)

Now, my own experience with this weirdness...

Friend of mine and I were botting one of my characters and one of his through another of his characters. We decided to set up the scripts so that they'd automatically request buffs from eachother when they wore off, so on his computer we issued the command, "/echo $char(buff,"Clarity")". This worked fine, and returned the slot it was in (3 at the time). So we tried, on his computer, "/echo $char(buff,3,duration)" -- which also worked fine.
Now on the computer I was using (at his house), we tried the same with Alacrity. "/echo $char(buff,"Alacrity")". This caused a crash to desktop. On his computer, we gave his character Alacrity (thinking that maybe it was some sort of buff-specific problem), but it worked just fine. Tried the same on my comp with Clarity, but it crashed as well.

We were using the EXACT same copy of MQ (I mean, Exact, our comps were networked and I was running MQ through the network drive), and our EQs were identical versions as well.

So... Figure that out. :P
Live your dreams! Blue Skies everyone

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

Post by Amadeus » Wed Jun 25, 2003 1:36 pm

(buff,buffslot).
There was a thread about this a while back..it's going to be broken for the forseeable future.

kaz
a ghoul
a ghoul
Posts: 103
Joined: Tue Jan 14, 2003 4:09 am

Post by kaz » Wed Jun 25, 2003 4:12 pm

BlueSkies, If I understand your problem correctly, one workaround you can use is to create an event that triggers off the buff wearing off, example "Your feet slow down" etc, and then asks the other character to cast it on you, who does /target soandso and /cast "Spell Name"

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 » Wed Jun 25, 2003 4:56 pm

What would $char(buff,#[,xxx]) be used for? I can't think of a use for it in the game.

I use $char(buff,xxx) to detect when a buff is missing to cast the buff again.

User avatar
BlueSkies
a ghoul
a ghoul
Posts: 132
Joined: Tue Oct 01, 2002 6:22 pm

Post by BlueSkies » Wed Jun 25, 2003 5:06 pm

Kaz -- Good workaround, though it's not as elegant a solution as we would have wanted in our setup.

Thanks though :) I appreciate the assistance.
Live your dreams! Blue Skies everyone