ScriptUO
Official ScriptUO EasyUO Scripts => Script Debug => Topic started by: Grandewd on September 13, 2013, 04:06:09 PM
-
I need to know if my char is holding an item or if that item is simply in his backpack.
For instance:
finditem %someitem #CHARID
will find %someitem in my hand if it's there, but also in my backpack if it's in the top level.
The item is a spellbook and will ALWAYS be in one or the other of those 2 places. If it's in his hand, I need to drop it with event macro 24 2. But, if it's in his backpack - I need to ignore it.
How can I tell where my %someitem currently is?
I suppose I could see if it's in his backpack with:
finditem %someitem C_ , #backpackID
and then act accordingly, but is this the only way to tell if it's in his hand or not???
:(
-
First find the item then, if it exists, find it in the backpack. If it doesn't exist then it's in the hand?
finditem %someitem #CHARID
if #findkind = -1
set %InHand #FALSE
else
{
finditem %someitem C_ , #backpacked
if #findkind = -1
set %InHand #TRUE
else
set %InHand #FALSE
}
Or something like that. I'm kind of tired right now.
-
Or in Stealth you can just compare ObjAtLayer(RHandLayer) or ObjAtLayer(LHandLayer).
Like for my combat skill trainer.
if GetSkillValue('Swordsmanship') < 100 then
begin
if (GetType(ObjAtLayer(RHandLayer)) = 0) then
begin
UseObject(PullBAG);
wait(500);
if (GetQuantity(FindTypeEx(wep,$FFFF,Backpack,false)) = 0) then
begin
MoveItem(FindTypeEx(wep,$FFFF,PullBAG,false),1,Backpack,0,0,0);
wait(500);
Equip(RHandLayer, FindItem);
end;
Equip(RHandLayer, FindItem);
end;
end;
(GetType(ObjAtLayer(RHandLayer)) = 0) checks the Right Hand, if it has nothing equipped (the item broke from training) then it proceeds.
-
First find the item then, if it exists, find it in the backpack. If it doesn't exist then it's in the hand?
finditem %someitem #CHARID
if #findkind = -1
set %InHand #FALSE
else
{
finditem %someitem C_ , #backpacked
if #findkind = -1
set %InHand #TRUE
else
set %InHand #FALSE
}
Or something like that. I'm kind of tired right now.
Yea, that's pretty much where I headed after thinking more on it. I'm checking #charID first to see if it's anywhere, if it is then on to #backpackID to see if it's there, then on from there.
But, thx for the input...
-
@dxrom: Yea, the more I see regarding Stealth, the more resolved I am to begin it... Being able to actually see directly what is in either hand is really nice.... :)