Last target = Attacker (who is attacking you)

Ask for scripts here

Moderators: Murderator+, Murderator

Post Reply
tEhfO
Posts: 7
Joined: 2012-02-17 19:44:59

Last target = Attacker (who is attacking you)

Post by tEhfO »

Hi, someone has a macro to set the Last Target as the Person who is attacking you?

Example, X is attacking me, automatically my lasttarget will be him.

And I need that the person who is casting spells at you is the lasttarget too. Or attacker or the one who is casting spells at you.

Thanks!
Last edited by tEhfO on 2012-02-18 14:33:48, edited 1 time in total.
Nmy
Expert!
Posts: 2152
Joined: 2005-09-14 15:31:58
Location: Latvia

Re: Last target = Attacker (who is attacking you)

Post by Nmy »

Code: Select all

sub attack()
   var enemy=uo.journalserial(uo.injournal('is attacking you')-1)
   if enemy<>'0x00000000' then
      if uo.getnotoriety(enemy)<>1 then
         uo.set('lasttarget',enemy)
         uo.print(uo.getname(enemy))
      endif
   endif
   uo.deletejournal()
endsub


or

Code: Select all

sub attack()
   var enemy=uo.journalserial(uo.injournal('is attacking you')-1)
   if enemy<>'0x00000000' then
      uo.set('lasttarget',enemy)
      uo.print(uo.getname(enemy))
   endif
   uo.deletejournal()
endsub


This needs to be tested. I'm not sure
tEhfO
Posts: 7
Joined: 2012-02-17 19:44:59

Re: Last target = Attacker (who is attacking you)

Post by tEhfO »

Thanks man, i'll test it and than i'll reply to you! The server is offline now for maintance.
But sometimes people only start to cast spells at me, so, the macro will not get the enemy because the warning of "is attacking you" is not at the journal...
Is that right?
tEhfO
Posts: 7
Joined: 2012-02-17 19:44:59

Re: Last target = (who is attacking you) or casting spells

Post by tEhfO »

Hey man, it worked, thanks!
But how can I do to mark the lasttarget as the person who is casting spells at me?
Maybe using the .detail ON...
XXX hit you at the back!
For example...
Or whithout the detail on...
Thanks!
Post Reply