Help with drag.mac (GrimJack version)
Posted: Sat May 01, 2004 9:17 pm
I loved this drag macro but I'm having a tough time getting it to work. I think it's something with the array. Any help is appreciated.
Here's what I have so far (old version posted below it for reference)
Original
Here's what I have so far (old version posted below it for reference)
Code: Select all
|drag.mac
|Usage /macro drag.mac name name name... ect ect
|Version 2.5, based on GrimJack's version
|Version 2.5a, gf getting happy.
|Version 2.6, De-Happified it.
#turbo
Sub Main
/declare CorpseID
/declare i
/declare CorpseCount
/declare Bodies[10,10]
/if (!${Defined[Param0]}) /if (${Target.State.NotEqual[DEAD]}) {
/echo Usage: /macro drag.mac corpse1 corpse2 corpse3 ect.
/echo /macro drag.mac <target>
/end
}
/if (${Defined[Param0]}) {
/if (${Target.State.Equal[DEAD]}) /varset Bodies ${Target.ID}
/goto :CorpseCheck
}
/varset i 0
/varset CorpseCount 0
:CountCorpses
/target corpse ${Param${i}}
/varcalc i ${i}+1
/if (${Target.ID}>0) {
/varset Bodies[${CorpseCount}] ${Target.ID}
/varcalc CorpseCount ${CorpseCount}+1
}
/if (${Defined[Param${i}]}) /goto :CountCorpses
/varcalc CorpseCount ${CorpseCount}+1
/echo ${CorpseCount}
:CorpseCheck
/if (!${Defined[Bodies]}) {
/echo No corpses are targetable.
/delay 1
/end
}
/varset i 0
:DragThem
/if (${Spawn[${Bodies[${i}]}].Distance}>25) {
/if (!${Target.ID[Bodies${i}]}) /target id ${Bodies${i}}
:WaitforTarget
/delay 0
/if (!${Target.ID[Bodies${i}]}) /goto :WaitforTarget
/corpse
}
/varcalc i ${i}+1
/delay 0
/if (${i} > ${CorpseCount}) /varset i 0
/goto :DragThem
/returnCode: Select all
|drag.mac
|Usage /macro drag.mac name name name... ect ect
|Version 2.5, based on GrimJack's version
|Version 2.5a, gf getting happy.
|Version 2.6, De-Happified it.
#turbo
Sub Main
/declare CorpseID local
/declare i local
/declare CorpseCount local
/declare Bodies array
/if $defined(Param0)==FALSE /if "$target(type)"!="CORPSE" {
/echo Usage: /macro drag.mac corpse1 corpse2 corpse3 ect.
/echo /macro drag.mac <target>
/end
}
/if $defined(Param0)!=TRUE {
/if "$target(type)"=="CORPSE" /varset Bodies(0) $target(id)
/goto :CorpseCheck
}
/varset i 0
/varset CorpseCount 0
:CountCorpses
/target corpse @Param$int(@i)
/varadd i 1
/if n $target(id)>0 {
/varset Bodies(@CorpseCount) $target(id)
/varadd CorpseCount 1
}
/if $defined(Param$int(@i))==TRUE /goto :CountCorpses
/varsub CorpseCount 1
/echo @CorpseCount
:CorpseCheck
/if $defined(Bodies(0))==UNDEFINED-ARRAY-ELEMENT {
/echo No corpses are targetable.
/end
}
/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
/return