HudRadar.mac -- More pointless fun from Preocts.

Post your completed (working) macros here. Only for macros using MQ2Data syntax!

Moderator: MacroQuest Developers

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

HudRadar.mac -- More pointless fun from Preocts.

Post by Preocts » Mon May 10, 2004 5:25 am

fuck it
Last edited by Preocts on Tue Jun 01, 2004 3:47 pm, edited 1 time in total.

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

Post by magictiger » Mon May 10, 2004 12:19 pm

*bows to Preocts and sings her praises*

Question... how does this handle finding multiple mobs with the same name? Does it only display one on the HUD, or does it display them all?

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

Post by Preocts » Mon May 10, 2004 2:54 pm

Just wrote it to display the nearest mob to yourself.

Programmer
a hill giant
a hill giant
Posts: 195
Joined: Mon Dec 01, 2003 2:41 am

Post by Programmer » Mon May 10, 2004 9:38 pm

Looks fun :)

Devor
orc pawn
orc pawn
Posts: 10
Joined: Tue May 11, 2004 8:17 pm

Post by Devor » Tue May 11, 2004 8:21 pm

I ran it an it worked fine till it locked me up . Have tryed to run it to get map off the screen still trying to figure out how to remove it , even if I dont start hudradar map still on screen as long as MQ is running heh

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 pm

Can you be a little more descriptive on "locked me up".

/macro hudradar clear

that doesn't remove the lables?

before you answer.... ask yourself "Did I download the latest zip today?"

nightgod
a ghoul
a ghoul
Posts: 122
Joined: Sun Nov 02, 2003 4:39 am

Post by nightgod » Thu May 13, 2004 1:26 pm

When I used this, the X and the 0 remain on the screen after typing /macro hudradar clear

the only way I could get rid of them was to unload MQ2Hud-any ideas?

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

Post by Preocts » Thu May 13, 2004 2:28 pm

You know.. I've had that happen too and there isn't really a good reason for it. :?

I've had it happen as well and debugged it as far as I could, the ini file shows all seven Keynames empty. By all reasons the X and O shouldn't be there.

Gerald
decaying skeleton
decaying skeleton
Posts: 3
Joined: Fri Apr 30, 2004 10:15 pm

Post by Gerald » Thu May 13, 2004 10:06 pm

What I found interesting is I use a shared drive and have all my computers running the same actual copy of MQ2 so I don't have to copy all the files back and forth all the time.

When I run this program, the radar shows up on all screens. :)

Guessing this happens to all hud stuff, but first time I've used it. Kinda odd.

Mongol311
a lesser mummy
a lesser mummy
Posts: 45
Joined: Sat Apr 24, 2004 12:06 pm
Location: Connecticut, USA

Post by Mongol311 » Sat May 15, 2004 7:06 pm

Doesn't just happen for all HUD stuff, still appears on my HUD even though everything is cleared. There has to be a way to fix this.
I live in an asbestos igloo, do your worst!
(Devs, please don't hate me, I donated!)

Mysteryman
a lesser mummy
a lesser mummy
Posts: 39
Joined: Wed Apr 14, 2004 4:11 pm

Post by Mysteryman » Fri May 21, 2004 2:50 pm

There is..change this line

/ini "../MQ2HUD.INI" "Elements" "RADARTarget${nCount}" ""


to this

/ini "../MQ2HUD.INI" "Elements" "RADARTarget${nCount}" " "


The only diffrence is between the LAST set of quotes, i added a space character. That makes them go away everytime.

Mysteryman
a lesser mummy
a lesser mummy
Posts: 39
Joined: Wed Apr 14, 2004 4:11 pm

Post by Mysteryman » Fri May 21, 2004 3:07 pm

Skip that... It started flaking out on me now using just the spaces also, so that's not a fix as it first appearted to be.

Mysteryman
a lesser mummy
a lesser mummy
Posts: 39
Joined: Wed Apr 14, 2004 4:11 pm

Post by Mysteryman » Fri May 21, 2004 3:28 pm

Ok, got it now :)

Basicly this is what's happening....

The MQ2HUD.DLL is not clearing the elemtent list.

What i did to get around this is...

