Mushroomstamp
Posts: 210 Joined: Wed Oct 27, 2010 11:34 am
#1
Post
by Mushroomstamp » Sat Jun 18, 2011 7:36 pm
What does my script need to look like to change what my character is doing if a memory drops from Ensia? The quotes around "memory", and only needing one are making me unsure. This is my best guess;
Code: Select all
if not 1 > inventory:getItemCount('[Ensia's "Memory"]') then
do something else
end
MiesterMan
Posts: 543 Joined: Tue Jul 06, 2010 9:15 pm
Location: Between the Second and Third Circles of Hell
#2
Post
by MiesterMan » Sat Jun 18, 2011 8:28 pm
Code: Select all
if not 1 > inventory:getItemCount("[Ensia's \"Memory\"]") then
do something else
end
Edit: You can also use the ID instead. Personally I'd just scan the bags like this:
Code: Select all
for i,v in pairs(inventory.BagSlot) do
if inventory.Bagslot[i].Name == "[Ensia's \"Memory\"]" then
dosomethingspecial();
end
end
rock5
Posts: 12173 Joined: Tue Jan 05, 2010 3:30 am
Location: Australia
#3
Post
by rock5 » Sat Jun 18, 2011 8:49 pm
Code: Select all
if not 1 > inventory:getItemCount("[Ensia's \"Memory\"]") thenThis is a bit confusing. Why not just use.
Code: Select all
if inventory:getItemCount("[Ensia's \"Memory\"]") > 0 thenI'm not sure how you will use this to stop it looting it though.
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.”
rock5
Posts: 12173 Joined: Tue Jan 05, 2010 3:30 am
Location: Australia
#4
Post
by rock5 » Sat Jun 18, 2011 9:00 pm
I just had another look at this. Why do you have brackets around the name?
Should be this I think.
Code: Select all
if inventory:getItemCount("Ensia's \"Memory\"") > 0 thenor use the id like MiesterMan said.
Code: Select all
if inventory:getItemCount(204883) > 0 then -- Ensia's Memory
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.”
Mushroomstamp
Posts: 210 Joined: Wed Oct 27, 2010 11:34 am
#5
Post
by Mushroomstamp » Sat Jun 18, 2011 9:48 pm
I thought the brackets might have been necessary since memory is in quotes. Overthought it a bit I suppose.
Thanks for the help guys. *thumbup*
MiesterMan
Posts: 543 Joined: Tue Jul 06, 2010 9:15 pm
Location: Between the Second and Third Circles of Hell
#6
Post
by MiesterMan » Mon Jun 20, 2011 12:01 am
Oh, I'm sorry. I was so tired earlier I didn't even realize there were brackets in there! Yea, no brackets.