Inventory Funtion :)

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
onehand2
Posts: 12
Joined: Sat Jan 08, 2011 1:01 am

Inventory Funtion :)

#1 Post by onehand2 » Thu Mar 31, 2011 7:32 am

hi
thx for reponsing me last couple times
here i got another question

i have 150backpack slots
i want to target npc if my backpack is over 140slots

how does the funtion work?

if ()??/ then
play:merchant("NPC_name")

couldnt find any clues on wiki :D

Thank you

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Inventory Funtion :)

#2 Post by rock5 » Thu Mar 31, 2011 7:58 am

Do you mean if you have that many rented? The non-rented slots 'Available' value equals 'false' so you could count the 'Available' values or just check the first slot of each bag. eg,

Code: Select all

local slots = 60 -- first 2 bags be don't need to check
for i = 121, 211, 30 do -- check the first slot of each bag
    if inventory.BagSlot[i].Available then 
        slots = slots + 30
    end
end

if slots > 140 then
    player:merchant("NPC_name")
end
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

onehand2
Posts: 12
Joined: Sat Jan 08, 2011 1:01 am

Re: Inventory Funtion :)

#3 Post by onehand2 » Thu Mar 31, 2011 8:00 pm

ah...sorry i messed up...

i have 150backpack slots

i want to target npc after 140slots are filled with junkies :D

sorry LOL

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Inventory Funtion :)

#4 Post by rock5 » Thu Mar 31, 2011 8:16 pm

In that case count empties.

Code: Select all

if 10 > inventory:itemTotalCount("<EMPTY>","bags") then
    player:merchant("NPC_name")
end
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot] and 0 guests