ScriptUO
Official ScriptUO EasyUO Scripts => Scripting Chat => Topic started by: M4yH3m on March 28, 2020, 03:47:48 AM
-
How would I write a tamer script that will scan for a specific monster and say all kill and then target that monster?
-
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.
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
Or something close to that.
You probably want reasonable waits in there somewhere... that is not tested code... just an outline.
-
Awesome man! I will give this a try! Thank you so much
-
Instead of a wait timer, could I do something like this?
until %prey = 0
-
Anyone? lol
-
In the above context, the variable %prey is a list of types for various monsters.
There are other ways to test that there are no more monsters in range. I would rely on the #findcnt variable after the finditem statement to decide how to proceed.
Gaderian
-
tyvm :)