Use Element2 ( or what ever ) as the section name in the .INI ( do not use elment, it's the default acording to the .cpp file )

So what you have now, is a blank Elment s Section and a populated elment2 section.

Once you write your data into the ini under element2 section, to display it, do a /loadhud elment2 .

To clear, do a /defaulthud ( or i susppose /loadhud elment would also work ).

Anyway, works fine like this for me. Hope it helps you.

Modified the above code to work in this fashion, works great everytime...
If you have it in a weird state, you may need to delete your mq2hud.ini file first so it will remove the items inserted under elements section on previous runs.

Code: Select all

|SET THESE FIRST!
#Define OffSetX 200
#Define OffSetY 200
#Define ScreenSizeX 1024
#Define ScreenSizeY 768

|** HuDRadar.mac written by Preocts on her day off.

  Wrote this purely for fun.

  /macro hudradar <Find:TargetName> [clear]<--o
                                              |
  Clears screen and ends macro. (optional) ---o

  /macro hudradar "Find:Heretic Invader"
  Popups your radar, if found, and helps you track the sucker down.
  STEALTH: Due to recent concern in the ranks I decided to write this
  so the macro DOES NOT TARGET your search mob. ::
  Don't have a way to turn it off yet. Someone suggest/write one =P
  Left plenty of room to expand on this if it proves more than just
  entertaining.

  Small Example of what it looks like:
---------------------------------------------------------------------
A Heretic Invader                                                  |
Location: 463.23, -5222, 105.3                                     |
Distance: 5432.12, SSW                                             |
Level: 28 Class: Shadow Knight                                     |
Health: 100%                                                       |
                                                                    |
                                                                    |
                                                                    |
                                          X                         |
                                                                    |
                                                                    |
                                                                    |
                                O                                   |
                                                                    |
---------------------------------------------------------------------
Now: what the hell is the X O shit? Well, in the center of your screen you'll
see the X. That is YOU. The O is the MoB on your radar and is placed in the
direction of the mob reletive to the direction you are facing.
The radar updates itself every two seconds. Have Fun.

**|

Sub Main(Option)
  /if (${Option.Equal[clear]}) /call ClearRadar
  /if (${Option.Find[Find:]}) /call DisplayMob "${Option.Arg[2,:]}"
/return

Sub DisplayMob(MobName)
  /declare MobID int local ${NearestSpawn[${MobName}].ID}
  /if (!${MobID}) /return
  /declare CenterX int local ${Math.Calc[ScreenSizeX/2]}
  /declare CenterY int local ${Math.Calc[ScreenSizeY/2]}
  /declare X int local OffSetX
  /declare Y int local OffSetY
  /declare R int local 0
  /declare B int local 0
  /declare G int local 255
  /declare DelayTimer timer local
  :DisplayLoop
       /loadhub elements2
    /ini "../MQ2HUD.INI" "Elements2" "RADARTarget1" "3,${X},${Y},${R},${G},${B},Name: ${Spawn[${MobID}].CleanName}"
    /ini "../MQ2HUD.INI" "Elements2" "RADARTarget2" "3,${X},${Math.Calc[${Y}+10]},${R},${G},${B},Location: ${Spawn[${MobID}].X}, ${Spawn[${MobID}].Y}, ${Spawn[${MobID}].Z}"
    /ini "../MQ2HUD.INI" "Elements2" "RADARTarget3" "3,${X},${Math.Calc[${Y}+20]},${R},${G},${B},Distance: ${Spawn[${MobID}].Distance}, ${Spawn[${MobID}].HeadingTo.ShortName}"
    /ini "../MQ2HUD.INI" "Elements2" "RADARTarget4" "3,${X},${Math.Calc[${Y}+30]},${R},${G},${B},Level: ${Spawn[${MobID}].Level}, Class: ${Spawn[${MobID}].Class}"
    /ini "../MQ2HUD.INI" "Elements2" "RADARTarget5" "3,${X},${Math.Calc[${Y}+40]},${R},${G},${B},Health: ${Spawn[${MobID}].PctHPs}%"
    /ini "../MQ2HUD.INI" "Elements2" "RADARTarget6" "3,${CenterX},${CenterY},255,255,0,X"
    /ini "../MQ2HUD.INI" "Elements2" "RADARTarget7" "3,${Math.Calc[${CenterX}+(${Math.Cos[270+(${Me.Heading.DegreesCCW}-${Spawn[${MobID}].HeadingTo.DegreesCCW})]}*100)].Int},${Math.Calc[${CenterY}+(${Math.Sin[270+(${Me.Heading.DegreesCCW}-${Spawn[${MobID}].HeadingTo.DegreesCCW})]}*100)].Int},255,255,0,O"    /varset DelayTimer 2s
    :DisplayWait
      /delay 1
|Add doevents here
    /if (${DelayTimer}) /goto :DisplayWait
    /varset DelayTimer 2s
  /goto :DisplayLoop
/return

Sub ClearRadar
  /defaulthub
/return
Last edited by Mysteryman on Fri May 21, 2004 4:26 pm, edited 1 time in total.

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

Post by Preocts » Fri May 21, 2004 3:53 pm

[ code ] fucking brackets [ /code ] !!!!!!

Don't repost that. Hit the goddamn edit button and change it!