ScriptUO

Official ScriptUO EasyUO Scripts => Script Debug => Topic started by: crameep on November 30, 2009, 08:57:31 AM

Title: EnemyID and Pets
Post by: crameep on November 30, 2009, 08:57:31 AM
Hi, I just started playing some UO again after a while, I started using my AutoKill Script its posted in the scripts section of this forum and theres a strange bug with EnemyID where after I drag my pets bar EnemyID stays as my Pet ID no matter what. I've been trying to figure out a way to work around this. Any Ideas?
Title: Re: EnemyID and Pets
Post by: Xclio on November 30, 2009, 09:10:00 AM
EnemyID is broken last I knew for EUO...I have was having alot of issues with it about 3-4 months ago if I remember right.
Title: Re: EnemyID and Pets
Post by: crameep on November 30, 2009, 09:12:26 AM
So, i need to find an alternative way for finding out if my enemy is dead eh?
Title: Re: EnemyID and Pets
Post by: Cerveza on November 30, 2009, 09:21:32 AM
The best way is to get the specific ID of whatever your trying kill, and seeing if it's still there.

Code: [Select]
sub killstuff
finditem %monsters_from_list G_12
if #findCnt < 1 ; didn't find it
  return ; so go back
set #ltargetID #findID
set %target #findID ; you set that specific ones ID
set #ltargetKind 1 ; don't forget this
event macro 27 0 ; attack last target, I use this with my archer
; msg ALL KILL $ ; for you tamers
; target 3s
; event macro 22 0 ; last target
;
; ok now when will you know if it's dead?
;
set %killing_timer ( #sCnt + 30 ) ; set this to the max time it takes you to kill... plus 5-10
repeat
finditem %target G_12 ; looks for the id of your targetted monster
until #findCnt < 1 || #sCnt > %killing_timer
return

So you just repeat looking for the specific ID of your target. You could put in some healing stuff in there also, or healing pets if you do that. Just include it in the repeat/until portion. The %killing_timer is just a safety incase the monster suddenly disappears or wanders away.
Title: Re: EnemyID and Pets
Post by: rana70 on November 30, 2009, 09:27:03 AM
So, i need to find an alternative way for finding out if my enemy is dead eh?

Hi,

I haven't used #EnemyID for a while so I don't  know if it is broken,
but you can check the #EnemyID against your pedID to make sure it is not
your ped you track and if the #EnemyID is set correctly you can use #EnemyHits
to see if it is dead.

But to be honest .. I would go the old style way ..
track down your enemy and find it's ID eg with a FindItem and
check if it is killed simply with the same command...
if you have a  #FindCnt < 1 ... it is dead ...

cu
Title: Re: EnemyID and Pets
Post by: crameep on November 30, 2009, 09:46:45 AM
Surprisingly my code is simalar to that already I just used

while n/a notin enemyid to keep attacking :) just a little change needed to fix it. Surprised thats all thats broken in my script after this long.

Edit: Thanks for the words of wisdom :p.