-
onehand2
- Posts: 12
- Joined: Sat Jan 08, 2011 1:01 am
#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
Thank you
-
rock5
- Posts: 12173
- Joined: Tue Jan 05, 2010 3:30 am
- Location: Australia
#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.”
-
onehand2
- Posts: 12
- Joined: Sat Jan 08, 2011 1:01 am
#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
sorry LOL
-
rock5
- Posts: 12173
- Joined: Tue Jan 05, 2010 3:30 am
- Location: Australia
#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.”
Who is online
Users browsing this forum: Ahrefs [Bot] and 0 guests