Bit of code ..............

For questions regarding conversion of scripts from the old, parm style to the new MQ2Data format. Conversion questions only!

Moderator: MacroQuest Developers

Gabby
a lesser mummy
a lesser mummy
Posts: 49
Joined: Sat Mar 13, 2004 10:35 am

Bit of code ..............

Post by Gabby » Mon May 10, 2004 10:16 pm

How would i filter warders (aka
#soanso's_Warder00 from ${Spawn[#]} ?

Preocts
a snow griffon
a snow griffon
Posts: 312
Joined: Thu Jan 29, 2004 1:02 pm

Post by Preocts » Tue May 11, 2004 8:49 am

:? Think you are going to need to exmplain why and what your are trying to do.

Gabby
a lesser mummy
a lesser mummy
Posts: 49
Joined: Sat Mar 13, 2004 10:35 am

Post by Gabby » Tue May 11, 2004 12:20 pm

Sorry was really late for me when I posted ................

This comes from a hud mod http://macroquest2.com/phpBB2/viewtopic.php?t=7118

The thing I would like to do is have

Code: Select all

[Elements]
     GameTime=3,5,35,255,255,255,GameTime - ${GameTime} - Night=${GameTime.Night}
     GMIndicator=3,5,45,255,0,0,GM - ${Spawn[gm]}
     CursorItemName=7,-15,-15,255,255,255,${If[${Cursor.ID},${Cursor},]}
     Speed=3,5,55,255,255,255,Speed - ${Int[${Me.Speed}]}
     LastTell=3,5,65,255,255,255,LastTell - ${If[${MacroQuest.LastTell.NotEqual["NULL"]},${MacroQuest.LastTell},]}
     BankCash=3,5,75,255,255,255,Bank - ${Me.PlatinumBank} Platinum
     [color=red]Named=3,5,85,255,255,255,Named - ${Spawn[#]}[/color]
     LDoNPoints=3,5,95,255,255,255,LDoN Points - ${Int[${Me.LDoNPoints}]}
     Bound=3,5,105,255,255,255,Bound in ${Me.Bound}
     GroupXP=3,5,115,255,255,255,Group LeaderXP - ${Float[${Me.PctGroupLeaderExp}]}%
     Macro=3,5,125,255,255,255,Macro - ${If[${Macro.Name.NotEqual["NULL"]},${Macro.Name},]}
be able to not display #soanso's_Warder00 when doing a zone search for named spawn (which it does by picking closest mob with a # in name)

magictiger
a snow griffon
a snow griffon
Posts: 450
Joined: Sun Mar 21, 2004 2:24 pm

Post by magictiger » Tue May 11, 2004 12:39 pm

You might try ${If[Spawn[#].Name.Right[8].NotEqual["Warder00"],${Spawn[#]},I got nothin' Chief}

Don't expect this to work. My coding skills are weak and I haven't had enough sleep to remember the syntax, but give it a shot. It's at least a starting place :)

Preocts
a snow griffon
a snow griffon
Posts: 312
Joined: Thu Jan 29, 2004 1:02 pm

Post by Preocts » Tue May 11, 2004 12:50 pm

Code: Select all

${If[Spawn[#].ID,${If[${Spawn[#].Find["'s_Warder"],,${Spawn[#]}}]},]}
Haven't tested this but the logic is:
If the spawn has # in it's name
If the spawn does not have 's_Warder in it's name
Show spawn name

Gabby
a lesser mummy
a lesser mummy
Posts: 49
Joined: Sat Mar 13, 2004 10:35 am

Post by Gabby » Tue May 11, 2004 1:15 pm

Well no luck with that but gives me a referance point , just spams with error.

Thx for the assist guys ............... ill post if i find a solution.

Update: Managed to get

Code: Select all

${If[${Spawn.ID.NotEqual["'s_Warder"]},${[Spawn[#]},]}
to go in and it now doesnt spam with error , but also doesnt show a target with # in the name
:cry:

Preocts
a snow griffon
a snow griffon
Posts: 312
Joined: Thu Jan 29, 2004 1:02 pm

Post by Preocts » Tue May 11, 2004 2:24 pm

::sigh:: That's because Spawn.ID is an integer... and you are using a string comparision on it. A string comparision with faulty logic I might add.

Code: Select all

${If[${Spawn[#].Name.Find[Warder]},,${Spawn[#].Name}]}

Gabby
a lesser mummy
a lesser mummy
Posts: 49
Joined: Sat Mar 13, 2004 10:35 am

Post by Gabby » Tue May 11, 2004 4:06 pm

Thx Preocts -still a learning process for me, was just getting use to the old parms :wink:

Drumstix42
a grimling bloodguard
a grimling bloodguard
Posts: 808
Joined: Mon May 03, 2004 4:25 pm

Post by Drumstix42 » Mon May 24, 2004 10:49 pm

This work?

${Spawn[npc #]}