The idea is that it grabs a list of all corpses in a specified radius (user or default radius 20), helps you pile them together and drags them if you have consent. If you don't have consent from a particular corpse it'll drop it off your drag list. This is the first version of this so I expect there to be some issues. Comments/Suggestions/Bug Reports welcome.
Code: Select all
|SmartDrag 1.0
|-----------------------------------------------
|By Cunning
|
|Usage: /macro drag.mac <searchradius (default 20)>
|
|Version History
| 1.0 - Release
Sub Main
/zapvars
/declare Rad local
/declare CorpseList array2
/declare NumCorpse local
/declare NumConsented local
/declare Count local
/declare TargetName local
/declare Msg local
/varset NumCorpse 1
/varset NumConsented 0
/varset Count 1
/echo "SmartDrag 1.0 Starting."
/if (${Defined[Param0]}) {
/varset Rad @Param0
} else {
/varset Rad 20
}
/echo "Building drag list..."
/varset TargetName ${Me.NearestSpawn[@NumCorpse, pc corpse radius @Rad]}
/target @TargetName
/delay 1
/if (${Target.ID} && ${String[@TargetName].NotEqual[NULL]}) {
/varset CorpseList(@NumCorpse,1) @TargetName | Corpse Name
/varset CorpseList(@NumCorpse,2) ${Target.X} | Current Xloc
/varset CorpseList(@NumCorpse,3) ${Target.Y} | Current Yloc
/varset CorpseList(@NumCorpse,4) ${Target.Z} | Current Zloc
/varset CorpseList(@NumCorpse,5) 0 | Ok to Drag
/varadd NumCorpse 1
} else {
/echo "There are no corpses in that radius. Exiting..."
/zapvars
/endmacro
}
:GetCorpseList
/delay 1
/varset TargetName ${Me.NearestSpawn[@NumCorpse, pc corpse radius @Rad]}
/target @TargetName
/delay 4
/if (${Target.ID} && ${String[@TargetName].NotEqual[NULL]}) {
/varset CorpseList(@NumCorpse,1) @TargetName | Corpse Name
/varset CorpseList(@NumCorpse,2) ${Target.X} | Current Xloc
/varset CorpseList(@NumCorpse,3) ${Target.Y} | Current Yloc
/varset CorpseList(@NumCorpse,4) ${Target.Z} | Current Zloc
/varset CorpseList(@NumCorpse,5) 0 | Ok to Drag
/varadd NumCorpse 1
/goto :GetCorpseList
}
/echo "Drag list completed. Body count = @NumCorpse."
:CheckDrag
/delay 1
/varset Msg 0
/if (@Count>=@NumCorpse) /goto :DragCorpses
/keypress esc
/target @CorpseList(@Count,1)
/delay 4
/face nolook fast
:CheckDistance
/delay 1
/if (${Target.ID}>0 && @CorpseList(@Count,2)==${Target.X} && @CorpseList(@Count,3)==${Target.Y} && @CorpseList(@Count,4)==${Target.Z}) {
/corpse
/delay 10
/if (@CorpseList(@Count,2)!=${Target.X} || @CorpseList(@Count,3)!=${Target.Y} || @CorpseList(@Count,4)!=${Target.Z}) {
/varset CorpseList(@Count,5) 1
/varadd NumConsented 1
/echo "@CorpseList(@Count,1)'s corpse moved on /corpse."
}
}
}
/varadd Count 1
/goto :CheckDrag
:DragCorpses
/delay 1
/varset Count 1
/echo "@NumConsented out of @NumCorpse gave consent."
/if (@NumConsented>0) {
:DragCorpseLoop
/if (@Count>@NumConsented) /varset Count 1
/delay 1
/if (@CorpseList(@Count,5)==1) {
/target @CorpseList(@Count, 1)
/delay 3
/if (${Target.Distance}<${Target.MaxRange}) /corpse
}
/varadd Count 1
/goto :DragCorpseLoop
}
/endmacro



