ScriptUO

Official ScriptUO EasyUO Scripts => Scripting Chat => Topic started by: The Ghost on October 25, 2011, 11:57:34 PM

Title: Trageting ground for spell
Post by: The Ghost on October 25, 2011, 11:57:34 PM
While i cast EV's i need to target the ground,  I'm using the click xxxx yyy, for now,  but if a corpse and anything is on the way, I can't cast.  Here what I have so far can anyone help  thx

This is what I 'm using right now
Code: [Select]
 
if #followers < 5
goto cast

if #followers = 5
gosub invisible
gosub cure
goto scan

cast:
{
event macro 15 57  ; EV's
click 450 370
wait 1s
}
goto scan 

Here what  I'm attempting to do and going  nowhere.    I just what to be able to walk in and cast a few title from myself.
Code: [Select]

sub cast
set %tx #charposx
set %ty #charposy
event macro 15 57
target 3s
set %tx #findx -2
set %ty #findy -2
set #LTargetx %tx
set #LTargety %ty
set #LTargetKind 2
event macro 22
wait 20
return



Title: Re: Trageting ground for spell
Post by: freddy on October 26, 2011, 01:14:41 AM
you could do a search for items within a given range

like
finditem * G_2
if #findkind <> -1
{
for #findindex 1 #findcnt
{
if #findx = %tx && #findy = %ty
{
....
break
}
}
}

use #findx #findy #findz to compare to the x/y/z your spell is casting and if it is the same, then have the script adjust the initial settings to a different spot.
Title: Re: Trageting ground for spell
Post by: 12TimesOver on October 26, 2011, 03:00:17 AM
You are trying to set vars to findx/findy but you never did a finditem:

set %tx #findx -2
set %ty #findy -2

You want to do:

set %tx #charposx - 2
set %ty #charposy - 2

And you don't need to set the variables twice.

X
Title: Re: Trageting ground for spell
Post by: The Ghost on October 26, 2011, 09:30:23 AM
Thx   So here what I did and I insert two location encase one is block.   Do you guy  know of a easier way to do it.

Code: [Select]

set % itemtype *  ;   the * can be replace by any id to want to cast near 
while #true
{
finditem * G_3
while #findcnt <  1[
{
wait 1
finditem * G_3
}
gosub one

sub one
event macro 15 57
target 3s
set %tx #findx -2
set %ty #findy -2
set #LTargetx %tx
set #LTargety %ty
set #LTargetKind 2
event macro 22
wait 20
return
/code]
Title: Re: Trageting ground for spell
Post by: 12TimesOver on October 26, 2011, 09:51:37 AM
Thx   So here what I did and I insert two location encase one is block.   Do you guy  know of a easier way to do it.

Code: [Select]

set % itemtype *  ;   the * can be replace by any id to want to cast near 
while #true
{
finditem * G_3
while #findcnt <  1[
{
wait 1
finditem * G_3
}
gosub one

sub one
event macro 15 57
target 3s
set %tx #findx -2
set %ty #findy -2
set #LTargetx %tx
set #LTargety %ty
set #LTargetKind 2
event macro 22
wait 20
return
/code]

Why not keep it relative to your character's location like you already mentioned so it's usable anywhere that location isn't blocked? Also, you can simplify it a little:

Code: [Select]
sub CastEV
   set #ltargetx #charposx - 2
   set #ltargety #charposy - 2
   set #LTargetKind 2
   event macro 15 57
   target 3s
   event macro 22
   wait 20
return

X
Title: Re: Trageting ground for spell
Post by: The Ghost on October 26, 2011, 08:25:56 PM
Thx lot for the help  that work fine.
Title: Re: Trageting ground for spell
Post by: Cerveza on October 27, 2011, 02:47:28 AM
I use this to cast RC's at Harrowers.

Code: [Select]
set %waiting_to_start #TRUE
while %waiting_to_start = #TRUE
{
  onhotkey F10 alt
    set %waiting_to_start #FALSE
}
set %targetX #charPosX
set %targetY #charPosY
set %targetZ #charPosZ
wait 4s

repeat
if #followers < 4
gosub cast %targetX %targetY %targetZ
while H notin #charStatus
{
event macro 15 43
target 3s
event macro 23
wait 10
}
wait 1
until #false

sub cast
repeat
event macro 15 693
target 5s
set #lTargetX %1
set #lTargetY %2
set #lTargetZ %3
set #lTargetKind 2
event macro 22
wait 5
if #followers < 5
  set %1 ( %1 + 1 )
until #followers = 5
return

Use Alt+F10 when you are standing on the spot you want to cast. Then you have 4 seconds to move to the spot you want to cast from.

Will Invis self between casting.