ScriptUO

Official ScriptUO EasyUO Scripts => Script Snippets => Topic started by: Cerveza on May 23, 2011, 09:40:13 AM

Title: attack nearest hostile
Post by: Cerveza on May 23, 2011, 09:40:13 AM
Will attack closest targets, very useful for spawn or farming stuff.

Code: [Select]
repeat
gosub attack
repeat
  namespace copy TM_loot_in_progress from global TM_loot
until !TM_loot_in_progress <> #TRUE
until #false

sub attack
if #targCurs = 1 || #lLiftedKind = 1
  return
event macro 52 1
wait 10
event macro 53
wait 20
return

It's CLAw sensing, could put in healing sensing as well...
Title: Re: attack nearest hostile
Post by: UOMaddog on May 23, 2011, 10:09:38 AM
Very nice! Three comments

I wrote a similar snippet (no Claw sensing) and discovered 3 things:
#1 - to prevent spamming while dead, I put in a loop to check for #charghost and it just does a "wait 1" if you're dead so you don't get the stupid messages flying up your screen about not being able to do it while dead
#2 - if you're on a regular character (read #3 and you'll understand), only do the gosub attack if you're over a certain HP so that you aren't luring in more things while you're low on health
#3 - if you're on a sampire/whammy, disregard #2 and make sure you're always attacking so that you can leech back life! I made the mistake of keeping #2 in for a while on my sampire and it sucked because when I got low, it would stop targeting! LOL

I also like you're check for targeting cursor and something being currently lifted!! I might just have to add that to mine!
Title: Re: attack nearest hostile
Post by: Outlaw Josey Wales on May 24, 2011, 04:03:51 AM
if my wife ever brings me my mouse to the hospital ill do some testing on some of this awesome stuff
Title: Re: attack nearest hostile
Post by: A LLama on September 23, 2012, 05:24:33 PM
Very nice! Three comments

I wrote a similar snippet (no Claw sensing) and discovered 3 things:
#1 - to prevent spamming while dead, I put in a loop to check for #charghost and it just does a "wait 1" if you're dead so you don't get the stupid messages flying up your screen about not being able to do it while dead
#2 - if you're on a regular character (read #3 and you'll understand), only do the gosub attack if you're over a certain HP so that you aren't luring in more things while you're low on health
#3 - if you're on a sampire/whammy, disregard #2 and make sure you're always attacking so that you can leech back life! I made the mistake of keeping #2 in for a while on my sampire and it sucked because when I got low, it would stop targeting! LOL

I also like you're check for targeting cursor and something being currently lifted!! I might just have to add that to mine!

I really hate to be the one to bring up a dead post, but this is a good learning example?

how would i take this^^ and add it to snippets im throwing together? i am trying to learn how to make the script "flow"? but its rough finding learning material.

sorry gentlemen Resurrecting the dead
Title: Re: attack nearest hostile
Post by: Endless Night on September 23, 2012, 08:35:49 PM
I really hate to be the one to bring up a dead post, but this is a good learning example?

how would i take this^^ and add it to snippets im throwing together? i am trying to learn how to make the script "flow"? but its rough finding learning material.

sorry gentlemen Resurrecting the dead

try this section http://www.scriptuo.com/index.php?board=17.0
Title: Re: attack nearest hostile
Post by: unbelromano on May 02, 2022, 10:09:53 AM
Will attack closest targets, very useful for spawn or farming stuff.

Code: [Select]
repeat
gosub attack
repeat
  namespace copy TM_loot_in_progress from global TM_loot
until !TM_loot_in_progress <> #TRUE
until #false

sub attack
if #targCurs = 1 || #lLiftedKind = 1
  return
event macro 52 1
wait 10
event macro 53
wait 20
return

It's CLAw sensing, could put in healing sensing as well...

hi i know this is a old thread
is possibile to ignore monsters? or ignore energy vortex and reaper?
is really annoying when you ciccle on monster and there are some vortex or reaper around  :-[

thx :)

Post Merge: May 03, 2022, 09:30:27 AM
someone?  :'(