Incoming Macro(MQ2Data ready)

A forum for you to dump all the macros you create, allowing users to use, modify, and comment on your work.

Moderator: MacroQuest Developers

Dr. Blunderpants
orc pawn
orc pawn
Posts: 25
Joined: Fri Dec 19, 2003 5:29 pm

Incoming Macro(MQ2Data ready)

Post by Dr. Blunderpants » Sun Apr 25, 2004 5:55 pm

Usage: /mac inc <radius> <channel>
Example: /mac inc 150 mychannel

What it does: It renders all npcs that are running within the radius and lists them along with those that are possibly casting.

Code: Select all

|inc.mac 
|Incoming Macro for pullers. 
|Version 1.2
|Date:04/27/2004
#turbo 100
Sub main()
/declare index global
/declare casters global
/declare npcid global
/declare incoming global
/declare ChatIn global
/declare ChatInChannel global
/varset index 0
/varset incoming 1
/varset casters 0

/if (${Defined[Param1]}) /varset ChatIn @Param1
/if (${Defined[Param2]}) /varset ChatInChannel @Param2

/call Chatout @ChatIn, "[${Int[@incoming]}] - Incoming -> [${Target.Level} ${Target.Class}] ${Target.CleanName} Cons ${Target.ConColor} <-- TARGET"


:mainloop
/varcalc index @index+1
/if (${String[${Target.NearestSpawn[@index,npc radius @Param0].ID}].Equal[NULL]}) /goto :end
/varcalc npcid ${Target.NearestSpawn[@index,npc radius @Param0].ID}
/if (${Spawn[@npcid].Speed}>114.29) {
/varcalc incoming @incoming+1
/call ChatOut @ChatIn, "[${Int[@incoming]}] - Incoming -> [${Spawn[@npcid].Level} ${Spawn[@npcid].Class}] ${Spawn[@npcid].CleanName} Cons ${Spawn[@npcid].ConColor}"
}
/goto :mainloop


:end
/call ChatOut @ChatIn, "Total incoming: ${Int[@incoming]} mob(s)."


/endmacro

Sub ChatOut(ChatTarget,ChatText) 
   /if (${String[@ChatTarget].Equal[GROUP]}) { 
      /g @ChatText 
      /return 
   }
   /if (${String[@ChatIn].Equal[tell]}) { 
      /tell @ChatTarget @ChatText 
   } else /if (${String[@ChatIn].Equal[Group]}) { 
      /g @ChatText 
   } else /if (${String[@ChatIn].Equal[Raid]}) { 
      /rs @ChatText 
   } else /if (${String[@ChatIn].Equal[Say]}) { 
      /say @ChatText 
   } else /if (${String[@ChatIn].Equal[Channel]}) { 
      /chat #@ChatInChannel @ChatText 
   } else /if (${String[@ChatIn].Equal[IRC]}) { 
      /irc @ChatText 
   } 
/return
You're ugly.