i have a problem with my script. I´m searching for some kind types in my script through findtype. If i find some targets i want to cast spells from scrolls or fire from cavalry crossbow on the target, but i can´t even if i stare the target through finditem. I need to switch the target from finditem to lasttarget, but don´t know why . Can someone help me?
sub main() var x,i,oops dim xxx[3] xxx[1]=0x0000 xxx[2]=0x0000 xxx[3]=0x0000 UO.exec('set distance 12') UO.exec('set finddistance 12') while not uo.dead() for i=1 to 3 wait(50) uo.FindType(xxx[i],'-1','ground') if UO.FindCount() >= 1 then oops=uo.getserial('finditem') UO.cast( 'Needed spell', oops) end if next wend end sub
sub main()
var n
Dim A[4]
A[1] = 0x0000;
A[2] = 0x0000;
A[3] = 0x0000;
A[4] = 0x0000;
FOR n=1 TO 4
UO.FindType(A[n],"-1",'ground')
UO.AddObject("cil","finditem")
UO.UseObject('finditem')
uo.msg(".stare")
UO.WaitTargetObject("cil")
wait(100)
UO.msg('.cast_lt 105')
End if
NEXT
end sub
sub para()
If UO.Count("0x1F52") >= 1 then
uo.waittargetobject("cil")
uo.usetype("0x1F52","0x054A")
else
UO.msg('.cast_lt 138')
endif
end sub
OK, guys. There is my searching skript and my skript for paralyze casting from silent scrolls if is any of them equipped. As you can see i´m searching for targets through findtype, but i´m casting paralyze on lasttarget and there is a difference between findtype target and lasttarget.
I solve that problem using uo.addobject. Now it´s working, but i´d love to know if it can be transfered somehow from findtype object to lasttarget object.
GrandMaster Ranger wrote:If you cast a spell on object ( for example finditem ) , it automatically become lasttarget....... it's working? yes... need something else?
It´s quite weird, but i can´t. If i stare for example rune to teleport and then i find target through findtype macro i can cast easily spells on that target, but if i want to cast spells from scrolls i cast at that rune, thats the problem i just wanna solve.