ScriptUO
Official ScriptUO EasyUO Scripts => Scripting Chat => Topic started 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.
set %horse SG
finditem %horse G_10
event macro 15 16
target
set #LTargetID %horse
set #LTargetKind
event macros 22
wait 20s
return
-
You need to define your Ltarget
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
-
It still isn't targeting the horse, I am just getting you are already casting a spell
-
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.
-
This is what I use.
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]
-
I added a basic healing to it
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
}
-
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!
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.
-
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.
-
send me and icq crisis
-
Here what I have to Pathfind to corpse
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