Official ScriptUO EasyUO Scripts > Scripting Chat

Need help

(1/2) > >>

M4yH3m:
How would I write a tamer script that will scan for a specific monster and say all kill and then target that monster?

Gaderian:
one way would be to define a variable to hold the types for any monsters you wish to attack.
then using finditem you process the monsters for closest testing out #finddist.
finally issue the message for "all kill" and target the chosen #findid.


--- Code: ---set %prey _ED_ ; this will be a list of monster types
set %stop = #false
repeat
finditem %prey G_10
if #findcnt > 0
 {
 set %closest 11 ; set to further than i am looking (G_10 means 10 tiles)
 for #finditem 1 #findcnt
  {
  if #finddist < %closest
   {
   set %closestID #findid
   set %closest #finddist
   }
  }
  event macro 1 0 all kill
  target 2s
  set #ltargetid %closestID
  set #ltargetkind 1
  event macro 22
  wait 20
 }
until %stop = #true
--- End code ---

Or something close to that.
You probably want reasonable waits in there somewhere... that is not tested code... just an outline.

M4yH3m:
Awesome man! I will give this a try! Thank you so much

M4yH3m:
Instead of a wait timer, could I do something like this?

until  %prey = 0

M4yH3m:
Anyone? lol

Navigation

[0] Message Index

[#] Next page

Go to full version