Moderator: MacroQuest Developers
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

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