drag.mac for dragging unlimited corpses ;)

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

Moderator: MacroQuest Developers

AlphaBeta
a ghoul
a ghoul
Posts: 126
Joined: Sat Nov 09, 2002 12:35 am

Post by AlphaBeta » Tue Oct 14, 2003 3:26 pm

Looks good but what if you want to use the target feature but also want to drag multi-bodys?

GoatFoot
a lesser mummy
a lesser mummy
Posts: 68
Joined: Fri Jan 17, 2003 1:48 am

Post by GoatFoot » Tue Oct 14, 2003 4:36 pm

UNTESTED!

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

in_training
Craptastic
Posts: 115
Joined: Fri Oct 10, 2003 8:25 am

Post by in_training » Sun Oct 19, 2003 12:51 pm

Is there any to add a Z difference check too? I was dragging someone (ok, a few someones) up a tube and because I was never more then X to the X or Y of them, it refused to drag them up the tunnel.

ionsf
a ghoul
a ghoul
Posts: 94
Joined: Wed Jan 14, 2004 10:19 pm

Post by ionsf » Wed Jan 14, 2004 10:21 pm

Do you have to re-execute the /macro drag.mac ionsf each time to drag the corpse?

bob_the_builder
a hill giant
a hill giant
Posts: 275
Joined: Tue Jul 22, 2003 1:22 pm

Post by bob_the_builder » Thu Jan 15, 2004 12:33 pm

Do you have to re-execute the /macro drag.mac ionsf each time to drag the corpse
Run the MACRO until you have all the corpses are at the final spot, then end the macro. Go to the area with more corpses, start the macro and drag them back to the fianl spot, then end the macro.

Bob

Ahroun
orc pawn
orc pawn
Posts: 10
Joined: Wed Feb 18, 2004 10:56 pm

Post by Ahroun » Fri Mar 05, 2004 1:54 am

Would there be a way to make this parce the corpses in a zone with in X radius put them into an aray and then drag them? just a thought for raid lvl CR.

ogrestud
decaying skeleton
decaying skeleton
Posts: 3
Joined: Fri Mar 05, 2004 4:52 pm

just an idea

Post by ogrestud » Fri Mar 05, 2004 4:55 pm

Is there anyway that you can run the macro, it targets a set number of corpses as in usage /macro drag 10 and that targets 10 corpes within a set radius and adds them to an array in which it continues to drag those 10 corpses until you /end... this way if you are on a raid, you can drag 3 or 4 at a time, and not have to make hot keys with 100 peoples names on it.

lestor
orc pawn
orc pawn
Posts: 16
Joined: Sat Jan 10, 2004 6:31 am

Post by lestor » Fri Mar 05, 2004 6:19 pm

As requested:

This is the drag macro I use... altered it to include the dragging of the nearest # corpses. You can specify the number of nearest corpses to drag, or provide a list of names.

Code: Select all

| Corpse dragging macro by Lestor
| Usage:  /macro drag < # | corpse1> [corpse2] [corpse3] etc...
|         To drag multiple corpses of the same person use:
|          /macro drag <name> "<name next>", adding another "<name next>" for each addition corpse.

#turbo

Sub Main 
	/declare count global
	/declare corpses array
	/declare display global

	/if $defined(Param0)==FALSE { 
		/echo Usage:  /macro drag < # | corpse1> [corpse2] [corpse3] etc...
		/echo -  TO drag multiple corpses of the same person use:
		/echo -   /macro drag <name> "<name next>", adding another "<name next>" for each addition corpse.
		/return
		}

	/varset count 0
	/varset display "Dragging: "

	/if n @Param0<0 /goto :Loop

	/target corpse
	/varset corpses(0) $target(id)
	
	:Loop
		/if n @Param0==0 /if $defined(Param$int(@count))==FALSE /goto :StartDrag
		/if n @Param0>0 /if n @count==@Param0 /goto :StartDrag
		/target corpse $if(n,@Param0>0,next,@Param$int(@count))
		/delay 1
		/varcat display "$left($calc($strlen("$target(name,clean)")-9),"$target(name,clean)"), "
		/varset corpses($int(@count)) $target(id)
		/varadd count 1
		/goto :Loop
	:StartDrag
		/varset count 0
		/varset display "$left($calc($strlen("@display")-2),"@display")"
		/echo @display
	:Drag
		/if @corpses($int(@count))==UNDEFINED-ARRAY-ELEMENT /varset count 0
        	/target id @corpses($int(@count))
        	/delay 2
        	/corpse
        	/delay 2
		/varadd count 1
	/goto :Drag
/return
Cheers,

Les

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

Post by ieatacid » Thu Apr 15, 2004 8:21 pm

Anyone getting disconnected using this? It worked great up until a week or so ago. Now as soon as I start it and drag a little ways I get "You have been disconnected".

eqaussie
a ghoul
a ghoul
Posts: 124
Joined: Tue Mar 16, 2004 5:58 am

Post by eqaussie » Thu Apr 15, 2004 11:45 pm

I did, used it in PoWater, i figured it was the lag in PoWater.

I did read in another thread that ml2517 had noticed things go nuts with macros and delays, im guessing that could be part of it, but have no idea where to look to rectify :)

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

Post by ieatacid » Thu Apr 15, 2004 11:54 pm

Yeah, I'm hoping this had something to do with it: http://macroquest2.com/phpBB2/viewtopic.php?t=6307

Hopefully turning #turbo down will remedy it.

Smitty
orc pawn
orc pawn
Posts: 25
Joined: Sun Dec 21, 2003 8:56 pm

Post by Smitty » Sat Apr 24, 2004 5:40 pm

anyone able to fix this macro?]]\\\

doesnt seem to be working.


thanks
Smitty