help with targeting

General Injection issues

Moderators: Murderator+, Murderator

Post Reply
zombiemoses
Posts: 13
Joined: 2006-02-04 22:59:40

help with targeting

Post by zombiemoses »

is there a command that will target a monster randomly on the screen to cast a spell on. im lumber jacking and tree ents spawn every once in awhile and i want to cast a spell on them to get them to attack me right away.
zombiemoses
Posts: 13
Joined: 2006-02-04 22:59:40

Post by zombiemoses »

something like this

UO.Exec("cast 'Magic Arrow' ????")

or just attack a monster somehow would work
flake
Expert!
Posts: 746
Joined: 2004-08-11 23:56:17
Location: The Citadel
Contact:

Post by flake »

If you know the type of the ants it is no problem.

Code: Select all

uo.findtype( 'type_here', '-1', 'ground' )
    if uo.findcount() then
      uo.warmode(1)
      uo.attack('finditem')
   endif
zombiemoses
Posts: 13
Joined: 2006-02-04 22:59:40

Post by zombiemoses »

is there no way to target it with a spell? im running a lumber jacking srcipt and i want the ent to attack ME and it has a slow agro so i figure the best way would be to hit it with a spell like magic arrow. i tried the one you gave me but sometimes it moves out of the line of site so it ends up not attacking me and my script just sits there waiting for the next commands to set it off wich is the death of the ent.
flake
Expert!
Posts: 746
Joined: 2004-08-11 23:56:17
Location: The Citadel
Contact:

Post by flake »

Code: Select all

uo.findtype( 'type_here', '-1', 'ground' ) 
    if uo.findcount() then
      uo.warmode(1)
      uo.cast('Magic Arrow', 'finditem')
   endif
zombiemoses
Posts: 13
Joined: 2006-02-04 22:59:40

Post by zombiemoses »

it sorta works...when the ent appears it casts the spell and all but it does it over and over and doesnt stop, and it does it so fast that it fizzles before the spell could get off. i just want to do it once the ent will attack me then just melee it do death
flake
Expert!
Posts: 746
Joined: 2004-08-11 23:56:17
Location: The Citadel
Contact:

Post by flake »

It will now wait till the ent is dead. You can also insert some healing functions.

Code: Select all

uo.findtype( 'type_here', '-1', 'ground' ) 
    if uo.findcount() then
      uo.warmode(1)
      uo.cast('Magic Arrow', 'finditem')
        repeat
           wait(500)
       until uo.dead('finditem')
    endif
Post Reply