Page 1 of 1

itemTotalCount not working

Posted: Thu Apr 28, 2011 4:10 pm
by Reymauro
Hi,

I'm having this issue, it seams that is not counting how many Mushroom Stem I have on my bag so he keeps killing and killing and not changing to the next WP

Code: Select all

if (inventory:itemTotalCount("Mushroom Stem") > 10); then loadPaths("rqms");
  	end
Thanks for the help

Re: itemTotalCount not working

Posted: Thu Apr 28, 2011 10:54 pm
by rock5
Can you get more than 10 Stems? If not try ">= 10".

Code: Select all

if (inventory:itemTotalCount("Mushroom Stem") >= 10); then loadPaths("rqms");
     end

Re: itemTotalCount not working

Posted: Fri Apr 29, 2011 1:09 am
by Reymauro
Quantity is not a problem,

I change the code and it didn't work it just keeps killing and killing

Code: Select all

waypoints type="NORMAL">
        <!-- #  1 --><waypoint x="-3707" z="-7508">	</waypoint>
	<!-- #  2 --><waypoint x="-2847" z="-7773">	</waypoint>
	<!-- #  3 --><waypoint x="-3705" z="-7142">
	if (inventory:itemTotalCount("Mushroom Stem") >= 10); then loadPaths("rqms");
     end

	</waypoint>
</waypoints>


Thanks again

Re: itemTotalCount not working

Posted: Fri Apr 29, 2011 1:48 am
by Giram
rock5 wrote:Can you get more than 10 Stems? If not try ">= 10".

Code: Select all

if (inventory:itemTotalCount("Mushroom Stem") >= 10); then loadPaths("rqms");
     end
does that semicolon mess things up in middle of if statement? try one of fallowing.

Code: Select all

if (inventory:itemTotalCount("Mushroom Stem") >= 10) then 
loadPaths("rqms");
end
or

Code: Select all

if (inventory:itemTotalCount(201168) >= 10) then 
loadPaths("rqms");
end

Re: itemTotalCount not working

Posted: Fri Apr 29, 2011 2:00 am
by rock5
Giram wrote:does that semicolon mess things up in middle of if statement? try one of fallowing.
Yes it does. I didn't say anything because Lisa already pointed that out in the the other post Reymauro posted about this. Naughty Reymauro double posted.

Re: itemTotalCount not working

Posted: Fri Apr 29, 2011 4:15 am
by lisa
rock5 wrote:
Giram wrote:does that semicolon mess things up in middle of if statement? try one of fallowing.
Yes it does. I didn't say anything because Lisa already pointed that out in the the other post Reymauro posted about this. Naughty Reymauro double posted.
Yeah I pointed out the problem already in a different topic =)

Re: itemTotalCount not working

Posted: Fri Apr 29, 2011 4:38 am
by Giram
Yep, i founded that post after rock5 said about it. I tend quickly scroll through some threads if i don't have a clue what could be wrong there. I still have quite little knowledge about how the bot really works and how things should be.

Re: itemTotalCount not working

Posted: Fri Apr 29, 2011 9:02 am
by Reymauro
I am really sorry about my double posting I wont do it again I promis, when I posted my first one I didn't see it on the page so it got me thinking maybe I posted it in the wrong topic so I posted a new one then I when back to check lisa's topic and I saw that there was a second page..... sometimes I feel like a dumba$$ :)

Thank you all very much for the help

Re: itemTotalCount not working

Posted: Fri Apr 29, 2011 5:40 pm
by Reymauro
Hey guys it didn't change still just killing and killing I don't get it

Code: Select all

<waypoints type="NORMAL">

		<onLoad><![CDATA[

		changeProfileOption("WAYPOINT_DEVIATION", 0);
		changeProfileOption("LOOT", true);



for k,v in pairs(settings.profile.skills) do

    -- List of skills you want to use only as scout
    if v.Name == "SCOUT_SHOT" then

        if player.Class == CLASS_SCOUT then
            settings.profile.skills[k].AutoUse = true
        else
            settings.profile.skills[k].AutoUse = false
        end
    end
end

	]]></onLoad>
	<!-- #  1 --><waypoint x="-3895" z="-7852">	</waypoint>
	<!-- #  2 --><waypoint x="-3712" z="-7576">	</waypoint>
	<!-- #  3 --><waypoint x="-3896" z="-7355">
	
	if inventory:itemTotalCount("Mushroom Stem") >= 40 then
	loadPaths("characters/3");
	end
	
	</waypoint>
	<!-- #  4 --><waypoint x="-3339" z="-7729">	</waypoint>
	<!-- #  5 --><waypoint x="-3211" z="-7563">
	
	if inventory:itemTotalCount("Mushroom Stem") >= 40 then
	loadPaths("characters/3");
	end	
	
	</waypoint>
	<!-- #  6 --><waypoint x="-3355" z="-7940">	</waypoint>
	<!-- #  7 --><waypoint x="-3615" z="-7925">	</waypoint>
	<!-- #  8 --><waypoint x="-3856" z="-7915">	
	
	if inventory:itemTotalCount("Mushroom Stem") >= 40 then
	loadPaths("characters/3");
	end	
Really sorry for being a pain :mrgreen:

Re: itemTotalCount not working

Posted: Fri Apr 29, 2011 7:40 pm
by rock5
Try adding

Code: Select all

print("number of stems", inventory:itemTotalCount("Mushroom Stem"))
just before the if statements and see what it prints.

Re: itemTotalCount not working

Posted: Sat Apr 30, 2011 12:26 am
by Reymauro
If this is correct it is not printing anything

Code: Select all

print("number of stems", inventory:itemTotalCount(201168))
	if inventory:itemTotalCount(201168,all) > 40 then
	loadPaths("characters/3");
	end
I try with "bags" and "all" too

Re: itemTotalCount not working

Posted: Sat Apr 30, 2011 12:39 am
by rock5
It's not printing anything in the micromacro window?

Re: itemTotalCount not working

Posted: Sat Apr 30, 2011 8:36 am
by Reymauro
I see when its changing WP and attacking the mobs but nothing about the items

Re: itemTotalCount not working

Posted: Sat Apr 30, 2011 8:45 am
by rock5
That would suggest that it never actually gets to those waypoints. Watch the micromacro window. Does it ever get to waypoint 3, 5 or 8? Or does it just keep attacking respawning mushrooms? Maybe you need to reduce MAX_TARGET_DIST?

Re: itemTotalCount not working

Posted: Sat Apr 30, 2011 9:56 am
by Reymauro
Thank you very much Rock5 that was it, it was at 250 changed it to 100 and voila!