Page 1 of 1

HudRadar.mac -- More pointless fun from Preocts.

Posted: Mon May 10, 2004 5:25 am
by Preocts
fuck it

Posted: Mon May 10, 2004 12:19 pm
by magictiger
*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?

Posted: Mon May 10, 2004 2:54 pm
by Preocts
Just wrote it to display the nearest mob to yourself.

Posted: Mon May 10, 2004 9:38 pm
by Programmer
Looks fun :)

Posted: Tue May 11, 2004 8:21 pm
by Devor
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

Posted: Tue May 11, 2004 8:49 pm
by Preocts
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?"

Posted: Thu May 13, 2004 1:26 pm
by nightgod
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?

Posted: Thu May 13, 2004 2:28 pm
by Preocts
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.

Posted: Thu May 13, 2004 10:06 pm
by Gerald
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.

Posted: Sat May 15, 2004 7:06 pm
by Mongol311
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.

Posted: Fri May 21, 2004 2:50 pm
by Mysteryman
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.

Posted: Fri May 21, 2004 3:07 pm
by Mysteryman
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.

Posted: Fri May 21, 2004 3:28 pm
by Mysteryman
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

Posted: Fri May 21, 2004 3:53 pm
by Preocts
[ code ] fucking brackets [ /code ] !!!!!!

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