count.mac (kill counter with charm support)

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

Moderator: MacroQuest Developers

User avatar
ieatacid
Developer
Developer
Posts: 2727
Joined: Wed Sep 03, 2003 7:44 pm

count.mac (kill counter with charm support)

Post by ieatacid » Tue Jun 08, 2004 7:11 pm

This is useful for Vxed expeditions where you need to keep track of how many mobs you've killed.

Two versions are posted -- the stand-alone kill counter (based on an old macro that came out around the time of GoD -- can't recall author) and the same macro with added goodies if you're using a charmed pet (targets former pet and announces charm break to /group).

Also saves the number of mobs killed to an ini file -- if something happens (LD, EQ crashes, computer crashes) and you can't remember what the count was at when you come back.


stand-alone counter

Code: Select all

|count.mac
|5/23/04
|
|Usage:
|/mac count
|/mac count ini      -- load kill count from ini file
|/echo set <number>  -- manually set kill count

#turbo

#event expgain "#*#You gain party experience!!"
#event set "[MQ2] set #1#"

Sub Main
   /declare count int outer 0

   /echo "/echo add <number>" manually sets count
   /echo "/mac count ini" loads count from ini file
   
   /if (${String[${Param0}].Equal[ini]}) {
      /varset count ${Ini[count.ini,Mobs Killed,count]}
      /echo Kill Count: ${count}
   }
   :loop
   /doevents
   /delay 5
   /goto :loop   
/return

Sub Event_expgain
   /varcalc count ${count}+1
   /echo Kill Count: ${count}
   /ini "count.ini" "Mobs Killed" "count" "${count}"
/return

Sub Event_set(string Line, int setCount)
   /if (!${setCount}) {
      /echo specify a number.
      } else {
      /varset count ${setCount}
      /echo Kill Count: ${count}
      /ini "count.ini" "Mobs Killed" "count" "${count}"
      }
/return

kill counter with charm support

Code: Select all

|count.mac
|5/23/04
|
|Usage:
|/mac count
|/mac count ini      -- load kill count from ini file
|/echo set <number>  -- manually set kill count

#turbo

#event expgain "#*#You gain party experience!!"
#event set "[MQ2] set #1#"

Sub Main
   /declare count int outer 0
   /declare hasPet int local 0
   /declare thePet int local 0
   
   /echo "/echo add <number>" manually sets count
   /echo "/mac count ini" loads count from ini file
   
   /if (${String[${Param0}].Equal[ini]}) {
      /varset count ${Ini[count.ini,Mobs Killed,count]}
      /echo Kill Count: ${count}
   }
   :loop
   /if (${Me.Pet.ID} && ${hasPet}==0) {
      /varset thePet ${Target.ID}
      /varset hasPet 1
   }
    /if (!${Me.Pet.ID} && ${hasPet}==1) {
      /target ${Spawn[${thePet}]}
      /varset hasPet 0
      /delay 1s
      /g charm broke
   }
   /doevents
   /delay 5
   /goto :loop   
/return

Sub Event_expgain
   /varcalc count ${count}+1
   /echo Kill Count: ${count}
   /ini "count.ini" "Mobs Killed" "count" "${count}"
/return

Sub Event_set(string Line, int setCount)
   /if (!${setCount}) {
      /echo specify a number.
      } else {
      /varset count ${setCount}
      /echo Kill Count: ${count}
      /ini "count.ini" "Mobs Killed" "count" "${count}"
      }
/return

JGC84
a ghoul
a ghoul
Posts: 116
Joined: Sat Nov 29, 2003 2:51 am

Post by JGC84 » Wed Jun 09, 2004 6:30 am

omg someone remade my crappy crappy count macro! thats funny
ACK! I think I blew it up....

I dont think your allowed to talk about this outside of a "free speech zone" anymore.