1
Script Debug / pet attack with location error
« on: February 28, 2019, 10:41:05 AM »
hello all, having trouble getting my pet attack sub working correctly.
what im trying to do is this
check for closest enemy
{
if find enemy found
{
set pet current location
{
killloop:
have pet attack nearest target
{
check pets location, if pet is in same location return to kill loop
{
if pet location changed halt
what i wrote is not working correctly, looking for any help i can get
what im trying to do is this
check for closest enemy
{
if find enemy found
{
set pet current location
{
killloop:
have pet attack nearest target
{
check pets location, if pet is in same location return to kill loop
{
if pet location changed halt
what i wrote is not working correctly, looking for any help i can get
Code: [Select]
set %monstertype ZC_WE_IJB_
set %petid PDZR
set %scanpk
for %searchDistance 1 10
{
finditem %monstertype G_ , %searchdistance
if #findcnt > 0
{
finditem %petid
wait 5
set %petidx #findx
set %petidy #findy
}
killloop:
finditem %monstertype G_ , %searchdistance
if #findcnt > 0
{
set #ltargetid #findid
msg all kill$
wait 5
target
event macro 22 0
}
finditem %petid
if %petid = %petidx || %petid = %petidy
{
event sysmessage attack again
goto killloop
if %petid <> %petidx || %petid <> %petidy
{
event sysmessage pet moving
halt
}
}