Author Topic: Differentiating between an item in hand or in backpack  (Read 2521 times)

0 Members and 1 Guest are viewing this topic.

Offline GrandewdTopic starter

  • Full Member
  • ***
  • Posts: 239
  • Activity:
    0%
  • Reputation Power: 3
  • Grandewd has no influence.
  • Respect: +24
  • Referrals: 0
    • View Profile
Differentiating between an item in hand or in backpack
« on: September 13, 2013, 04:06:09 PM »
0
I need to know if my char is holding an item or if that item is simply in his backpack.
For instance:

Code: [Select]
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:

Code: [Select]
finditem %someitem C_ , #backpackID
and then act accordingly, but is this the only way to tell if it's in his hand or not???

 :(

Offline 12TimesOver

  • Another Day, Another Vendetta
  • Global Moderator
  • *
  • *
  • Posts: 3694
  • Activity:
    0%
  • Reputation Power: 41
  • 12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.
  • Gender: Male
  • Respect: +321
  • Referrals: 2
    • View Profile
Re: Differentiating between an item in hand or in backpack
« Reply #1 on: September 13, 2013, 04:56:05 PM »
0
First find the item then, if it exists, find it in the backpack. If it doesn't exist then it's in the hand?

Code: [Select]
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.
      
When they come for me I'll be sitting at my desk
     with a gun in my hand wearing a bulletproof vest
My, my, my how the time does fly
     when you know you're gonna die by the end of the night

Offline dxrom

  • Master of the milestones!
  • Elite
  • *
  • *
  • Posts: 1080
  • Activity:
    0%
  • Reputation Power: 15
  • dxrom is working their way up.dxrom is working their way up.dxrom is working their way up.
  • KEYBOARD COWBOY, GREAT SAMURAI OF THE INTERNET.
  • Respect: +100
  • Referrals: 1
    • View Profile
Re: Differentiating between an item in hand or in backpack
« Reply #2 on: September 13, 2013, 05:42:11 PM »
0
Or in Stealth you can just compare ObjAtLayer(RHandLayer) or ObjAtLayer(LHandLayer).

Like for my combat skill trainer.

Code: [Select]
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.



 ​_██​_
(ಠ​_ృ)
I do say, ol' Chap! Come play EVE Online! Why here is a 21 Day Free Trial!

Offline GrandewdTopic starter

  • Full Member
  • ***
  • Posts: 239
  • Activity:
    0%
  • Reputation Power: 3
  • Grandewd has no influence.
  • Respect: +24
  • Referrals: 0
    • View Profile
Re: Differentiating between an item in hand or in backpack
« Reply #3 on: September 13, 2013, 05:54:15 PM »
0
First find the item then, if it exists, find it in the backpack. If it doesn't exist then it's in the hand?

Code: [Select]
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...
« Last Edit: September 13, 2013, 05:57:22 PM by Grandewd »

Offline GrandewdTopic starter

  • Full Member
  • ***
  • Posts: 239
  • Activity:
    0%
  • Reputation Power: 3
  • Grandewd has no influence.
  • Respect: +24
  • Referrals: 0
    • View Profile
Re: Differentiating between an item in hand or in backpack
« Reply #4 on: September 13, 2013, 05:56:33 PM »
0

@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....  :)

Tags: