mezmob.mac conversion

Have a macro idea but not sure where to start? Ask here.

Moderator: MacroQuest Developers

User avatar
Slice
a hill giant
a hill giant
Posts: 189
Joined: Wed Oct 30, 2002 2:52 pm

mezmob.mac conversion

Post by Slice » Sun May 09, 2004 1:07 am

Anyone able to do a conversion of mezmob from this thread for the new data types?

http://macroquest2.com/phpBB2/viewtopic ... ight=rathe
Slice

Oid
a snow griffon
a snow griffon
Posts: 416
Joined: Thu Oct 17, 2002 3:26 am
Contact:

Post by Oid » Sun May 09, 2004 7:32 am

Code: Select all

| mezmob.mac 
| by [40oz] 
| Updated to new system 05/09, and made to most likely not work, by Oid!
| 
| Usage: /macro mezmob 
|  -- Have mob on target you want to mez indefinately. 
|  -- Have your mez spell memmed, and check that it's the same as the /varset mezSpell 
| 
| This macro will mez the mob on your target indefinately, it does nothing but keep track 
| of time and mez.  If you are moving, it will catch the interrupt of the cast.  It also 
| takes care of resists, stuns, etc. 

#include spellcast.mac 

#turbo 

Sub Main 
   | ----Declares 
   /declare mezSpell string local 
   /declare recastTime int local 
   /declare sitFlag int local 

   | ----CHANGE THESE AS APPROPRIATE---- 

   /varset mezSpell "Bliss"   | Spell to mez with. 
   /varset recastTime 400   | Number of miliseconds to wait before recasting between successful mezzes 
   /varset sitFlag 1      | Sit after mez?  1 for yes, 0 for no. 

   | ----CHANGE THESE AS APPROPRIATE---- 

   /if (!${Target.ID}) { 
      /echo No mob on target to mez. 
      /return 
   } 

   /declare targetID local 
   /varset targetID ${Target.ID}

   /echo Keeping ${Target.CleanName} mezzed! 

   :castLoop 
      /doevents 
      /stand 
      /call Cast ${mezSpell}
      /if (${String[${Macro.Return}].Equal[CAST_SUCCESS]) {
         /if (${sitFlag}==1) /sit 
         /delay ${recastTime}
      } 
     /if (${Target.ID}==${targetID}) /goto :castLoop
   /echo EXITING ---- EXITING 
/return
Should work, if it doesn't? Tough shit, you get what you pay for. its 4:30
Smokey the Lax says only you can prevent reproduction.

huckleberry
orc pawn
orc pawn
Posts: 18
Joined: Thu Jan 16, 2003 12:37 am

Post by huckleberry » Thu May 13, 2004 3:38 pm

would it be possible to incorporate this mac to keep two mobs mezzed indefinetly on 25 sec timer utilizing the toggle target command (i.e. current target and toggle target) ?
something like:

Stand
Toggle Target
Cast Bliss
Cast Tash
Sit
25 seconds
Repeat

I know it is specialized but looking for help in a specific event. Any help would be appreciated.

Oid
a snow griffon
a snow griffon
Posts: 416
Joined: Thu Oct 17, 2002 3:26 am
Contact:

Post by Oid » Thu May 13, 2004 3:46 pm

Hmm dunno much about toggling, im a lazy fucking asshole.

Using 2 target IDs could work though i suppose....
Smokey the Lax says only you can prevent reproduction.

Chill
Contributing Member
Contributing Member
Posts: 435
Joined: Fri May 07, 2004 5:06 pm
Location: Erie, PA

Post by Chill » Thu May 13, 2004 5:44 pm

Yea you could make it work toggling 2 targets. You would need to find the actual name for the <Toggle Last Two Targets> /keypress or bind it to something else and /keypress that. The information on how to do this is posted. It doesnt look hard, but would take a little effort.

Alternately you could prolly make a macro to mez 2 (or more) mobs by supplying IDs as paramaters. Im thinking is you could make a simple EQ hotkey to /echo ${Target.ID} and tap that with each of the mobs you want to mez, then supply those IDs as paramaters to the macro.

I might take a look at this and see if I can pull it off.

Oid
a snow griffon
a snow griffon
Posts: 416
Joined: Thu Oct 17, 2002 3:26 am
Contact:

Post by Oid » Fri May 14, 2004 12:02 am

I will write it tonight. It will even be idiot proof!
Smokey the Lax says only you can prevent reproduction.

Oid
a snow griffon
a snow griffon
Posts: 416
Joined: Thu Oct 17, 2002 3:26 am
Contact:

Post by Oid » Fri May 14, 2004 1:34 pm

Ok so I made MTP's last night... maybe tonight
Smokey the Lax says only you can prevent reproduction.

huckleberry
orc pawn
orc pawn
Posts: 18
Joined: Thu Jan 16, 2003 12:37 am

Post by huckleberry » Fri May 14, 2004 5:39 pm

thank you for your input and help

mobs will most likely have the same name however

Oid
a snow griffon
a snow griffon
Posts: 416
Joined: Thu Oct 17, 2002 3:26 am
Contact:

Post by Oid » Fri May 14, 2004 7:16 pm

Thats why you use ID numbers... I'll show ya ;)
Smokey the Lax says only you can prevent reproduction.

Oid
a snow griffon
a snow griffon
Posts: 416
Joined: Thu Oct 17, 2002 3:26 am
Contact:

Post by Oid » Fri May 14, 2004 7:16 pm

Tomorrow, cuz tonight, i sleep, cuz im runnin on 2 hours..
Smokey the Lax says only you can prevent reproduction.

Chill
Contributing Member
Contributing Member
Posts: 435
Joined: Fri May 07, 2004 5:06 pm
Location: Erie, PA

Post by Chill » Fri May 14, 2004 7:41 pm

I started to do it just using paramaters but got hung up on string -> int conversion.

I was thinking of setting it up with no defined paramters, checking the Params variable to see how many got passed, then accessing them as Param0, Param1, etc.. but the problem is that those Params are strings, not ints.

Not sure how to do string to integer conversion in MQ, but if someone can help me with that, Im pretty sure this would get real easy.

Oid
a snow griffon
a snow griffon
Posts: 416
Joined: Thu Oct 17, 2002 3:26 am
Contact:

Post by Oid » Sat May 15, 2004 8:09 am

Code: Select all

| mezmob.mac 
| by [40oz] 
| Updated to new system 05/09, and made to most likely not work, by Oid! 
| Updated for two mobs 05/15, and it better not fucking work, by Oid!
|
| Usage: /macro mezmob ID1 ID2
| For this version, supply 2 params on running the macro, the target ID's of the 2 mobs you wish
| to keep mezzed.  You can get the ID by targeting the mob and doing /echo ${Target.ID}
|


#include spellcast.mac 

#turbo 

Sub Main 
   | ----Declares 
   /declare mezSpell string local 
   /declare recastTime int local 
   /declare sitFlag int local
   /declare mobone int local
   /declare mobtwo int local
   /declare singlerecasttime int local
   | ----CHANGE THESE AS APPROPRIATE---- 

   /varset mezSpell "Bliss"   | Spell to mez with. 
   /varset singlerecasttime 400 | Recast time on single target
   /varset recastTime 250   | Number of miliseconds to wait before recasting between successful mezzes 
   /varset sitFlag 1      | Sit after mez?  1 for yes, 0 for no. 
   | ----CHANGE THESE AS APPROPRIATE---- 

   /varset mobone ${Param0}
   /varset mobtwo ${Param1}

   /if (${mobone}==0) {
      /echo No targets defined, checking to see if mob is targeted.
      /if (!${Target.ID}) { 
         /echo No mob on target to mez. 
         /return 
      } else {
      /if (${mobtwo}==0) {
         /target id ${mobone}
	 /echo Keeping ${Target.CleanName} mezzed!
         /goto :singlecastloop
      } else {
	 /echo Keeping two mobs (SpawnIDs ${mobone} and ${mobtwo}) mezzed.
         /goto :doublecastloop
      }
   }
   :singlecastLoop 
      /doevents 
      /stand 
      /call Cast ${mezSpell} 
      /if (${String[${Macro.Return}].Equal[CAST_SUCCESS]) { 
         /if (${sitFlag}==1) /sit 
         /delay ${singlerecastTime} 
      } 
     /if (${Target.ID}==${targetID}) /goto :castLoop 
   /echo EXITING ---- EXITING 


   :doublecastloop
     :mobone 
      /doevents
      /stand
      /call Cast ${mezSpell}
      /if (${String[${Macro.Return}].Equal[CAST_SUCCESS]) { 
         /if (${sitFlag}==1) /sit
         /popup Mob One successfully mezzed.
         /target id ${mobtwo}
         /delay ${recastTime}
         /goto :mobtwo
      } else {
         /goto :mobone
      }
     :mobtwo
      /doevents
      /stand
      /call Cast ${mezSpell}
      /if (${String[${Macro.Return}].Equal[CAST_SUCCESS]) { 
         /if (${sitFlag}==1) /sit
         /popup Mob Two successfully mezzed.
         /target id ${mobone}
         /delay ${recastTime}
         /goto :mobone 
      } else {
         /goto :mobtwo
      }
/return 

Let me know how it works out, I dont have an enchanter to test with. Going to post another version as well in a moment, that doesnt require run time values.


edit: 1:30am sunday .. pacific... Oops, bad line in there, fixed
Last edited by Oid on Sun May 16, 2004 4:26 am, edited 1 time in total.
Smokey the Lax says only you can prevent reproduction.

Oid
a snow griffon
a snow griffon
Posts: 416
Joined: Thu Oct 17, 2002 3:26 am
Contact:

Post by Oid » Sat May 15, 2004 8:28 am

Code: Select all

| mezmob.mac 
| by [40oz] 
| Updated to new system 05/09, and made to most likely not work, by Oid! 
| Updated for two mobs 05/15, and it better not fucking work, by Oid!
|
| Usage: /macro mezmob
| For this version, simply run the macro, it tells you what to do from there.
#include spellcast.mac 
#event targetone "[MQ2] target 1"
#event targettwo "[MQ2] target 2"
#event singletarg "[MQ2] singletarget"
#turbo 

Sub Main 
   | ----Declares 
   /declare mezSpell string local 
   /declare recastTime int local 
   /declare sitFlag int local
   /declare mobone int local
   /declare mobtwo int local
   /declare singlerecasttime int local
   /declare singletarget int local
   | ----CHANGE THESE AS APPROPRIATE---- 

   /varset mezSpell "Bliss"   | Spell to mez with. 
   /varset singlerecasttime 400 | Recast time on single target
   /varset recastTime 250   | Number of miliseconds to wait before recasting between successful mezzes 
   /varset sitFlag 1      | Sit after mez?  1 for yes, 0 for no. 
   | ----CHANGE THESE AS APPROPRIATE---- 

   /echo Auto mez macro started, please target the first mob and /echo target 1   

   :targetingloop
     /delay 5
     /doevents
     /if (${singletarget}==1) /goto :singlecastloop
     /if (${mobtwo}!=0) /goto :doublecastloop
   /goto :targetingloop


   :singlecastLoop 
      /target ID ${mobone}
      /doevents 
      /stand 
      /call Cast ${mezSpell} 
      /if (${String[${Macro.Return}].Equal[CAST_SUCCESS]) { 
         /if (${sitFlag}==1) /sit 
         /delay ${singlerecastTime} 
      } 
     /if (${Target.ID}==${targetID}) /goto :castLoop 
   /echo EXITING ---- EXITING 


   :doublecastloop
     :mobone 
      /doevents
      /stand
      /call Cast ${mezSpell}
      /if (${String[${Macro.Return}].Equal[CAST_SUCCESS]) { 
         /if (${sitFlag}==1) /sit
         /popup Mob One successfully mezzed.
         /target id ${mobtwo}
         /delay ${recastTime}
         /goto :mobtwo
      } else {
         /goto :mobone
      }
     :mobtwo
      /doevents
      /stand
      /call Cast ${mezSpell}
      /if (${String[${Macro.Return}].Equal[CAST_SUCCESS]) { 
         /if (${sitFlag}==1) /sit
         /popup Mob Two successfully mezzed.
         /target id ${mobone}
         /delay ${recastTime}
         /goto :mobone 
      } else {
         /goto :mobtwo
      }
/return 

Sub Event_targetone
    /varset mobone ${Target.ID}
    /echo Mob one set to ${Target.ID}, please target 2nd mob and /echo target 2
    /echo To run with a single target, please /echo singletarget.
/return

Sub Event_targettwo
   /varset mobtwo ${Target.ID}
   /echo Mob two set to ${Target.ID}, macro running.
/return

Sub Event_singletarget
  /varset singletarget 1
  /echo Running in single target mode!
/return
This one, is different. You /echo a few commands after starting the macro to set up the targets. This also, is obviously untsted.

Please let me know if you have problems with either.
Smokey the Lax says only you can prevent reproduction.