Official ScriptUO EasyUO Scripts > Script Snippets

attack nearest hostile

(1/2) > >>

Cerveza:
Will attack closest targets, very useful for spawn or farming stuff.


--- Code: ---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
--- End code ---

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

UOMaddog:
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!

Outlaw Josey Wales:
if my wife ever brings me my mouse to the hospital ill do some testing on some of this awesome stuff

A LLama:

--- Quote from: 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!

--- End quote ---

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

Endless Night:

--- Quote from: A LLama on September 23, 2012, 05:24:33 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

--- End quote ---

try this section http://www.scriptuo.com/index.php?board=17.0

Navigation

[0] Message Index

[#] Next page

Go to full version