Can anyone convert drag.mac?

Got a cool macro idea? Wanna request a macro? Here is the place for you!

Moderator: MacroQuest Developers

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

Can anyone convert drag.mac?

Post by ieatacid » Sat Apr 24, 2004 6:05 pm

Can anyone take a stab at converting this to MQ2Data?

Code: Select all

|drag.mac
|Usage:  /macro drag.mac ( <target> | <name> ) [ <name2> ... <nameN> ]
|Version 2.5, based on GrimJack's version
|Version 2.5a, gf getting happy.
|Version 2.6, De-Happified it.
|Version 2.7, Added capability to drag named in addition to targeted.

#turbo
Sub Main
   /declare CorpseID local
   /declare i local
   /declare CorpseCount local
   /declare Bodies array

   /varset i 0
   /varset CorpseCount 0

   /if $defined(Param0)==FALSE /if "$target(type)"!="CORPSE" {
      /echo Usage:  /macro drag.mac ( <target> | <name> ) [ <name2> ... <nameN> ]
      /end
   }

   /if "$target(type)"=="CORPSE" {
      /varset Bodies(0) $target(id)
      /varadd CorpseCount 1
      /varadd i 1
   }

   :GatherTheBodies
      /if $defined(Param$int(@i))==FALSE /goto :EndGather
      /target corpse @Param$int(@i)
      /if n $target(id)>0 {
        /varset Bodies(@CorpseCount) $target(id)
        /varadd CorpseCount 1
      }
      /varadd i 1
   /goto :GatherTheBodies
   :EndGather
   /varsub CorpseCount 1
   /echo @CorpseCount

   :CorpseCheck
   /if $defined(Bodies(0))==UNDEFINED-ARRAY-ELEMENT {
     /echo No corpses are targetable.
     /goto :Done
   }

   /varset i 0
   :DragThem
      /if n $spawn(@Bodies(@i),distance)>25 {
         /if n $target(id)!=@Bodies(@i) /target id @Bodies(@i)
         :WaitforTarget
            /delay 0
         /if $target(id)!=@Bodies(@i) /goto :WaitforTarget
         /corpse
      }
      /varadd i 1
      /delay 0
      /if n @i>@CorpseCount /varset i 0
   /goto :DragThem
   :Done
/return 

newb-n-training
a lesser mummy
a lesser mummy
Posts: 39
Joined: Mon Apr 19, 2004 8:51 pm

Post by newb-n-training » Sat Apr 24, 2004 6:42 pm


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

Post by ieatacid » Sat Apr 24, 2004 7:45 pm

Thanks, but that's the thread where the above macro came from and unless I'm missing something I don't see any variation using MQ2Data.

I put this in the request forum because I'm requesting it be converted to the new format as I've had trouble converting it myself.

newb-n-training
a lesser mummy
a lesser mummy
Posts: 39
Joined: Mon Apr 19, 2004 8:51 pm

Post by newb-n-training » Sat Apr 24, 2004 8:49 pm

well lookat that ... guess I got the two drag macs mixed up ... Figured I'd take a first stab at it but haven't tested or anything ... should get you started ... I need to play with it some since I've never done declares before ... Gonna try more when I next get on my rogue.

Code: Select all

|drag.mac 
|Usage:  /macro drag.mac ( <target> | <name> ) [ <name2> ... <nameN> ] 
|Version 2.5, based on GrimJack's version 
|Version 2.5a, gf getting happy. 
|Version 2.6, De-Happified it. 
|Version 2.7, Added capability to drag named in addition to targeted. 

#turbo 
Sub Main 
   /declare CorpseID local 
   /declare i local 
   /declare CorpseCount local 
   /declare Bodies array 

   /varset i 0 
   /varset CorpseCount 0 


|======= Never done Defines =====
   /if $defined(Param0)==FALSE /if "$target(type)"!="CORPSE" { 
|==========================

      /echo Usage:  /macro drag.mac ( <target> | <name> ) [ <name2> ... <nameN> ] 
      /end 
   } 


|==  /if "$target(type)"=="CORPSE" { 
|==     /varset Bodies(0) $target(id) 
|==     /varadd CorpseCount 1 
|==     /varadd i 1 
|==  } 

   /if (${Target.Type.Equal[CORPSE]}) {
      /varset Bodies(0) ${Target.Name} 
      /varadd CorpseCount 1 
      /varadd i 1 

   }   



   :GatherTheBodies 
|======= Never done Defines =====
      /if $defined(Param$int(@i))==FALSE /goto :EndGather 
|==========================

      /target corpse @Param$int(@i) 

|==     /if n $target(id)>0 { 
|==        /varset Bodies(@CorpseCount) $target(id) 
|==        /varadd CorpseCount 1 
|==     } 

      /if (${Target.ID}) {
        /varset Bodies(@CorpseCount) ${Target.Name} 
        /varadd CorpseCount 1 
      } 

      /varadd i 1 

   /goto :GatherTheBodies 


   :EndGather 
   /varsub CorpseCount 1 
   /echo @CorpseCount 

   :CorpseCheck 
|======= Never done Defines =====
   /if $defined(Bodies(0))==UNDEFINED-ARRAY-ELEMENT { 
|================================

     /echo No corpses are targetable. 
     /goto :Done 
   } 

   /varset i 0 
   :DragThem 
|======= Never done Defines =====
      /if n $spawn(@Bodies(@i),distance)>25 { 
|================================


|==     /if n $target(id)!=@Bodies(@i) /target id @Bodies(@i) 

        /if (${Target.Name.NOTEQUAL[Bodies(@1)]}) /target id @Bodies(@i)


         :WaitforTarget 
            /delay 0 

|==      /if $target(id)!=@Bodies(@i) /goto :WaitforTarget 
         /if (${Target.Name.NOTEQUAL[@Bodies(@i)]}) /goto :WaitforTarget

         /corpse 
      } 
      /varadd i 1 
      /delay 0 
|==    /if n @i>@CorpseCount /varset i 0 
       /if (@i>@CorpseCount) /varset i 0

   /goto :DragThem 
   :Done 
/return