Moderator: MacroQuest Developers




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