ScriptUO

Official ScriptUO EasyUO Scripts => Scripting Chat => Topic started by: Crisis on March 14, 2015, 07:24:56 AM

Title: Targeting Issues
Post by: Crisis on March 14, 2015, 07:24:56 AM
I am very confused on this and boy does it show. I am trying an easy little snippet trying to figure out how to cast a spell onto a target that is not myself. I am in the Skara Stable Pen and trying to cast bless onto a horse. I know it won't let me perform beneficial acts but it allows me to see that it is working when that system message comes up. However, I am doing it wrong cause I am getting the targeting cursor from casting but that is it.

Code: [Select]
set %horse SG

finditem %horse G_10
event macro 15 16
target
set #LTargetID %horse
set #LTargetKind
event macros 22
wait 20s
return
Title: Re: Targeting Issues
Post by: The Ghost on March 14, 2015, 08:49:47 AM

You need to define your Ltarget

Code: [Select]
set %horse SG
finditem %horse G_10

 set #ltargetkind 1     ; <-----------------
    set #ltargetid %horse
    event macro 15 16
    target 3s
    event macro 22 0
    wait 20
 
Title: Re: Targeting Issues
Post by: Crisis on March 14, 2015, 09:52:49 AM
It still isn't targeting the horse, I am just getting you are already casting a spell
Title: Re: Targeting Issues
Post by: TrailMyx on March 14, 2015, 10:44:24 AM
It still isn't targeting the horse, I am just getting you are already casting a spell

Try targeting with the #FINDID of the horse, not the #FINDTYPE.
Title: Re: Targeting Issues
Post by: The Ghost on March 14, 2015, 01:55:42 PM
This is what I use.

Code: [Select]
finditem XI G_10
if #findcnt > 0
{
  set #ltargetkind 1
  set #ltargetid #findid
  event macro 15 17 
  target 3s
  event macro 22
  wait 2s
}
/code]
Title: Re: Targeting Issues
Post by: Crisis on March 14, 2015, 04:05:50 PM
I added a basic healing to it

Code: [Select]
finditem QHB_PHB G_5
if #findcnt > 0
  {
  set #ltargetkind 1
  set #ltargetid #findid
  event macro 15 41
  target 3s
  event macro 22
  wait 2s
  }
if #HITS < ( #MAXHITS - 30 )
  {
  set #lobjectid
  event macro 15 28
  wait 20
  target
  event macro 23 0
  wait 20
  }
Title: Re: Targeting Issues
Post by: Crisis on March 14, 2015, 05:04:58 PM
Ok I added  a very basic pathfind to corpse but the whole thing is very rough. I know I should have seperate subs for health monitor, attack, and pathfind to body but I am working on just getting them working before trying to make them all seperate and then to work together lol. I think I am in over my head but it is fun. Thanks Ghost for all the help so far!

Code: [Select]
finditem QHB_PHB G_9
if #findcnt > 0
  {
  set #ltargetkind 1
  set #ltargetid #findid
  event macro 15 41
  target 3s
  event macro 22
  wait 2s
  }
if #HITS < ( #MAXHITS - 30 )
  {
  set #lobjectid
  event macro 15 28
  wait 20
  target
  event macro 23 0
  wait 20
  }
finditem YFM G_9
if findcnt > 0
  {
  event pathfind #findx #findy #charposz
  wait 4s
  until #charposx = #findx && #charposy = #findy
  wait 2s
  if #findkind = -1
  {
return

How do I get the pathfind to stop after it goes to the corpse the first time? I believe that if #findkind = -1 means that it will stay there until the corpse decays but not sure how else to do it.
Title: Re: Targeting Issues
Post by: Crisis on March 15, 2015, 07:44:31 PM
Would there by chance be someone that might want to work with me and help me make a proper healing and attack sub. This works but won't cut it for my powder quest script. I need to make a solid workable heal sub and a separate attack sub.

I am not looking for someone to do the work for me but that may be able to explain a couple of subs that I am looking at. I get lost when the subs seem to deal with %1 %2 etc and seem to be for generic instances. I understand that they work well because TM has some killer scripts like his FAF. I want to understand how they work and I guess it is something that I cannot figure out on my own.

I have been looking at tutorials here and on EUO but they don't really cover attacking and pathfinding to corpses and then starting the search all over again.
Title: Re: Targeting Issues
Post by: Tidus on March 15, 2015, 08:54:15 PM
send me and icq crisis
Title: Re: Targeting Issues
Post by: The Ghost on March 16, 2015, 01:34:19 PM
Here what I have to Pathfind to corpse

Code: [Select]
sub gatherLeather
set %itemtype YFM

finditem %itemtype G_9
repeat
event pathfind #findx #findy #charposz
wait 4s
if #findkind = -1
{
return
}

finditem KFR_HFR C_ , #backpackid
if #findkind = 1
set #lobjectid HFR
set #lobjectid #findID
event macro 17
wait 10
finditem %itemtype G_2
set #ltargetid #findid
set #ltargetkind 1
event macro 22
ignoreitem #findid
wait 1s
If #weight > %recallweight
{
 gosub unloadbase
}
return